473,387 Members | 1,611 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.

Command line arguments question (Windows XP)

ezd
Hi,
I run simple script

# u.py
import sys
print 'args',sys.argv

in "Command Prompt" window, with 2 command lines on 2 PCs:

# Case (1L):
C:\tmp> u.py a b c
args ['C:\\tmp\\u.py']

# Case (1D):
C:\tmp> u.py a b c
args ['C:\\tmp\\u.py', 'a', 'b', 'c']

# Cases (2L) & (2D):
C:\tmp> C:\Python24\python u.py a b c
args ['u.py', 'a', 'b', 'c']

How to explain this ? Particularly case (1L) without arguments.

Both PCs have Python 2.4.2 and Windows XP SP2. The only
difference I see is XP 'Home Edition' on Desktop (D) and
XP 'Professional' on Laptop (L).

Eugene

Mar 21 '06 #1
0 755

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

Similar topics

2
by: Eric Ching | last post by:
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...
2
by: SC | last post by:
I'm trying to hide command line arguments passed to a C++/Qt application compiled for Windows. Under Linux, I replaced argc in the main with empty spaces and it works, a 'ps -ef' does not show...
7
by: michael | last post by:
I have a question about Windows based python (2.4 and later). For example, if I make a script called test.py like so: import sys print sys.argv then run it: python test.py this is a test
7
by: Steve M | last post by:
I'm trying to invoke a Java command-line program from my Python program on Windows XP. I cannot get the paths in one of the arguments to work right. The instructions for the program describe the...
1
by: amirmira | last post by:
I would like to set command line arguments to a service at install time. I need to do this because I need to get information from different registry locations depending on my command line argument....
1
by: Rune Jacobsen | last post by:
Hi, I've been trying to figure this one out, but my experience just doesn't have what it takes... :| I am writing an application that reads an XML file and displays the contents in various...
40
by: raphfrk | last post by:
I have a program which reads in 3 filenames from the command line prog filename1 filename2 filename3 However, it doesn't work when one of the filenames has spaces in it (due to a directory...
6
by: 31337one | last post by:
Hello all, I was wondering if there is a C/C++ command line parser that works for linux AND windows. . Anyways, the ideal parser im looking for should be able to support multiple arguments...
4
by: Milan | last post by:
How do you pass in arguments from the command line to a .Net windows app. Senario: vb.net application should be able to execute from command prompt by passing login and password and should be...
7
by: Jwe | last post by:
Hi, I've written a program which has both a command line interface and Windows form interface, however it isn't quite working correctly. When run from command line with no arguments it should...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.