Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

bugento

  • one year ago

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

  • This Question is Open
  1. rsmith6559
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  2. harsimran_hs4
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    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 filename.py 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.

  3. dallasalien
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I'm running windows 7, when I right click a .py file theres an option to edit in IDLE

  4. harsimran_hs4
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    @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

  5. olasunmibo
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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

  6. dallasalien
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    That's what I'm saying, right clicking and selecting edit in IDLE allows editing instead of executing the script.

  7. bugento
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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/abc.py) 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

  8. harsimran_hs4
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    cool (y)

  9. JonnyTruelove
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    why did you not download python 2.7.2??

  10. bugento
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  11. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Ask a Question
Find more explanations on OpenStudy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.