473,320 Members | 1,978 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,320 software developers and data experts.

sys.arg whitespace problem

Hi,

Basically I want to get sys.argv[1: ] but the problem is that actually
the argument should maintain whitespace. Thus if the arguments are
something something with only one space between them, or something
something with three spaces between them I should be able to maintain
the exact whitespace between arguments.

Cheers,
Bryan Rasmussen
Nov 18 '07 #1
1 5635
bryan rasmussen schrieb:
Hi,

Basically I want to get sys.argv[1: ] but the problem is that actually
the argument should maintain whitespace. Thus if the arguments are
something something with only one space between them, or something
something with three spaces between them I should be able to maintain
the exact whitespace between arguments.

That has nothing to do with python - it's a question of your shell.
Because the shell is responsible for parsing the arguments, possibly
instantiating variables or even executing subcalls. The resulting
argument list is then passed to the C-main of python.

So to pass arguments containing whitespace to python, do

python myscript.py "an argument with whitespac in it" "another one"

Diez
Nov 18 '07 #2

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

Similar topics

16
by: qwweeeit | last post by:
In analysing a very big application (pysol) made of almost 100 sources, I had the need to remove comments. Removing the comments which take all the line is straightforward... Instead for the...
0
by: Curtiss Howard | last post by:
I'm using Xerces 2.4.0 and I've got a schema (converted from a DTD) for my XML documents. However, Xerces will NOT ignore the whitespace between elements. These are the options I've set for the...
2
by: Andy Fish | last post by:
Hi, I was wondering if there is any way to control the whitespace (specifically line breaks) that are generated using Xalan XSLT processor with output method=html. I find it sometimes...
4
by: dld_id | last post by:
Hi; I've got an intermittent whitespace problem between IE6 and this page: http://www.cooperforidaho.com Under firefox & moz, everything's fine. Under IE6, certain window sizes cause the...
11
by: Brian W | last post by:
Yet another editor problem To reproduce do the following 1) Open a Webform and switch to HTML edit mode 2) Enter the Following (include spaces) This is some text before <asp:hyperlink...
56
by: infidel | last post by:
Where are they-who-hate-us-for-our-whitespace? Are "they" really that stupid/petty? Are "they" really out there at all? "They" almost sound like a mythical caste of tasteless heathens that "we"...
3
by: Nick B | last post by:
I'm trying to do a select on a column where the cell values in the column are padded with whitespace, is there a simple way to have the select expression ignore the whitespace? Thanks in...
10
by: Mason Barge | last post by:
I have a standard POST form consisting of two types of input: text input and textarea. The form downloads current settings from a mysql database. The user can update the information by modifying...
8
by: DotNetNewbie | last post by:
Hi, I have text in a file that looks like this: What kind of regex could get the '2' ?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.