Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

David_Novo

  • 2 years ago

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?

  • This Question is Open
  1. lopus
    • 2 years ago
    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. David_Novo
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Can you be a little more specific please?

  3. lopus
    • 2 years ago
    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

  4. David_Novo
    • 2 years ago
    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.

  5. bwCA
    • 2 years ago
    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 ..

  6. David_Novo
    • 2 years ago
    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.

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

    are you 'closing' the figures?

  8. bwCA
    • 2 years ago
    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?

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

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

  10. David_Novo
    • 2 years ago
    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.

  11. bwCA
    • 2 years ago
    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

  12. David_Novo
    • 2 years ago
    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.

  13. bwCA
    • 2 years ago
    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

  14. David_Novo
    • 2 years ago
    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."

  15. bwCA
    • 2 years ago
    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?

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

    No.

  17. 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.