You've already executed the Solver script in one of the most straight-forward ways. $Prompt$: for a string input dialog on running the configuration $ModuleSdkPath$: for the project interpreter path
![use pycharm for basic addition use pycharm for basic addition](https://i2.wp.com/itsfoss.com/wp-content/uploads/2015/08/pycharm-ubuntu-software-center.jpg)
$FilePath$: for the file path of the open file Similarly, you can include other helpful macros: Note that the command line now contains "76" as an argument.Ĭopy any numeric value into the clipboard and rerun the configuration to evaluate the macro. In this example, the clipboard contains the value 76 and it is shown in the Macro preview area. Then, click + in the Parameters field and select ClipboadContent from the list of the available macros. In the Run/Debug Configurations dialog, select Solver from the list of the Python run/debug configurations. You can use the Run/Debug Configuration dialog to automatically submit input values from a text file instead of typing them in the Run tool window.Ĭreate the in.txt file with the following values of a, b, and c: If you change anything in one of the existing run/debug configurations, then only this particular run/debug configuration will be affected. As an example, create a new run/debug configuration of the Python type for the same Solver script, and call it 'Solver1'. It is denoted with the icon of the normal opacity - which corresponds to the permanent run/debug configuration (remember, it became permanent because you've saved it - however, any specially created run/debug configuration also becomes permanent). It belongs to the Python type, and is created against the pattern Python. Under the Python node, you see the only run/debug configuration Solver. OK, select the interpreter of your choice in the Python page - then any newly created run/debug configuration of the Python type will use this interpreter. Click the Edit configuration templates link, to preview and modify the patterns.įor example, you want to change the Python interpreter to use a remote or other local interpreter. The default configuration options are derived from the predefined Python template. Here you can see the Solver configuration and its default settings. Choose Edit configurations, and see the Run/Debug Configurations dialog opens: Save run/debug configurationĬhoose this command to save the temporary run/debug configuration 'Solver' - now this configuration becomes permanent. If you click one of the run/debug configurations in this list, it will become current. Should you have more run/debug configurations, the list of existing ones will become broader. OK, now click the down arrow to reveal the available commands and, below the separator line, the list of existing run/debug configurations: What does it mean? It means that the Solver run/debug configuration is temporary- P圜harm has created it automatically. You also see that its icon is shown semi-transparent. To its right you see the buttons, ,, , the run/debug configuration in the combobox is Solver.
![use pycharm for basic addition use pycharm for basic addition](https://miro.medium.com/max/1400/0*iMubCgD9KQbqcHsU.png)
![use pycharm for basic addition use pycharm for basic addition](https://www.jetbrains.com/pycharm/features/screenshots/survey-sciview.png)
Look at the main toolbar on the second image: the current run/debug configuration is visible in the combobox. Now, as this run/debug configuration is marked with the green circle, it is current. It means that the Solver run/debug configuration has been created automatically by P圜harm, when you've chosen Run 'Solver' from the context menu. If you look at the very first image, you will notice that in the combobox there is no run/debug configuration at all on the second image it appears, marked with the green circle. P圜harm comes with a number of such pre-defined profiles, or run/debug configurations, that serve patterns, against which you can create any number of run/debug configurations of your own.Įvery time you click the Run or Debug buttons (or choose Run or Debug commands from the context menu), you actually launch the current run/debug configuration in the run or debug mode. Run/debug configuration - what is it?Įach script or test you wish to run or debug from within P圜harm, needs a special profile that specifies the script name, working directory, and other important data required for running or debugging. Let's explore in detail what we've done and what we see. Enter values for a, b, and c to review the output in the Run tool window: Then choose Run 'Solver' from the context menu: Open the class Solver.py for editing F4, and right-click the editor background. Note that for the current project your Python interpreter version should be 3.0 or later. You have Python interpreter already configured.