Open study

is now brainly

With Brainly you can:

  • Get homework help from millions of students and moderators
  • Learn how to solve problems with step-by-step explanations
  • Share your knowledge and earn points by helping other students
  • Learn anywhere, anytime with the Brainly app!

A community for students.

Hi, I just started this course, and downloaded Python 2.5.4....When I download a zip file to my computer(eg unit 1 recursion,problem set 2), the txt files will open, but not the .py files...whenever i attempt to open them the Python command window quickly flashes on then off. Can anyone help? Thanks

MIT 6.00 Intro Computer Science (OCW)
I got my questions answered at in under 10 minutes. Go to now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly


Get your free account and access expert answers to this and thousands of other questions

It sounds like the .py file extension is associated with the Python interpreter, so when you double-click on the files, the window opens, the file executes, and if the file doesn't do something to keep the window open, the window closes. Try opening the .py files from your editor, or launch the editor and drag the file into the editor's window.
i assume you are using windows (as i get it from your problem)... what rsmith6559 pointed out is correct so you have 2 options 1. run the command promt and then navigate to the directory where you have the files and the execute the .py files as >>> python this will let you see the result of the program you wrote (this problem is due to the fact that in windows your actually need special adjustments to hold the screen otherwise it executes the program and exits) 2. use IDLE to write and run your code.
I'm running windows 7, when I right click a .py file theres an option to edit in IDLE

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

@dallasalien just click edit in idle and when you have to run press ctrl + F5 or find this option in bar above..... if you still have some doubts please do ask
You said the file you downloaded is a zip file, in this case you need to extract the file inside zip file (i.e you need to unzip it) then you can now access the file extract successfully
That's what I'm saying, right clicking and selecting edit in IDLE allows editing instead of executing the script.
Thanks everyone for your help. I have solved my problem. I also could not open my file from idle. (The zip was unfolded but idle would not open because of its location ....downloads/ i made the path shorter, and than was able to open from the python GUI. Also there was no Path of python to my command prompt.(typing Python into the command prompt did not work) i found a solution on-line. (folder location of Phython: C:Python25)....control panel/system/advanced tab/evironmental variables/new.....In the var name window I typed PATH, in the variable value I typed %Path%;C:Python 25 To rsmith: I was able to drag the file onto my command prompt only after i did this procedure To harsimran: could not navigate to a python file til I did the above Thanks everyone, I appreciate your help PS my system is XP
cool (y)
why did you not download python 2.7.2??
I didn't read the instructions well. The course software (mit cs 6.00), is not compatible with Python 3.0 and higher. It said i could use 2.5.4 (and the rest of the "2" versions). I"ve updated to 2.7.2 (right now side tracked on a codecademy beginners lesson on Python.

Not the answer you are looking for?

Search for more explanations.

Ask your own question