views:

1442

answers:

2

Hello Everyone ! Well ... I am writing an IRC bot in python. I wish to make stand-alone binaries for Linux and windows of it. And mainly i wish that when the bot initiates .. the console window should hide and the user should not be able to see the window. What can I do for that ? The python way will be better.

+2  A: 

In linux, just run it, no problem. In Windows, you want to use the pythonw executable.

Update

Okay, if I understand the question in the comments, you're asking how to make the command window in which you've started the bot from the command line go away afterwards?

  • UNIX (Linux)

$ nohup mypythonprog &

  • Windows

C:/> start pythonw mypythonprog

I think that's right. In any case, now you can close the terminal.

Charlie Martin
Thats not the main issue ... The main issue is to hide the console window then the program is running.How do it do that ?
You mean the one you're starting it from?
Charlie Martin
Change file extension to .pyw to associate with pythonw.exe http://oreilly.com/catalog/pythonwin32/chapter/ch20.html
Adam Bernier
okay, if puython isn't installed, you've got another problem. You want py2exe to build a standalone executable. http://logix4u.net/Python/Tutorials/How_to_create_Windows_executable_exe_from_Python_script.html and http://www.py2exe.org/index.cgi/FrontPage
Charlie Martin
+4  A: 

Simply save it with a .pyw extension. This will prevent the console window from opening.

Explanation at the bottom of section 2.2.2

mdec