How to extract information from text file in Python?

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

Was this solution helpful to you?

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

Just Added Q & A:

Find solution

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.