How to execute/run a *.py file, win7, py3.2..?

alex23 wuwei23 at gmail.com
Mon Apr 16 01:33:17 EDT 2012


On Apr 16, 2:30 pm, vmars316 <vmars... at gmail.com> wrote:
> windows7, portablePython3.2:

Is there a reason why you're using Portable Python over the standard
install?

> What if i wanted to send myProg.py to a friend to RUN (who has python
> installed).
> Isn't there a way just to doubleClick on myProg.py, to get it into the
> interpret/RUN?

This is what the standard install of Python does by default under
Windows. You're missing the environment setup because you're using
Portable Python. If you absolutely must use it, you might get better
answers from https://groups.google.com/group/portablepython

> Could i RUN a myProg.o ?

Yes, you can run .pyc & .pyo files:

    Z:\>cat test.py
    print "foo"

    Z:\>python -O -m py_compile test.py

    Z:\>del test.py

    Z:\>python test.pyo
    foo

    Z:\>test.pyo
    foo

> There must be a way to initiate the RUNning of a myProg.py without
> IDLE or pyScript, or the like.

There is: use a non-portable version of Python, or launch it by
explicitly prefixing it with 'python'.

> What if i wanted to write my own program in maybe "C",
> who's job it is to initiate interpret/run any *.py program.

Um, yours, who else is going to do it for you?

> How does IDLE or pyScript do it?

I've never had to look into it because it always just works when using
a system-installed Python.



More information about the Python-list mailing list