On Saturday, April 15, 2017 at 6:45:51 PM UTC+1, Grant Edwards wrote:
> On 2017-04-14, Bernd Nawothnig wrote:
>
> > He should switch to argparse in any case because getopt is no longer
> > supported and does only receive bugfixes.
>
> In my book, "receiving bug fixes" means it's still supported.
ify it to what I need, it only half works. The problem is the
> >> try/except. If you don't specify an input/output, they are blank at the end
> >> but it shouldn't be.
> >>
> >> import getopt
> >> import sys
> >
> > I am guessin
On 2017-04-14, Bernd Nawothnig wrote:
> He should switch to argparse in any case because getopt is no longer
> supported and does only receive bugfixes.
In my book, "receiving bug fixes" means it's still supported.
--
Grant
--
https://mail.python.org/mailman/listinfo/python-list
u don't specify an input/output, they are blank at the end
>> but it shouldn't be.
>>
>> import getopt
>> import sys
>
> I am guessing you are wanting to parse command-line arguments rather than
> particularly wanting to use the getopt module.
>
On Thursday, April 13, 2017 at 12:38:48 PM UTC+10, MRAB wrote:
> On 2017-04-13 02:59, ian.steg...@gmail.com wrote:
> > I have this code which I got from
> > https://www.tutorialspoint.com/python/python_command_line_arguments.htm The
> > example works fine but when I modify it to what I need, it o
On 2017-04-13 02:59, ian.steg...@gmail.com wrote:
I have this code which I got from
https://www.tutorialspoint.com/python/python_command_line_arguments.htm The
example works fine but when I modify it to what I need, it only half works. The
problem is the try/except. If you don't specify an inp
ank at the end
> but it shouldn't be.
>
> import getopt
> import sys
>
Hello Ian,
I am guessing you are wanting to parse command-line arguments rather than
particularly wanting to use the getopt module.
If I am correct you might want to spend your time instead learning the
ar
I have this code which I got from
https://www.tutorialspoint.com/python/python_command_line_arguments.htm The
example works fine but when I modify it to what I need, it only half works. The
problem is the try/except. If you don't specify an input/output, they are blank
at the end but it shouldn
On 16.05.2013 08:08, Jussi Piitulainen wrote:
Henry Leyh writes:
But now I would also like to be able to _write_ such a config file
FILE that can be read in a later run. And FILE should contain only
those arguments that were given on the command line.
Say, I tell argparse to look for argument
Henry Leyh writes:
> But now I would also like to be able to _write_ such a config file
> FILE that can be read in a later run. And FILE should contain only
> those arguments that were given on the command line.
>
> Say, I tell argparse to look for arguments -s|--sopt STRING,
> -i|--iopt INT, -b
On 15.05.2013 17:29, Roy Smith wrote:
In article ,
Henry Leyh wrote:
On 15.05.2013 14:24, Roy Smith wrote:
In article ,
Henry Leyh wrote:
Is there a simple way to determine which
command line arguments were actually given on the commandline, i.e. does
argparse.ArgumentParser() know
In article ,
Henry Leyh wrote:
>On 15.05.2013 14:24, Roy Smith wrote:
>> In article ,
>> Henry Leyh wrote:
>>
>>> Is there a simple way to determine which
>>> command line arguments were actually given on the commandline, i.e. does
>>> argpa
> However, maybe I could ...
... switch to getopt?
Skip
--
http://mail.python.org/mailman/listinfo/python-list
On 15.05.2013 16:08, Skip Montanaro wrote:
Yes, I was trying that and it sort of works with strings if I use something sufficiently improbable
like "__UNSELECTED__" as default. But it gets difficult with boolean or even number
arguments where you just may not have valid "improbable" defaults.
On Wed, 15 May 2013, Henry Leyh wrote:
Yes, I was trying that and it sort of works with strings if I use something
sufficiently improbable like "__UNSELECTED__" as default. But it gets
difficult with boolean or even number arguments where you just may not have
valid "improbable" defaults. You
> Yes, I was trying that and it sort of works with strings if I use something
> sufficiently improbable like "__UNSELECTED__" as default. But it gets
> difficult with boolean or even number arguments where you just may not have
> valid "improbable" defaults. You could now say, so what, it's th
On 15.05.2013 15:00, Oscar Benjamin wrote:
On 15 May 2013 13:52, Henry Leyh wrote:
On 15.05.2013 14:24, Roy Smith wrote:
In article ,
Henry Leyh wrote:
Is there a simple way to determine which
command line arguments were actually given on the commandline, i.e. does
On 15 May 2013 13:52, Henry Leyh wrote:
> On 15.05.2013 14:24, Roy Smith wrote:
>>
>> In article ,
>> Henry Leyh wrote:
>>
>>> Is there a simple way to determine which
>>> command line arguments were actually given on the commandline, i.e. does
&g
On 15.05.2013 14:24, Roy Smith wrote:
In article ,
Henry Leyh wrote:
Is there a simple way to determine which
command line arguments were actually given on the commandline, i.e. does
argparse.ArgumentParser() know which of its namespace members were
actually hit during parse_args().
I
Colin J. Williams writes:
> On 15/05/2013 2:34 AM, Henry Leyh wrote:
> > Hello,
> > I am writing a program that gets its parameters from a combination
> > of config file (using configparser) and command line arguments
> > (using argparse). Now I would also lik
On 05/15/2013 08:24 AM, Roy Smith wrote:
In article ,
Henry Leyh wrote:
Is there a simple way to determine which
command line arguments were actually given on the commandline, i.e. does
argparse.ArgumentParser() know which of its namespace members were
actually hit during parse_args().
I
In article ,
Henry Leyh wrote:
> Is there a simple way to determine which
> command line arguments were actually given on the commandline, i.e. does
> argparse.ArgumentParser() know which of its namespace members were
> actually hit during parse_args().
I think what you'
On 15/05/2013 2:34 AM, Henry Leyh wrote:
Hello,
I am writing a program that gets its parameters from a combination of
config file (using configparser) and command line arguments (using
argparse). Now I would also like the program to be able to _write_ a
configparser config file that contains
Hello,
I am writing a program that gets its parameters from a combination of
config file (using configparser) and command line arguments (using
argparse). Now I would also like the program to be able to _write_ a
configparser config file that contains only the parameters actually
given on
On 10/06/11 20:03:44, Kurt Smith wrote:
On Fri, Jun 10, 2011 at 12:58 PM, Mark Phillips
wrote:
How do I write my script so it picks up argument from the output of commands
that pipe input into my script?
def main():
import sys
print sys.stdin.read()
if __name__ == '__main__':
On 06/10/2011 04:00 PM, Benjamin Kaplan wrote:
On Fri, Jun 10, 2011 at 11:31 AM, Tim Chase
if os.isatty(sys.stdin): #<-- this check
Any reason for that over sys.stdin.isatty()?
my knowledge of os.isatty() existing and my previous lack of
knowledge about sys.stdin.isatty()
:)
-tkc
-
On Fri, Jun 10, 2011 at 11:31 AM, Tim Chase
wrote:
> On 06/10/2011 12:58 PM, Mark Phillips wrote:
>>
>> How do I write my script so it picks up argument from the
>> output of commands that pipe input into my script?
>
> You can check
>
> if os.isatty(sys.stdin): # <-- this check
Any reason for
On Fri, Jun 10, 2011 at 1:33 PM, Dennis wrote:
> On Fri, Jun 10, 2011 at 11:58 AM, Mark Phillips
> fred
>
> ['alice']
> fred
Just realized the if/else will have to be changed slightly if we want
to output both argv and stdin.
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Jun 10, 2011 at 11:58 AM, Mark Phillips
wrote:
\
>
> Kurt,
>
> How does one write a main method to handle both command line args and stdin
> args?
Here is what I came up with:
The one weird thing, the line from above didn't seem to work so I changed it
if os.isatty(sys.stdin):
to this:
On Jun 10, 2011 10:26 AM, "Mark Phillips"
wrote:
>
> I have a script that processes command line arguments
>
> def main(argv=None):
> syslog.syslog("Sparkler stared processing")
> if argv is None:
> argv = sys.argv
> if l
On 6/10/11 12:58 PM, Mark Phillips wrote:
On Fri, Jun 10, 2011 at 10:41 AM, MRAB mailto:pyt...@mrabarnett.plus.com>> wrote:
On 10/06/2011 18:21, Mark Phillips wrote:
I have a script that processes command line arguments
def main(argv=None):
syslog.
On Fri, Jun 10, 2011 at 11:03 AM, Kurt Smith wrote:
> On Fri, Jun 10, 2011 at 12:58 PM, Mark Phillips
> wrote:
> > How do I write my script so it picks up argument from the output of
> commands
> > that pipe input into my script?
>
> def main():
>import sys
>print sys.stdin.read()
>
> if
On 06/10/2011 12:58 PM, Mark Phillips wrote:
How do I write my script so it picks up argument from the
output of commands that pipe input into my script?
You can check
if os.isatty(sys.stdin): # <-- this check
do_stuff_with_the_terminal()
else:
read_options_from_stdin()
-tkc
-
On Fri, Jun 10, 2011 at 11:03 AM, Dennis wrote:
> On Fri, Jun 10, 2011 at 10:58 AM, Mark Phillips
> wrote:
>> On Fri, Jun 10, 2011 at 10:41 AM, MRAB wrote:
>>
>> On 10/06/2011 18:21, Mark Phillips wrote:
>
>>
> How do I write my script so it picks up argument from the output of commands
> that p
On Fri, Jun 10, 2011 at 12:58 PM, Mark Phillips
wrote:
> How do I write my script so it picks up argument from the output of commands
> that pipe input into my script?
def main():
import sys
print sys.stdin.read()
if __name__ == '__main__':
main()
$ echo "fred" | python script.py
fr
On Fri, Jun 10, 2011 at 10:41 AM, MRAB wrote:
> On 10/06/2011 18:21, Mark Phillips wrote:
>
>> I have a script that processes command line arguments
>>
>> def main(argv=None):
>> syslog.syslog("Sparkler stared processing")
>> if argv is None:
On 10/06/2011 18:21, Mark Phillips wrote:
I have a script that processes command line arguments
def main(argv=None):
syslog.syslog("Sparkler stared processing")
if argv is None:
argv = sys.argv
if len(argv) != 2:
syslog.syslog(usage())
else:
I have a script that processes command line arguments
def main(argv=None):
syslog.syslog("Sparkler stared processing")
if argv is None:
argv = sys.argv
if len(argv) != 2:
syslog.syslog(usage())
else:
r = parseMsg(sys.argv[1])
syslo
eel free to post answers on
> that site
> http://stackoverflow.com/questions/6133517/parse-config-file-
> and-command-line-arguments-to-get-a-single-collection-of-optio>.)
>
This seems vaguely similar to a module I wrote and use all the time.
It allows default value specification
On May 25, 9:38 pm, Ben Finney wrote:
> Howdy all,
>
> Python's standard library has modules for configuration file parsing
> (configparser) and command-line argument parsing (optparse, argparse). I
> want to write a program that does both, but also:
>
> * Has a cascade of options: default option
ining StackOverflow points, I'm also asking
this as a question there so feel free to post answers on that site
http://stackoverflow.com/questions/6133517/parse-config-file-and-command-line-arguments-to-get-a-single-collection-of-optio>.)
--
\ “Apologize, v. To lay the foundation
> Hi,
> I'm new to python and trying to run a borrowed script. The error I
> get suggests that I need to give a proper command to run it. The
> input file is "c26_1plus.csv" and the intended output file is
> "c26_1plus_backbone.csv".
>
> Can anyone help?
>
The usage string in the script says that
You may be interested in a little Python module I wrote to make handling of
command line arguments even easier (open source and free to use) -
http://freshmeat.net/projects/commando
> On Tuesday, January 11, 2011 12:18 AM Sohail wrote:
> Hey, every body has their own favorite method/w
You may be interested in a little Python module I wrote to make handling of
command line arguments even easier (open source and free to use) -
http://freshmeat.net/projects/commando
> On Wednesday, June 02, 2010 12:37 AM Michele Simionato wrote:
> I would like to announce to the wor
On Jan 12, 6:09 pm, Alice Bevan–McGregor wrote:
> entirely sure what you mean by 'smart' options. If your'e referring to
> using a single hyphen and a list of characters to represent a long
> option (which, to the rest of the world, use two leading hyphens) then
> that's pretty weird. ;)
>
> One
On 2011-01-11 21:41:24 -0800, Michele Simionato said:
Originally plac too was able to recognize flags automatically by
looking at the default value (if the default value is a boolean then
the option is a flag); however I removed that functionality because I
wanted to be able to differentiate b
On Jan 11, 6:57 pm, Mike wrote:
> On Jan 11, 11:26 am, Michele Simionato
> wrote:
> > In that case easy_install/pip/whatever will install the dependency
> > automatically (who is installing
> > dependencies by hand nowadays?).
>
> I do. Is this bad? :}
You are simply spending more time than need
On Jan 11, 4:06 pm, Alice Bevan–McGregor wrote:
> After looking into it, Plac's default help display isn't very helpful;
> you need to massage your application a fair amount before generating
> nice, complete-looking argument lists and such. For example:
>
> def main(verbose: ('prints mor
On Jan 11, 11:26 am, Michele Simionato
wrote:
>
> In that case easy_install/pip/whatever will install the dependency
> automatically (who is installing
> dependencies by hand nowadays?). More seriously I thought being based
I do. Is this bad? :}
--
http://mail.python.org/mailman/listinfo/python-
On Jan 11, 5:22 pm, Jean-Michel Pichavant
wrote:
> Michele Simionato wrote:
> > On Jan 11, 4:06 pm, Alice Bevan McGregor wrote:
>
> >> Plac appears (from the documentation) to be written on top of argparse.
> >> :(
>
> > And the problem with that being what?
>
> ... not available to python 2.5 /
Michele Simionato wrote:
On Jan 11, 4:06 pm, Alice Bevan–McGregor wrote:
Plac appears (from the documentation) to be written on top of argparse.
:(
And the problem with that being what?
... not available to python 2.5 / 2.6 users :)
JM
--
http://mail.python.org/mailman/listinfo/
On Jan 11, 4:06 pm, Alice Bevan–McGregor wrote:
> Plac appears (from the documentation) to be written on top of argparse.
> :(
And the problem with that being what?
--
http://mail.python.org/mailman/listinfo/python-list
On 2011-01-11 00:32:32 -0800, Michele Simionato said:
It's a pity that the argument parsing modules in the standard library
are so verbose that everybody is reinventing the same thing :-( It
looks like you have reinvented plac: http://pypi.python.org/pypi/plac
After looking into it, Plac's def
On 2011-01-11 00:32:32 -0800, Michele Simionato said:
On Jan 11, 8:25 am, Alice Bevan–McGregor wrote:
I got tired of using PasteScript and OptParse. Mostly OptParse, actually. :/
It's a pity that the argument parsing modules in the standard library
are so verbose that everybody is reinvent
On Jan 11, 8:25 am, Alice Bevan–McGregor wrote:
explicit callbacks or typecasting functions, etc.
>
> I got tired of using PasteScript and OptParse. Mostly OptParse, actually. :/
It's a pity that the argument parsing modules in the standard library
are so verbose that everybody is reinventing
On 2011-01-10 21:18:41 -0800, Sohail said:
Hey, every body has their own favorite method/ways to process command
line arguments. I've worked on a little CPython extension to handle
command line arguments may be you'll find it interesting and useful
Even I've implemente
3.1.
>
> With blatant immodesty, plac claims to be the easiest to use command
> line arguments parser module in the Python world. Its goal is to
> reduce the
> learning curve of argparse from hours to minutes. It does so by
> removing the need to build a command line arguments parser by
On Jun 2, 6:37 am, Michele Simionato
wrote:
> I would like to announce to the world the first public release of
> plac:
>
> http://pypi.python.org/pypi/plac
The second release is out. I have added the recognition of keyword
arguments, improved the formatting of the help message, and added many
t
Michele Simionato wrote:
> It seems I have to take that claim back. A few hours after the
> announce I was pointed out tohttp://pypi.python.org/pypi/CLIArgs
> which, I must concede, is even easier to use than plac. It seems
> everybody has written its own command line arguments parser
On Jun 2, 6:37 am, Michele Simionato
wrote:
> With blatant immodesty, plac claims to be the easiest to use command
> line arguments parser module in the Python world
It seems I have to take that claim back. A few hours after the
announce I was pointed out to http://pypi.python.org/pypi/C
On Jun 2, 11:01 am, Stefan Behnel wrote:
> I managed to talk a Java-drilled collegue of mine into
> writing a Python script for a little command line utility, but he needed a
> way to organise his argument extraction code when the number of arguments
> started to grow beyond two. I told him that t
Paul Rubin, 02.06.2010 10:43:
Tim Golden writes:
pattern, which provides a minimally semi-self-documenting
approach for positional args, but I've always found the existing
offerings just a little too much work to bother with.
I'll give plac a run and see how it behaves.
After using optparse a
easiest to use command
line arguments parser module in the Python world. Its goal is to
reduce the
learning curve of argparse from hours to minutes. It does so by
removing the need to build a command line arguments parser by hand:
actually it is smart enough to infer the parser from function
annotations
On Jun 2, 10:43 am, Paul Rubin wrote:
> Tim Golden writes:
> > pattern, which provides a minimally semi-self-documenting
> > approach for positional args, but I've always found the existing
> > offerings just a little too much work to bother with.
> > I'll give plac a run and see how it behaves.
Tim Golden writes:
> pattern, which provides a minimally semi-self-documenting
> approach for positional args, but I've always found the existing
> offerings just a little too much work to bother with.
> I'll give plac a run and see how it behaves.
After using optparse a couple of times I got the
On 02/06/2010 05:37, Michele Simionato wrote:
I would like to announce to the world the first public release of
plac:
http://pypi.python.org/pypi/plac
Plac is a wrapper over argparse and works in all versions of
Python starting from Python 2.3 up to Python 3.1.
I like it. I'm a constant us
arguments parser module in the Python world. Its goal is to
reduce the
learning curve of argparse from hours to minutes. It does so by
removing the need to build a command line arguments parser by hand:
actually it is smart enough to infer the parser from function
annotations.
Here is a simple example
On 2010-04-03 18:09, mcanjo wrote:
I have an executable (I don't have access to the source code) that
processes some data. I double click on the icon and a Command prompt
window pops up. The program asks me for the input file, I hit enter,
and then it asks me for and output filename, I hit enter
On Apr 5, 11:22 am, mcanjo wrote:
> On Apr 4, 6:32 am, Simon Brunning wrote:
>
>
>
> > On 3 April 2010 18:20, mcanjo wrote:
>
> > > I tried doing the following code:
>
> > > from subprocess import Popen
> > > from subprocess import PIPE, STDOUT
> > > exefile = Popen('pmm.exe', stdout = PIPE, std
On Apr 4, 6:32 am, Simon Brunning wrote:
> On 3 April 2010 18:20, mcanjo wrote:
>
> > I tried doing the following code:
>
> > from subprocess import Popen
> > from subprocess import PIPE, STDOUT
> > exefile = Popen('pmm.exe', stdout = PIPE, stdin = PIPE, stderr =
> > STDOUT)
> > exefile.communica
On 4/3/10 12:09 PM, mcanjo wrote:
I have an executable (I don't have access to the source code) that
processes some data. I double click on the icon and a Command prompt
window pops up. The program asks me for the input file, I hit enter,
and then it asks me for and output filename, I hit enter a
put and standard error: there could
> be some message that give you hints about the solution.
To mcanjo: note that you didn't provide the second '\n'
Also, are you sure the program does not accept command line arguments?
Many do, and switch to interactive mode when no argument is provided.
I'd try with -h /h --help /help -? /?
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list
On 3 April 2010 18:20, mcanjo wrote:
> I tried doing the following code:
>
> from subprocess import Popen
> from subprocess import PIPE, STDOUT
> exefile = Popen('pmm.exe', stdout = PIPE, stdin = PIPE, stderr =
> STDOUT)
> exefile.communicate('MarchScreen.pmm\nMarchScreen.out')[0]
>
> and the Comm
On 3 Apr, 19:20, mcanjo wrote:
> On Apr 3, 11:15 am, Patrick Maupin wrote:
>
>
>
> > On Apr 3, 11:09 am, mcanjo wrote:
>
> > > I have an executable (I don't have access to the source code) that
> > > processes some data. I double click on the icon and a Command prompt
> > > window pops up. The p
On Apr 3, 12:20 pm, mcanjo wrote:
> On Apr 3, 11:15 am, Patrick Maupin wrote:
>
>
>
> > On Apr 3, 11:09 am, mcanjo wrote:
>
> > > I have an executable (I don't have access to the source code) that
> > > processes some data. I double click on the icon and a Command prompt
> > > window pops up. Th
On Apr 3, 11:15 am, Patrick Maupin wrote:
> On Apr 3, 11:09 am, mcanjo wrote:
>
> > I have an executable (I don't have access to the source code) that
> > processes some data. I double click on the icon and a Command prompt
> > window pops up. The program asks me for the input file, I hit enter,
On 3 April 2010 17:09, mcanjo wrote:
> I have an executable (I don't have access to the source code) that
> processes some data. I double click on the icon and a Command prompt
> window pops up. The program asks me for the input file, I hit enter,
> and then it asks me for and output filename, I h
On Apr 3, 11:09 am, mcanjo wrote:
> I have an executable (I don't have access to the source code) that
> processes some data. I double click on the icon and a Command prompt
> window pops up. The program asks me for the input file, I hit enter,
> and then it asks me for and output filename, I hit
I have an executable (I don't have access to the source code) that
processes some data. I double click on the icon and a Command prompt
window pops up. The program asks me for the input file, I hit enter,
and then it asks me for and output filename, I hit enter a second time
and it goes off and doe
In <7slr5ife6...@mid.uni-berlin.de> "Diez B. Roggisch"
writes:
>Am 31.01.10 16:52, schrieb kj:
>> I want to pass Chinese characters as command-line arguments to a
>> Python script. My terminal has no problem displaying these
>> characters, and passing them
Am 31.01.10 16:52, schrieb kj:
I want to pass Chinese characters as command-line arguments to a
Python script. My terminal has no problem displaying these
characters, and passing them to the script, but I can't get Python
to understand them properly.
E.g. if I pass one such character t
I want to pass Chinese characters as command-line arguments to a
Python script. My terminal has no problem displaying these
characters, and passing them to the script, but I can't get Python
to understand them properly.
E.g. if I pass one such character to the simple script
import sys
On Tue, 17 Nov 2009 23:57:55 +, Rhodri James wrote:
>>> Quote the filenames or escape the spaces:
>>>
>>> C:\Python26\Python.exe C:\echo.py "C:\New Folder\text.txt"
>>>
>>> We've been living with this pain ever since windowed GUIs encouraged
>>> users
>>> to put spaces in their file names (A
Rhodri James wrote:
We've been living with this pain ever since windowed GUIs encouraged
users to put spaces in their file names (Apple, I'm looking at you!).
It's not really Apple's fault. There was no problem with
spaces in filenames in the classic MacOS environment,
because there was no tex
Nobody wrote:
On Tue, 17 Nov 2009 11:47:46 -0800, Gerry wrote:
How about this:
lastarg = " ".join(sys.argv[2:])
What about it?
IOW, why would you want to do that?
Like many tricks, it'd work if several conditions applied:
1) there's exactly two arguments expected on the com
On Tue, 17 Nov 2009 19:26:46 -, Nobody wrote:
On Mon, 16 Nov 2009 23:30:09 +, Rhodri James wrote:
Quote the filenames or escape the spaces:
C:\Python26\Python.exe C:\echo.py "C:\New Folder\text.txt"
We've been living with this pain ever since windowed GUIs encouraged
users
to put
On Tue, 17 Nov 2009 11:47:46 -0800, Gerry wrote:
> How about this:
>
> lastarg = " ".join(sys.argv[2:])
What about it?
IOW, why would you want to do that?
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 17, 2:26 pm, Nobody wrote:
> On Mon, 16 Nov 2009 23:30:09 +, Rhodri James wrote:
> > Quote the filenames or escape the spaces:
>
> > C:\Python26\Python.exe C:\echo.py "C:\New Folder\text.txt"
>
> > We've been living with this pain ever since windowed GUIs encouraged users
> > to put s
On Mon, 16 Nov 2009 23:30:09 +, Rhodri James wrote:
> Quote the filenames or escape the spaces:
>
> C:\Python26\Python.exe C:\echo.py "C:\New Folder\text.txt"
>
> We've been living with this pain ever since windowed GUIs encouraged users
> to put spaces in their file names (Apple, I'm look
On Nov 16, 5:30 pm, "Rhodri James"
wrote:
> We've been living with this pain ever since windowed GUIs encouraged users
> to put spaces in their file names (Apple, I'm looking at you!).
> Fundamentally, if people want the pretty they have to live with the
> consequences.
Thanks everyone , p
On Mon, 16 Nov 2009 23:18:23 -, rantingrick
wrote:
I am currently having "fun" with command line arguments in a windows
environment. If i get a path that has spaces anywhere in it my script
gets the wrong arguments from sys.argv. You guy's probably know what i
am talking a
On Mon, Nov 16, 2009 at 6:18 PM, rantingrick wrote:
> I am currently having "fun" with command line arguments in a windows
> environment. If i get a path that has spaces anywhere in it my script
> gets the wrong arguments from sys.argv. You guy's probably know what i
>
I am currently having "fun" with command line arguments in a windows
environment. If i get a path that has spaces anywhere in it my script
gets the wrong arguments from sys.argv. You guy's probably know what i
am talking about. Heres and example.
'C:\\Python26\\Python.exe
En Fri, 24 Apr 2009 06:40:23 -0300, Enchanter
escribió:
How to pass the raw command line arguments to the python?
That depends on the OS or the shell you're using.
Such as:
mypython.py txt -c "Test Only" {Help}
The arguments I hope to get is:
tx
Enchanter wrote:
How to pass the raw command line arguments to the python?
Such as:
mypython.py txt -c "Test Only" {Help}
The arguments I hope to get is:
txt -c "Test Only" {Help} -- Keep the
quotation marks in the arguments.
As
On Fri, Apr 24, 2009 at 2:40 AM, Enchanter wrote:
> How to pass the raw command line arguments to the python?
>
> Such as:
>
> mypython.py txt -c "Test Only" {Help}
>
>
> The arguments I hope to get is:
>
> txt -c "Test Only" {He
How to pass the raw command line arguments to the python?
Such as:
mypython.py txt -c "Test Only" {Help}
The arguments I hope to get is:
txt -c "Test Only" {Help} -- Keep the
quotation marks in the arguments.
--
http://mail.python.org/mai
Hello folks ,I have a program in which a text file is generated as an output
eg
C:\prog\ prog -x test.txt
Right now whenever i have to read the test file i have to put its name
manually in my code.
eg
f=open("c:\\prog\\test.txt","r")
How ever i want to add the name of the test file dynamically to
> --
> >http://mail.python.org/mailman/listinfo/python-list
>
> In most Unix/Linux and related OS shells, the angled brackets *do*
> specify input and output streams as you surmise. However, they are
> *not* seen by the script as command line arguments. (And they are
>
seen by the script as command line arguments. (And they are
*not* brackets, and do not need to be matched. )
For any command,
cmd < file
redirects the contents of file to cmd's standard input, which in Python
is accessed by reading from sys.stdin (use input or raw_input or
s
1 - 100 of 192 matches
Mail list logo