October 18th, 2003, 12:02 PM
1.What does "-w" do?Can it remove the command window?
2.you mean change all .py files to .pyw?and run the command like "python setup.pyw py2exe -w?
October 18th, 2003, 06:01 PM
Well, pyw files run without the console window, so if you have a Python GUI (or any other Python program) with .pyw extension it will run without the "command window".. you just write a normal setup.py file and point it at your pyw
The -w flag will do exactly the same thing as the method above and works exactly the same way as normal, all you need to do is add -w to the end of your command
October 19th, 2003, 12:48 AM
Thanks a lot.
I tried add a -w after my command.It worked,and removed the DOS windows.
October 30th, 2003, 01:59 PM
I have a question :
When you add the '-w' flag, it means you want to run your script with pythonw.exe. I tried this for a simple script and nothing happens when I launch my program (and it works when I build a console app). Do I need to add something in my script to run this way ?
October 30th, 2003, 03:33 PM
Running a console app with pythonw.exe wont show and console window because thats exactly what its designed to do, your program still runs as normal though! Which is great when you want to make programs which run in the background (out of sight)..
November 1st, 2003, 04:16 AM
Hummm... Sounds interesting. In fact it gave me an idea, but I have a problem :
When I added the pickle module to my script, I got a warning message while compiling saying that some modules could not be found (readline, carbon...). Now my script works fine before I convert it to exe but it doesn't work anymore after I've done so... What can I do ?
November 1st, 2003, 11:43 AM
mnot sure exactly what your doing but i see no reason why it doesn't work.. you could try using one of the 'Flags to include or exclude modules or packages' on Py2exe's homepage i.e.
looks promising, give that a go, if it doesnt work then let me know and i'll run a few tests myself!
November 5th, 2003, 03:32 PM
ALRIGHT ! I did that and it worked... but I wasn't expecting it to work . Thanks !
November 5th, 2003, 04:45 PM
Oh, I forgot... When I convert some script to exe, (leaving the console...), I get warning messages that I don't see when running my script on Python GUI (such as "Warning : integer exponentiation", and some others...) Can I remove those and if yes how ?
Thanks in advance.
November 5th, 2003, 06:06 PM
Mmmmmm, i've never head of this before and i can't find any docs on the p2exe website about this.. since warnings are not errors you cant really use the try statment on it (or i don't think so). I'll look into turning warnings off for you though and let you know what i find!
November 5th, 2003, 06:57 PM
Ok, there are two ways too do this from what i can see.. the first is by using the command line option -W arg which i havn't quite figured out yet! and the second (and my prefered) way if to use the warnings module i.e. import warnings; warnings.filterwarnings('ignore')
Hope this helps,
November 5th, 2003, 07:06 PM
Ok, i got the -W thing down - got a little comfused there for a second or two - if your calling a Python program from the command line and you want to turn warnings off you can do something like this:
python -W ignore path/to/python/program
the ignore option can be changed to yeild different results depending. I know this wont help much with Py2exe but just incase anyone was interested.
November 6th, 2003, 03:44 AM
Great ! I tried the warnings module thing and it worked perfectly.
Many thanks !
January 3rd, 2010, 03:12 PM
Py2.exe to PY
I have a different problem. I converted all my code from py to exe and then my system failed and then I found out that the system I had been using for my backups also failed. The only thing I have available to me is the exe file. So my problem now is how to convert the exe file back to py in the hopes of getting my source code back. Anyone have any ideas?
June 18th, 2012, 01:12 AM
I need help for my file , to be executable..Can anyone help me ?
<edited by Scorpions4ever>That file is a key-generator for certain Huawei routers. </edited>
Last edited by Scorpions4ever; June 18th, 2012 at 01:35 AM.