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 about. Heres and
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
> am talking about. Heres and
Chris wrote:
> On Mar 4, 8:38 am, "Mike Walker" <[EMAIL PROTECTED]> wrote:
>>> If you run a python file, ie. just double clicking it the only
>>> argument you will have will be the filename of the script. If you
>>> create a shortcut to the script and in the target box add your
>>> arguments (if y
On Mar 4, 8:38 am, "Mike Walker" <[EMAIL PROTECTED]> wrote:
> > If you run a python file, ie. just double clicking it the only
> > argument you will have will be the filename of the script. If you
> > create a shortcut to the script and in the target box add your
> > arguments (if you have quotati
"Mark Tolonen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> From the command line, the 'ftype' and 'assoc' commands can be used
> view how an extension is handled:
>
> C:\>assoc .py
> .py=Python.File
>
> C:\>ftype Python.File
> Python.File="C:\Python25\python.exe" "%1" %
"Mike Walker" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
>> If you run a python file, ie. just double clicking it the only
>> argument you will have will be the filename of the script. If you
>> create a shortcut to the script and in the target box add your
>> arguments (if yo
> If you run a python file, ie. just double clicking it the only
> argument you will have will be the filename of the script. If you
> create a shortcut to the script and in the target box add your
> arguments (if you have quotation marks place them after not inside)
> you will see your arguments
On Mar 4, 7:12 am, "Mike Walker" <[EMAIL PROTECTED]> wrote:
> I am having some problems with command line arguments in Windows. The same
> code under Linux works fine.
>
> In Windows I only get one argument no matter how many arguments are passed
> on the command line. I think there is some problem
Russ P. wrote:
> Is it possible to pass command-line arguments when running a program
> in IDLE? The "Run" menu does not seem to provide that option. Thanks.
thunderfoot's workaround should work well, but requires changing the
script.
If you want IDLE environment, but don't mind running IDLE from
On Nov 7, 6:27 am, "Russ P." <[EMAIL PROTECTED]> wrote:
> Is it possible to pass command-line arguments when running a program
> in IDLE? The "Run" menu does not seem to provide that option. Thanks.
Can't you just fake the command line args by setting sys.argv? This
isn't too sophisticated, but it
it does have one in activepython
Thanks and Regards,
Ginger
- Original Message -
From: "Russ P." <[EMAIL PROTECTED]>
To:
Sent: Wednesday, November 07, 2007 8:56 AM
Subject: command-line arguments in IDLE
> Is it possible to pass command-line arguments when running a program
> in ID
En Wed, 14 Mar 2007 16:51:04 -0300, Jim <[EMAIL PROTECTED]> escribió:
> I'm trying to use subprocess to drive a Perl script. I'm having some
> trouble getting it to spot the command line arguments. Basically, if
> I call subprocess(args).wait() where args has a second item, I can't
> convince th
Thanks for the answers; that was the problem exactly.
--JMike
Duncan Booth wrote:
> It sounds like the registry entry for running Python files is messed up.
> Can you go to a command line and see what the command 'ftype Python.File'
> displays? (Assuming that command lines and ftype still work
"Duncan Booth" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> It sounds like the registry entry for running Python files is messed up.
> Can you go to a command line and see what the command 'ftype Python.File'
> displays? (Assuming that command lines and ftype still work on V
[EMAIL PROTECTED] wrote:
> But on Windows Vista, when I run that command, I get
>
> there are 1 args
> arg: printargs.py
>
> What's up with that?
It sounds like the registry entry for running Python files is messed up.
Can you go to a command line and see what the command 'ftype Pyth
Some further information: perl seems to do the same thing (losing
arguments).
We think it may have something to do with file association.
Any ideas anyone?
--JMike
--
http://mail.python.org/mailman/listinfo/python-list
By the way, note that if I say (on Vista)
python printargs.py booga -a wooga
I get the desired output:
> there are 4 args
> arg: printargs.py
> arg: booga
> arg: -a
> arg: wooga
So the quesiton still stands, what's up with that?
Thanks,
--JMike
--
http://mail.pytho
Ross Ridge wrote:
> Tim Golden wrote:
> > python.file="C:\Python24\python.exe" "%1" %*
>
> [EMAIL PROTECTED] wrote:
> > So now I got to decide whether the file association should be
> > set to "%2" "%3" "%4" "%5" "%6" "%7" "%8" "%9" and change the
> > programs that count the arguments or set it to
Tim Golden wrote:
> python.file="C:\Python24\python.exe" "%1" %*
[EMAIL PROTECTED] wrote:
> So now I got to decide whether the file association should be
> set to "%2" "%3" "%4" "%5" "%6" "%7" "%8" "%9" and change the
> programs that count the arguments or set it to "%*" and change
> the programs
Tim Golden wrote:
> [ezd]
>
> | # 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',
[ezd]
| # 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']
Almost certainly means that the associ
Jon Hewer wrote:
>>What's the purpose of this utility? Is it to do something with the URL?
>>And the URL must always be specified? What about the name? Also
>>mandatory, or optional? The relationship between the two?
>
>
> its just a simple rss reader. i'm writing it almost purely just to
>
>What's the purpose of this utility? Is it to do something with the URL?
>And the URL must always be specified? What about the name? Also
>mandatory, or optional? The relationship between the two?
its just a simple rss reader. i'm writing it almost purely just to
get me using language (i'm le
[EMAIL PROTECTED] wrote:
> py>parser.add_option("-n", "--name", dest="name", action="store",
> py> help="enter a name")
> py>parser.add_option("-u", "--url", action="store", dest="url",
> help = "enter an url")
It's worth noting that this will have the same eff
You also could opt for the OptionParser in optparse, it is quiet
powerful, and you can keep your code clean. Your requirements would
translate to something like:
py>#!/usr/bin/env python
py>"""show OptionParser
py>"""
py>from optparse import OptionParser
py>
py>def main():
py>parser = OptionPar
Jon Hewer wrote:
> i am writing a little script and currently implementing command line
> arguments following the guide by mark pilgrim from dive into python;
>
> http://diveintopython.org/scripts_and_streams/command_line_arguments.html
>
> thats all fine, however i am not sure of the BEST way to
Trent Mick wrote:
>>I used the python2.4.MSI from python.org site (dated 3-6-05). I think this
>>was the first time they went to MSI verses an exe based installer.
>>
>>it says Python 2.4 (#60 November 30th, 2004) when I start it.
>
>
> I think Martin has been doing MSIs for a little bit longer t
[michael wrote]
> >> I wonder why this was needed for 2.4 and not 2.2? I don't think it was
> >> lingering things from old installs because it happened on a persons
> >> computer that had never had any python installed before 2.4.
> >
[Trent]
> > It might be due to a bug in the Python 2.4 install
On Thu, 25 Aug 2005 11:39:48 -0700, Trent Mick wrote:
> [michael wrote]
>> SOLVED! Thank you.
>>
>> I wonder why this was needed for 2.4 and not 2.2? I don't think it was
>> lingering things from old installs because it happened on a persons
>> computer that had never had any python installed bef
[michael wrote]
> SOLVED! Thank you.
>
> I wonder why this was needed for 2.4 and not 2.2? I don't think it was
> lingering things from old installs because it happened on a persons
> computer that had never had any python installed before 2.4.
It might be due to a bug in the Python 2.4 installer
On Thu, 25 Aug 2005 00:46:41 -0700, Tim Roberts wrote:
> michael <[EMAIL PROTECTED]> wrote:
>
>>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
On Thu, 25 Aug 2005 00:46:41 -0700, Tim Roberts wrote:
> michael <[EMAIL PROTECTED]> wrote:
>
>>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
michael <[EMAIL PROTECTED]> wrote:
>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
>
>I see a list with
>
>['test.py', 'this', 'is', 'a', 'test'
41 matches
Mail list logo