Movatterモバイル変換


[0]ホーム

URL:


Newbie python query

David C. Ullrichullrich at math.okstate.edu
Mon Apr 9 12:02:35 EDT 2001


On Mon, 9 Apr 2001 12:58:45 +1200, "Ben Hawkes"<ben.hawkes at paradise.net.nz> wrote:>Hi,>>I've just started using python on my win95 box, and i'm a bit stuck. I'm>totally unsure on how to load a .py file into the interpreter and execute or>compile it into an executable, HELP!You can load it into the interpreter by adding a switch -ito the command line. Where that command line goes dependson how you're starting the thing; could be in the commandline for a shortcut, or you could do it through file associationsin the registry:Start regedit and save [HKEY_CLASSES_ROOT\.py] toa .reg file in case you decide to go back to the way thingswere. Now take the following reg file:REGEDIT4[HKEY_CLASSES_ROOT\.py]@="DUPythonFile"[HKEY_CLASSES_ROOT\DUPythonFile]@="DUPythonFile"[HKEY_CLASSES_ROOT\DUPythonFile\DefaultIcon]@="D:\\Python\\Py.ico"[HKEY_CLASSES_ROOT\DUPythonFile\shell]@="Edit"[HKEY_CLASSES_ROOT\DUPythonFile\shell\Edit][HKEY_CLASSES_ROOT\DUPythonFile\shell\Edit\command]@="c:\\ultraedit\\uedit32.exe %1"[HKEY_CLASSES_ROOT\DUPythonFile\shell\Run(DOS)][HKEY_CLASSES_ROOT\DUPythonFile\shell\Run(DOS)\command]@="c:\\python\\py.bat %1"[HKEY_CLASSES_ROOT\DUPythonFile\shell\Initialize Interpreter][HKEY_CLASSES_ROOT\DUPythonFile\shell\Initialize Interpreter\command]@="c:\\python\\python.exe -i %1"change the paths to point to the Python installation, to the editoryou want to use, etc, then merge it into the registry. Now your.py files should have three actions associated with them,namely Edit, Run(DOS) and Initialize Interpreter. The lastone executes all the statements in the file and then givesyou an interactive prompt.>Ben Hawkes>>


More information about the Python-listmailing list

[8]ページ先頭

©2009-2025 Movatter.jp