Skip to content

Commit a4c1b7e

Browse files
committed
Add screenshots for runinng code in VS Code
1 parent 4917564 commit a4c1b7e

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

episodes/13-ides.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -695,20 +695,13 @@ This functionality in VS Code is available from the Source Control view (from th
695695

696696
### Running Code from IDE
697697

698-
We have configured our environment and explored some of the most commonly used IDE features
699-
and are now ready to run our Python script from the IDE.
698+
We have configured our environment and explored some of the most commonly used IDE features and are now ready to run our Python script from the IDE.
700699

701-
Running code using the graphical interface of an IDE provides a simple, user-friendly way to execute
702-
programs with just a click, reducing the need type commands manually in the command line terminal.
703-
On the other hand, running code from a terminal window in an IDE offers the flexibility and control
704-
of the command line — both approaches complement each other by supporting different user preferences
705-
and tasks within the same unified environment.
700+
Running code using the graphical interface of an IDE provides a simple, user-friendly way to execute programs with just a click, reducing the need type commands manually in the command line terminal.
701+
On the other hand, running code from a terminal window in an IDE offers the flexibility and control of the command line — both approaches complement each other by supporting different user preferences and tasks within the same unified environment.
706702

707-
In this lesson, we prioritise using the command line and typing commands whenever possible,
708-
as these skills are easily transferable across different IDEs (with a note that you should feel free to use other equivalent
709-
ways for doing things that suit you more). However, for tasks like debugging -
710-
where the graphical interface offers significant advantages — we will make use of the IDE’s built-in
711-
visual tools.
703+
In this lesson, we prioritise using the command line and typing commands whenever possible, as these skills are easily transferable across different IDEs (with a note that you should feel free to use other equivalent ways for doing things that suit you more).
704+
However, for tasks like debugging - where the graphical interface offers significant advantages — we will make use of the IDE’s built-in visual tools.
712705

713706
::::::::::::::::::::::::::::::::: group-tab
714707

@@ -720,7 +713,18 @@ and select `Run 'inflammation analysis'` (i.e. the Run Configuration we created
720713

721714
![](fig/pycharm-run-script.png){alt='Running a script from PyCharm' .image-with-shadow width="800px" }
722715

723-
The script will run in a terminal window at the bottom of the IDE window and display something like:
716+
717+
### VS Code
718+
719+
To run our script using the VS Code's graphical interface, make sure the `inflammation-analysis.py` file
720+
is selected in the project/file view on the left, then click the ">" (play) button in the top right corner.
721+
722+
![](fig/vscode-run-script.png){alt='Running a script from PyCharm' .image-with-shadow width="800px" }
723+
724+
:::::::::::::::::::::::::::::::::
725+
726+
The new terminal window will open at the bottom of the IDE window (or could be on the side - depending on how panes are split in your IDE),
727+
the script will be run inside it and the result will be displayed as:
724728

725729
```output
726730
/Users/alex/work/python-intermediate-inflammation/venv/bin/python /Users/alex/work/python-intermediate-inflammation/inflammation-analysis.py
@@ -730,26 +734,22 @@ inflammation-analysis.py: error: the following arguments are required: infiles
730734
Process finished with exit code 2
731735
```
732736

733-
This is the same error we got when running the script from the command line.
734-
We will get back to this error shortly -
735-
for now, the good thing is that we managed to set up our project for development
736-
both from the command line and PyCharm and are getting the same outputs.
737-
Before we move on to fixing errors and writing more code,
738-
Let us have a look at the last set of tools for collaborative code development
739-
which we will be using in this course - Git and GitHub.
740-
741-
:::::::::::::::::::::::::::::::::
737+
This is the same error we got when running the script from the command line! Essentially what happened was the IDE opened a command line terminal within its interface
738+
and executed the Python command to run the script for us (`python3 inflammation-analysis.py`) - saving us some typing.
739+
You can carry on to run the Python script in whatever way you find more convenient - some developers prefer to type the commands in a terminal manually as that gives
740+
the feel of having more control over what is happening and what commands are being executed.
742741

742+
We will get back to the above error shortly - for now, the good thing is that we managed to set up our project for development both from the command line and IDE and are getting the same outputs.
743+
Before we move on to fixing errors and writing more code, let us have a look at the last set of tools for collaborative code development which we will be using in this course - Git and GitHub.
743744

744745
## Optional exercises
745746

746-
Checkout [this optional exercise](17-section1-optional-exercises.md)
747-
to try out different IDEs and code editors.
747+
Checkout [this optional exercise](17-section1-optional-exercises.md) to try out different IDEs and code editors.
748748

749749

750750
:::::::::::::::::::::::::::::::::::::::: keypoints
751751

752752
- An IDE is an application that provides a comprehensive set of facilities for software development, including syntax highlighting, code search and completion, version control, testing and debugging.
753-
- PyCharm recognises virtual environments configured from the command line using `venv` and `pip`.
753+
- IDEs like PyCharm and VS Code recognise virtual environments configured from the command line using `venv` and `pip`.
754754

755755
::::::::::::::::::::::::::::::::::::::::::::::::::

episodes/fig/vscode-run-script.png

750 KB
Loading

0 commit comments

Comments
 (0)