Python Forum
Pycharm shortcuts and operators don't run
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pycharm shortcuts and operators don't run
#1
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.
Reply
#2
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.
Reply
#3
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
>>>
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#4
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.
Reply
#5
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
Reply
#6
With Pycharm, for running the file displayed on the screen, you must type ctrl  + shift  + F10.  Sylas
Reply
#7
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Use of if - and operators Pedro_Castillo 1 459 Oct-24-2023, 08:33 AM
Last Post: deanhystad
  Need help with infinite loop & making hotkeys/shortcuts Graxum 1 1,124 Aug-22-2022, 02:57 AM
Last Post: deanhystad
  Mixing Boolean and comparison operators Mark17 3 1,371 Jul-11-2022, 02:20 AM
Last Post: perfringo
  Creating Shortcuts with python Oshadha 2 1,766 Jun-23-2022, 08:07 AM
Last Post: Oshadha
  Magic Method Arithmetic Operators ClownPrinceOfCrime 3 2,280 Jan-10-2021, 03:24 PM
Last Post: ndc85430
  Class and Operators in Python rsherry8 1 1,957 May-27-2020, 07:09 PM
Last Post: buran
  Trying Comparison Operators PythonGainz 3 2,671 Mar-28-2020, 10:46 AM
Last Post: PythonGainz
  Mathematical Operators in String AgileAVS 1 2,343 Mar-04-2020, 04:14 PM
Last Post: Gribouillis
  A doubt with 'in' and 'not in' operators with strings newbieAuggie2019 7 3,518 Oct-23-2019, 03:11 PM
Last Post: perfringo
  understanding exponential and bitwise operators srm 1 2,000 Jun-15-2019, 11:14 AM
Last Post: ThomasL

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020