473,387 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help running pythonw from a command prompt with arguments

Can I run pythonw with a script that takes command line arguments then
launches a GUI? I try pythonw myscript.pyw -option arg (etc.) and
nothing happens. Nothing, as in I am immediately returned to the DOS
prompt.

I just started learning Python a couple of weeks ago, so please bear
with me. I have a script that(for now) uses command line arguments
then launches a window (Tk). Once I have entered the arguments and
the window is launched I do not want the window to be dependent on the
DOS window. I understand that pythonw gets around this, however I am
not having much luck. Thanks in advance for your help, Eric
Jul 18 '05 #1
2 6627
On 3 Mar 2004 07:18:50 -0800, bi*********@hotmail.com (Eric Ching)
declaimed the following in comp.lang.python:
Can I run pythonw with a script that takes command line arguments then
launches a GUI? I try pythonw myscript.pyw -option arg (etc.) and
nothing happens. Nothing, as in I am immediately returned to the DOS
prompt.
I don't think starting from a command line is any different
between "pythonw" and "python", they only show a difference when started
via "Windows" methods (double-clicking on an icon), where "python" will
CREATE stdio window vs "pythonw" suppressing that window.

Launching a GUI can be done from command line using the regular
"python" command, since the command line window is pre-existing.
the window is launched I do not want the window to be dependent on the
DOS window. I understand that pythonw gets around this, however I am
No.. pythonw only suppresses the creation of a console-type
window for applications that don't use stdio when when started from
Windows. Since you already have a console window the use of "pythonw" is
meaningless. If you mean you want the program to run "detached" from the
console then you probably need to use the Windows means of starting such
tasks:

start pythonw <script> <options>

"start" runs the rest of the command disconnected from the console; in
this situation "python" would realize it had no console and open a
window, "pythonw" would suppress the window expecting the program to
manage I/O via a GUI.
If you are getting nothing, the first thing I'd try is using
"python" rather than "pythonw" and see if some error trace shows up. As
"pythonw" is meant to suppress the creation of a stdio console, it
probably also doesn't take advantage of the one you have active, so all
stdio (including stderr) is suppressed.
-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <

Jul 18 '05 #2
I post too soon. Looks like my problem is not so much with using
command line arguments as it is simply with pythonw. When I try using
pythonw with a script that works with the standard python
interpreter(after changing the extension to pyw), still I get the same
results(returns immediately to the command prompt) When I double
click on this script's icon nothing happens as well.
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Elmar Krieger | last post by:
Hi! The _spawnvp function expects the command line arguments as a NULL terminated list of char * pointers, hence there is no need to enclose filenames with quotes if they contain spaces....
9
by: Tom | last post by:
A question for gui application programmers. . . I 've got some GUI programs, written in Python/wxPython, and I've got a help button and a help menu item. Also, I've got a compiled file made with...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
0
by: JIK | last post by:
Hi. I want to schedule an asp.net app running on a win2k server/iis. The asp.net app is installed and works fine in the browser. It also works fine from ab vb script when I run it from the...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
3
by: Steven | last post by:
I am using VC++ 6.0 to build a windows based application, however, my application allows user to input command arguments in the dos prompt windows. I want to have a warning message for user if they...
9
by: Endless Story | last post by:
My last version of Python was 2.4, running smoothly on XP with path c: \Python24 - no need even to include this path in PATH; everything worked as it's supposed to at the command line. Just...
5
by: Ron Garret | last post by:
I'm trying to run the Python examples distributed with XCode and they all give me the same error: Traceback (most recent call last): File "checktext.py", line 35, in <module> main() File...
51
by: Ojas | last post by:
Hi!, I just out of curiosity want to know how top detect the client side application under which the script is getting run. I mean to ask the how to know whether the script is running under...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.