Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

David_Novo Group Title

I run this code http://dpaste.com/795269/ and it generates a graphic. After that I run the code again and it generates the following error: "The python shell window is already executing a command; please wait until it is finished." How can I run the code again without the error?

  • 2 years ago
  • 2 years ago

  • This Question is Open
  1. lopus Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    when you downloaded pylab you should saved your files inside this folder and you can execute

    • 2 years ago
  2. David_Novo Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Can you be a little more specific please?

    • 2 years ago
  3. lopus Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    inside the folder you downloaded you should keep your archivos.py and you will not have problems

    • 2 years ago
  4. David_Novo Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    I copied my MIT 6.00 folder into c:\python25 folder and it still generates the same error.

    • 2 years ago
  5. bwCA Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    pylab is an extension of matplotlib - i know in matplot lib that it doesn't like it at all if you do not close the plot b4 moving on to executing more code - there are some caveats in the matplotlib documentation about useing the plot.close() method after opening a plot - can't remember the specifics but after a while i started putting a plot.close() statement right after the open() statement ..

    • 2 years ago
  6. David_Novo Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    There is no open() statement in the code. If I put pylab.close() after pylab.show() it doesn't fix it.

    • 2 years ago
  7. bwCA Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    are you 'closing' the figures?

    • 2 years ago
  8. bwCA Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.show are you running it from a module or at a shell/idle prompt?

    • 2 years ago
  9. bwCA Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    http://matplotlib.sourceforge.net/faq/howto_faq.html#use-show

    • 2 years ago
  10. David_Novo Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    I'm using the code in the first post in idle. It's from lecture 13. The first time I run it, everything is ok. Then I close the figure and run it again and it generates the error. If i close python and open it again it runs well.

    • 2 years ago
  11. bwCA Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    this http://dpaste.com/795394/ worked for me - i got a figure for each show() with no complaining

    • 2 years ago
  12. David_Novo Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    That is 2 figures in the same script. Try to run the code that I posted twice. Just close the graphic after the first run and see what happens.

    • 2 years ago
  13. bwCA Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    so if put those statements in a file/script/module and ran them (F5) and it produced a figure with two lines. I closed the figure and at the shell prompt ran pylab.show() and got the figure again ... when you say 'run it twice' what does that mean exactly? F5 afain for the script/module window? do you get a traceback? if so can you post it

    • 2 years ago
  14. David_Novo Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    1) I put this code in a script 2) I run it (F5) 3) I close the graphic that it generated 4) I run it again (F5) I get no graphic and this error: "The python shell window is already executing a command; please wait until it is finished."

    • 2 years ago
  15. bwCA Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    i 'ran' it several times like you described without fault. when you close the figures, do you get a prompt in the IDLE shell? can you run anything in the shell?

    • 2 years ago
  16. David_Novo Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    No.

    • 2 years ago
    • Attachments:

See more questions >>>

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.