| ★ wanayoo — archive 1999 http://www.python.org/ftp/python/pythonwin/html/Windows_Faq.html | Nouvelle recherche | Portail wanayoo |
Python
for Windows FAQ This documents some of the more common problems with Python for Windows. Last updated November 14, 1996, by Mark Hammond
If you encounter a Pythonwin related problem not mentioned here, please mail it to the PythonWin special interest group. To subscribe to this list, please send the word "subscribe" to pythonwin-sig-request
If you encounter a Python-related problem not mentioned here or in the general Python FAQ, please don't hesitate to post to the comp.lang.python newsgroup(or to mail to its gateway at python-list@cwi.nl.)
Import Error: No module named ...
Python on Windows doesnt behave like U*ix when I...
COM / ActiveX related questions
General information on Python can be found at the Python homepage. The general Python FAQ can also be found there.
General information on Pythonwin can be found at the Pythonwin homepage. For details on the latest version available, please see the Pythonwin download instructions.
This probably means Python was not installed with the SETUP utility. If you can not reinstall, the easiest solution is to set a PYTHONPATH variable to point to all Python paths.
This is a problem, but us not high on the list (actually, not on the list at all :-). If this worries you, you'll probably need to fix it.
This section list answers to common questions.
How do I use/create resources? Can I use an external DLL? Can I do it without an external DLL?
You have 2 choices. Create a DLL with resources in it. Then use win32ui.LoadLibrary(dllName). You can then use these resources as if they were "built in". You can ignore any "dll" parameters, as this was for before the current functionality existed - eg "Dialog.dialog()" requires a DLL param (default value = None) You can still pass None, and your resources will be located. Remember to define resource ID's which do not conflict with Pythonwin.
Dialogs and menus can be created at runtime. Look at "dyndlg.py", and do a grep for menu, as there are a few dynamic menus in the system. There is a tool hiding away somewhere that can take a .RES file, and create a Python file that re-creates the dialog.
On the Microsoft IIS server you set up python in the same way that you would set up any other scripting engine.
Run regedt32 and go to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\ScriptMap
and enter the following line (making any specific changes that your system may need)
.py :REG_SZ: c:\<path to python>\python.exe %s %s
This line will allow you to call your script with a simple reference
like:
http://yourserver/scripts/yourscript.py
Please follow the instructions at Netscapes documentation on this topic.
readme.htm,
which contains a fair bit of useful documentation.
win32com\test
directory, which contains samples of many common questions.
This is a "bug" in our code - it currently depends on
the Microsoft Active Template Library. You will need to download
this from www.microsoft.com
before you can complete the build.