-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove tutorial options and explanations.
Needed to make the tutorial more useful to learners.
- Loading branch information
1 parent
d919d65
commit 6ccf0c7
Showing
2 changed files
with
58 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Part 0 - Setting up a project | ||
############################################################################## | ||
|
||
Starting tools | ||
============================================================================== | ||
|
||
The IDE used for this tutorial is `Visual Studio Code <https://code.visualstudio.com/>`_ (not to be mistaken for Visual Studio). | ||
|
||
Git will be used for version control. | ||
`Follow the instructions here <https://git-scm.com/downloads>`_. | ||
|
||
Python 3.11 was used to make this tutorial. | ||
`Get the latest version of Python here <https://www.python.org/downloads/>`_. | ||
If there exists a version of Python later then 3.11 then install that version instead. | ||
|
||
|
||
First script | ||
============================================================================== | ||
|
||
First start with a modern top-level script. | ||
Create a script in the project root folder called ``main.py`` which checks ``if __name__ == "__main__":`` and calls a ``main`` function. | ||
|
||
.. code-block:: python | ||
def main() -> None: | ||
print("Hello World!") | ||
if __name__ == "__main__": | ||
main() | ||
In VSCode on the left sidebar is a **Run and Debug** tab. | ||
On this tab select **create a launch.json** file. | ||
This will prompt about what kind of program to launch. | ||
Pick ``Python``, then ``Module``, then when asked for the module name type ``main``. | ||
From now on the ``F5`` key will launch ``main.py`` in debug mode. | ||
|
||
Run the script now and ``"Hello World!"`` should be visible in the terminal output. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters