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?
MIT 6.00 Intro Computer Science (OCW)
Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
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.
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
file--> New Window--->paste your code there-->f5-->enjoy!or debug!xD
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.
What OS is your computer? The procedure is different for *nix and Windows.
Not the answer you are looking for? Search for more explanations.
I have windows.
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:
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:
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.
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?
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:
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.
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.