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

nickyvs

I wrote a code in python but I'd really like to run it as if it were a program (as in, just seeing the things I want printed and being able to input my own replies to the question I'm having it ask me) instead of just seeing my code or running it against IDLE. Is there a way to do that and if so, how?

  • one year ago
  • one year ago

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

    file--> New Window--->paste your code there-->f5-->enjoy!or debug!xD

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

    If you want to put your own replies, replace the word/words you are already using with a raw_input("Insert something here: ") statement, unless of course, I am misreading what you asked.

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

    What OS is your computer? The procedure is different for *nix and Windows.

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

    I have windows.

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

    That turned out to be harder than I thought! I have a python.bat file that makes it easier on my XP machine. Simple little file: @echo off c:\python26\python.exe "%1" %* This can be in your working directory, or put in, say, c:\windows. Change the path in the script to the path to your installation. With this file, you can write a python program, say, test.py and invoke it: python test.py Try it with both files on, say, your Desktop and see if you want to stay with it. FWIW, I didn't get the method that the Python documentation suggested to work.

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

    So if I send someone the bat file and the py file, would it be possible to make a simple VB script that will run and do everything for the client?

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

    They would need Python installed on their machine. The .bat script could be modified to handle the invocation, no need for (UGH!) vbs. Just change the .bat to: @echo off c:\python26\python.exe "yourProgramName"

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

    I guess that's my biggest gripe with these interpreted languages--people have to install additional software on their machine to use any programs. Most people have java, and maybe flash, but I think that's it.

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

    You're correct that it's sometimes inconvenient to distribute interpreter based programs. On the plus side for languages like Python and Java is that your programs aren't affected much by the OS. I wrote a Python program, with GUI, on my Linux box targeted for Mac OSX that also runs on Windows and the only customizations that were needed was a key-binding for OSX, and the font needed to be bigger for Windows.

    • one year 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.