How do I run my Python code?
-
HI, am a beginner and I wrote a code in Sublime Text 3, but every time I try running it I get an error: 'python' is not recognized as an internal or external command, operable program or batch file. [Finished in 0.1s with exit code 1] [shell_cmd: python -u "C:\Documents and Settings\Administrator\Desktop\http://test.py"] [dir: C:\Documents and Settings\Administrator\Desktop] [path: C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\minGW\bin ;C:\Program Files\QuickTime\QTSystem\;C:\WINDOWS\system32\WindowsPowerShell\v1.0] When I type "python" in administrator:windows powershell I get this error: 'python' is not recognized as an internal or external command, operable program or batch file. [Finished in 0.1s with exit code 1] [shell_cmd: python -u "C:\Documents and Settings\Administrator\Desktop\http://test.py"] [dir: C:\Documents and Settings\Administrator\Desktop] [path: C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\minGW\bin ;C:\Program Files\QuickTime\QTSystem\;C:\WINDOWS\system32\WindowsPowerShell\v1.0] My Code: 1.input("what is your name?") 2.print(name) 3.Help= input("How may i help you today?") 4.print(Help) 5.Address= input ("what is your Address") 6.print(Address) 7.provide=(" What information would you like me to provide you with?") 8.print(provide) 9.Information= input("what is your information?") 10.print(Information) 11.print(" I LOVE PROGRAMMING") I have it save to my desktop under "http://test.py" am ruining this on a windows xp btw
-
Answer:
A google search would have solved your problem. http://docs.python.org/2/faq/windows You may have installed python but the executable python.exe is not in the PATH environment variable. To view or change environment variables: Right-click My Computer, and then click Properties. Click the Advanced tab. Click Environment variables. Click on PATH variable, there will be a long list of directories. Determine where python was installed in your computer and copy that path. (It would probably be c:\Python27\python ). Add that path to the end of the the long list in the variable PATH. Two different directory paths are separated by a semicolon.
Swapnil Bhave at Quora Visit the source
Other answers
Get an empty USB stick Go here: http://www.ubuntu.com/download/desktop and follow the instructions to install ubuntu Install ubuntu parallel to your Windows OS Learn basic terminal commands. cd, mkdir, ls Put your python program in a folder for your python stuff Navigate there via terminal Type "python http://test.py" without the quotes in your terminal Sit back and rejoice Seriously, learn Linux. Your life will be better. I think it's funny you wrote "ruining this on xp" xD
Anonymous
Related Q & A:
- How do I make a python web program that is on a ubuntu server allow access to the server?Best solution by Yahoo! Answers
- How can I run all my selenium tests sequentially in C#?Best solution by Stack Overflow
- How do I compile my Python program to a .jar with Jython?Best solution by Stack Overflow
- How do I run Multiple Parallel Suites in TestNG?Best solution by Stack Overflow
- How can I run CMD command?Best solution by Super User
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.