Can't see the arguements when use Python in WSH.
Hi, Folks: I am using Python in WSH. However, I got a strange problem on my computer. Here is a small program to show the problem. # xxx.pys objArgs = WScript.Arguments for i in xrange(objArgs.Count()): WScript.Echo(objArgs(i)) WScript.Echo('Total %d arguments.' % objArgs.Count()) If I execute this document by following command, the objArgs.Count() always return 0 and no argument was included. > xxx.pys 1 2 3 4 Because, the script will show "Totals 0 arguments", the program can be executed normally. It just can't get the arguments. However, if I use following command to execute the script. I can get the arguments. > wscript.exe xxx.py 1 2 3 4 If I drag some documents and drop them onto the icon of xxx.pys file, it still can't get the arguments. I am sure that the DropHandler has been set properly. Finally, I use a wsf file to embeded the same script file. It looks like this: blah blah This wsf file can work very well. When I drop some files onto it, it can show the path of those documents. However, I just want to know why my pys file can't work. Does anyone have the same situation? Is it my pywin32 package corrupted? I've downloaded the last pywin32 package and executed the site-packages\win32comext\axscript\client\pyscript.py to register the PyScript. But, the problem is still there. Sincerely yours, Gary -- http://mail.python.org/mailman/listinfo/python-list
Re: Can't see the arguements when use Python in WSH.
On 9 16 , 9 09 , Duncan Booth <[EMAIL PROTECTED]> wrote: > GaryLee <[EMAIL PROTECTED]> wrote: > > Does anyone have the same situation? Is it my pywin32 package > > corrupted? I've downloaded the last pywin32 package and executed the > > site-packages\win32comext\axscript\client\pyscript.py to register the > > PyScript. But, the problem is still there. > > I've no idea why pyscript.py doesn't set up the registry correctly, but it > should all work if you run the command: > >ftype pysFile=%SystemRoot%\System32\WScript.exe "%1" %* > > (If you wish you can try "ftype pysFile" first to see the current setting. > On my system the file association wasn't set at all but it sounds like on > yours it may be set but missing the %*) I am sure that my setting in registry is correct. After run ftype pysFile, I got the following response. > ftype pysFile pysFile=%SystemRoot%\System32\WScript.exe "%1" %* I've also checked the DropHandler setting in registry. The value is correct. I just don't want to re-install my python 2.4, because I've installed too many package. -- http://mail.python.org/mailman/listinfo/python-list
Re: Adding extra modules to a Pyinstaller build
> I need to add several Python standard modules to a Pyinstaller > project. The modules are not (and cannot be) explicitly imported in my > project script, so is there a way to add them to my .spec file in > order to allow Pyinstaller to search for them in PYTHONPATH and add > them to the project? Have you read the "Listing Hidden Imports" section in the PyInstaller document? Check this out. http://pyinstaller.hpcf.upr.edu/docs/Manual_v1.1.html#listing-hidden-imports Regards, Gary -- http://mail.python.org/mailman/listinfo/python-list
Re: py2exe (or other exe builder) on Vista system for Vista/XP install targets.
On 10 31 , 8 08 , Michael <[EMAIL PROTECTED]> wrote: > I'm trying to build a exe on a vista system using py2exe. It will > deploy to vista and XP systems. If it matters, the application uses > pyserial, as well. I have VS Studio 2005 installed on this laptop as > well. I've found this so far that seems to be identical to what I'm > seeing (for non-python > programs):http://www.thescripts.com/forum/thread611031.html > > When I attempt to run, I get "The procedure entry point > _except_handler4_common could not be located in the dynamic link > library mscvrt.dll." Apparently vista has one more > _except_handler#_common function than XP does. > I use pyinstaller to create the single execution file. However, if you have some DLLs which built from VC2005. You may need to include the VC2005 redistribution files in your execution file. Here are the files which I get from VC2005's redistributed package and include in my execution file. Microsoft.VC80.CRT.manifest msvcm80.dll msvcp80.dll msvcr80.dll -- http://mail.python.org/mailman/listinfo/python-list