0

I am a beginner at Python and I am trying to run the Python interpreter from the command line in Windows Powershell ISE.

But here is what I got when I type in python or py:

Instead of

>>> 

I got the following (with a line break inbetween):

>
>>

Then the commend line prompt is locked and not responding.

Any help is appreciated!

colidyre
  • 4,170
  • 12
  • 37
  • 53
  • 1
    You seem to be new! Welcome. It would help if you could post your code so we can better help you out. One tip: If you press Ctrl and C the program you are running will stop executing. – Matt Apr 17 '18 at 19:51
  • Please provide more details about your setup. What OS? What terminal are you using? – juanpa.arrivillaga Apr 17 '18 at 19:58
  • Thank you! OS is windows 10, Python is 3.6.5. Terminal is Windows Powershell ISE. I just tried the same at the normal powershell command prompt, it works there. – Karen Knoxville Apr 18 '18 at 20:28

2 Answers2

0

Are you trying to run a python file (.py) from the command line or run a line of python like 'print('Hello World')'?

If you are trying to run the actual .py file then you will need make sure you are in the same directory of the file then run "python someFile.py" from the command prompt.

If you are trying to just run a function like print('Hello World') then when you are in command prompt and enter "python" you will see the '>>>' as just place holders so you wont be able to erase those. You should now be able to run print('Hello World') and see a result.

jadki
  • 482
  • 1
  • 8
  • 15
  • Thank you jadki, I am just running the print () to test if my set up is correct. I can run it now, under the normal powershell, but this does not work if I use windows PowerShell ISE. I am running windows 10. – Karen Knoxville Apr 18 '18 at 20:35
  • I think this post might be of some use. https://stackoverflow.com/questions/36994993/how-to-run-python-interpreter-in-windows-powershell-ise – jadki Apr 19 '18 at 13:08
  • Thank you for the link, I just checked it out. It is very helpful! – Karen Knoxville Apr 20 '18 at 14:33
0

Which version of Python are you using and on what platform are you working? One of the best options to start learning Python is Anaconda. Then run Anaconda Prompt and there you can type python and see ">>"!