Python Forum
Pycharm shortcuts and operators don't run - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Pycharm shortcuts and operators don't run (/thread-5661.html)



Pycharm shortcuts and operators don't run - AzD - Oct-15-2017

Hi everyone,

Complete rookie here so please excuse the very simple questions.

1. The operator such as 5+5 or 10/2 gives no ouput. I get error message such as "statement seems to have no effect". Print functions run fine.



2. The shortcuts such as Run Shift+F10 do not work. (Im using a windows 10 home, 64bit Lenovo, with scandinavian keyboard.)


Thanks in advance.


RE: Pycharm shortcuts and operators don't run - Larz60+ - Oct-15-2017

Quote:The shortcuts such as Run Shift+F10 do not work.
The first time a script is run, it has to be done differently.
Click on the run menu, and select 'Edit Configurations...'
Make sure the proper interpreter is set up.
Then Click on the run menu again, select run, and click on your script.
After you do that the first time, the script will show up in the pull down menu on the top right
and Shift F10 should work as well.


RE: Pycharm shortcuts and operators don't run - sparkz_alot - Oct-15-2017

Pycharm is for writing programs or scripts that you can save, not for immediate execution, so if you enter

5 + 5
you will get nothing. either when you run it or use Shift + f10. You would need to 'write' an actual script in order to run it. For example:

adding = 5 + 5
dividing = 10 / 2

print(adding)
print(dividing)
will produce:

Output:
10 5.0 Process finished with exit code 0
when run.  If you want immediate gratification, you can use the command line (by typing 'python' in the command terminal. Like so:

C:\>python
Python 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> 5 + 5
10
>>> 10 / 2
5.0
>>>



RE: Pycharm shortcuts and operators don't run - AzD - Oct-16-2017

Hi and thanks for your responses.

@sparkz_alot, good to knnow, thanks for sharing.

@Larz60+ Followed your intructions, not working still though.
"Make sure the proper interpreter". How do I know which is the proper one? I downloaded Pycharm Community Edition 2017.2.3 and the interpeter options i get is Python 3.5.1 and 3.6.1. Tried both.


RE: Pycharm shortcuts and operators don't run - Larz60+ - Oct-16-2017

But you can indeed run your code from within PyCharm while developing.
Quote:"Make sure the proper interpreter". How do I know which is the proper one?
click on 'help' menu, type settings and press enter.
look for project interrupter, If you don't see the python version you are using, add it and make sure it's selected


RE: Pycharm shortcuts and operators don't run - sylas - Oct-17-2017

With Pycharm, for running the file displayed on the screen, you must type ctrl  + shift  + F10.  Sylas


RE: Pycharm shortcuts and operators don't run - Larz60+ - Oct-17-2017

Quote:With Pycharm, for running the file displayed on the screen, you must type ctrl  + shift  + F10.  Sylas
Thats one way to go about it, but you can also run from the run menu, or from clicking green arrow next to  the combo box on top right