Re: Strange Behavior on Python 3 Windows Command Line

2012-02-13 Thread Waylan Limberg
On Mon, Feb 13, 2012 at 3:16 PM, Arnaud Delobelle wrote: >> Strangely it was working fine the other day. Then while debugging a >> script it suddenly started do this and now does this for every script > > How were you debugging? I think I may have been attempting to use pipes to redirect stdin an

Re: Strange Behavior on Python 3 Windows Command Line

2012-02-13 Thread Arnaud Delobelle
On 13 February 2012 19:50, waylan wrote: > When I try running any Python Script on the command line with Python > 3.2 I get this weird behavior. The cursor dances around the command > line window and nothing ever happens. Pressing Ctr+C does nothing. > When I close the window (mouse click on X in

Strange Behavior on Python 3 Windows Command Line

2012-02-13 Thread waylan
When I try running any Python Script on the command line with Python 3.2 I get this weird behavior. The cursor dances around the command line window and nothing ever happens. Pressing Ctr+C does nothing. When I close the window (mouse click on X in top right corner), an error dialog appears asking

Re: Can module tell if running from interpreter vs Windows command line ?

2009-07-15 Thread Asun Friere
On Jul 16, 2:14 pm, alex23 wrote: ... > AND > you're citing back what I myself wrote in the link to which I also > referred the OP - whom (sic) has subsequently posted his success with this > technique - so I'm not really sure what the point is here other than > "if you have a different use case

Re: Can module tell if running from interpreter vs Windows command line ?

2009-07-15 Thread alex23
On Jul 16, 12:56 pm, Asun Friere wrote: > As you note there, this will work when running the vanilla shell (ie > running  it from the command line), but not (potentially) in other > interactive environments (IronPython being the example you give). Actually, that was IPython, which is an enhanced

Re: Can module tell if running from interpreter vs Windows command line ?

2009-07-15 Thread Asun Friere
On Jul 16, 10:47 am, alex23 wrote: ... > This older post should > help:http://groups.google.com/group/comp.lang.python/browse_frm/thread/6c5... > > But the quick answer is to import sys into your program, and do a test > on hasattr(sys, 'ps1'), which is only created when running the > interacti

Re: Can module tell if running from interpreter vs Windows command line ?

2009-07-15 Thread pdlemper
On Wed, 15 Jul 2009 19:07:18 -0500, pdlem...@earthlink.net wrote: >The WConio console module produces different colors, sometimes quite >different, when run from Windows command line vs from Python >interpreter >>> . A good foregnd/backgnd combination under one >may be unrea

Re: Can module tell if running from interpreter vs Windows command line ?

2009-07-15 Thread alex23
On Jul 16, 10:07 am, pdlem...@earthlink.net wrote: > The WConio console module produces different colors, sometimes quite > different, when run from Windows command line vs from Python > interpreter >>> .  A good foregnd/backgnd combination under one > may be unreadable under

Re: Can module tell if running from interpreter vs Windows command line ?

2009-07-15 Thread alex23
On Jul 16, 10:41 am, alex23 wrote: > It's recommended that you search through the list for similar > questions before posting. Of course, it's even MORE important that one actually ensures they're responding to the _same_ question before pointing at an answer... This older post should help: http

Can module tell if running from interpreter vs Windows command line ?

2009-07-15 Thread pdlemper
The WConio console module produces different colors, sometimes quite different, when run from Windows command line vs from Python interpreter >>> . A good foregnd/backgnd combination under one may be unreadable under the other : ( I'm using Python 3.0 with the corresponding WC

Re: windows command-line

2009-07-09 Thread Gabriel Genellina
En Wed, 08 Jul 2009 14:23:54 -0300, Emile van Sebille escribió: On 7/8/2009 10:07 AM Lucas Junqueira said... Hi, I'd like to run a simple windows command-line program from within my python script and agt all the returt it generates. Is this possible? How can I do it? Dependi

Re: windows command-line

2009-07-08 Thread Emile van Sebille
On 7/8/2009 10:07 AM Lucas Junqueira said... Hi, I'd like to run a simple windows command-line program from within my python script and agt all the returt it generates. Is this possible? How can I do it? Depending on python version, look into subprocess, commands or os.pipe and re

windows command-line

2009-07-08 Thread Lucas Junqueira
Hi, I'd like to run a simple windows command-line program from within my python script and agt all the returt it generates. Is this possible? How can I do it? Thank you! Veja quais são os assunt

Re: Windows command line not displaying print commands

2009-03-31 Thread JonathanB
I think I found the problem. I recently removed Python 2.5 and replaced it with 2.6. When I got in, I tried to run some django commands and even they weren't producing output. On a hunch, I tried to uninstall 2.6 and reinstall it, since now even django wasn't producing output. When I tried, it told

Re: Windows command line not displaying print commands

2009-03-31 Thread John Machin
On Mar 31, 9:57 am, JonathanB wrote: > On Mar 30, 6:28 pm, John Machin wrote: > > > On Mar 31, 8:37 am, Irmen de Jong wrote: > > > Does just typing: > > > >    python > > Yes, just typing python takes me to my interactive prompt > > > > Or do you have a module in your E:\Python\dev directory cal

Re: Windows command line not displaying print commands

2009-03-31 Thread John Machin
On Mar 31, 11:42 am, Terry Reedy wrote: > JonathanB wrote: > > Ok, I'm sure this is really simple, but I cannot for the life of me > > get any print statements from any of my python scripts to actually > > print when I call them from the windows command line.

Re: Windows command line not displaying print commands

2009-03-30 Thread Terry Reedy
JonathanB wrote: Ok, I'm sure this is really simple, but I cannot for the life of me get any print statements from any of my python scripts to actually print when I call them from the windows command line. What am I doing wrong? hello.py: print "Hello World!" command line: E:\Py

Re: Windows command line not displaying print commands

2009-03-30 Thread JonathanB
#This is pyFind, a python replacement for find(1) import os, sys, re, fnmatch from os.path import join from optparse import OptionParser usage = "usage: %prog --name [directory1 directory2]" parser = OptionParser(usage=usage) parser.add_option("--regex", dest="regex", help="REGEX MATCHING DOES NO

Re: Windows command line not displaying print commands

2009-03-30 Thread JonathanB
On Mar 30, 6:28 pm, John Machin wrote: > On Mar 31, 8:37 am, Irmen de Jong wrote: > > Does just typing: > > >    python Yes, just typing python takes me to my interactive prompt > > Or do you have a module in your E:\Python\dev directory called 'os', 'sys' > > or something > > else that may cl

Re: Windows command line not displaying print commands

2009-03-30 Thread John Machin
On Mar 31, 8:37 am, Irmen de Jong wrote: > JonathanB wrote: > > Ok, I'm sure this is really simple, but I cannot for the life of me > > get any print statements from any of my python scripts to actually > > print when I call them from the windows command line.

Re: Windows command line not displaying print commands

2009-03-30 Thread Irmen de Jong
JonathanB wrote: Ok, I'm sure this is really simple, but I cannot for the life of me get any print statements from any of my python scripts to actually print when I call them from the windows command line. What am I doing wrong? hello.py: print "Hello World!" command line: E:\Py

Windows command line not displaying print commands

2009-03-30 Thread JonathanB
Ok, I'm sure this is really simple, but I cannot for the life of me get any print statements from any of my python scripts to actually print when I call them from the windows command line. What am I doing wrong? hello.py: print "Hello World!" command line: E:\Python\dev>

Re: Capture Windows command line output - put in text file

2006-02-01 Thread Ernesto
Ernesto wrote: > I'm looking for a way to capture command line output from a cmd > session. Is there a way to use python to launch the application from > the beggining then stream all of the output to a text file ? Nevermind. This is a telnet question. I'm trying to get telnet localhost

Capture Windows command line output - put in text file

2006-02-01 Thread Ernesto
I'm looking for a way to capture command line output from a cmd session. Is there a way to use python to launch the application from the beggining then stream all of the output to a text file ? -- http://mail.python.org/mailman/listinfo/python-list

Problem: Windows Command line Pipe to stdin

2005-10-30 Thread GerShar
Python 2.3 on Windows XP The following works when run from the command line. import sys text = sys.stdin.read() # do something on the text # ... sys.stdout.write(text) But if the above code is used as a filter program that gets another programs output as shown below, it fails as shown.

Re: Windows command line problem

2005-08-04 Thread [EMAIL PROTECTED]
Here's an example... BEGIN TEST.PY import sys print "Original:", sys.argv for arg in sys.argv: arg = arg.strip('-\x93\x96') # add chars here you want to strip print "Stripped:", arg END TEST.PY -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows command line problem

2005-08-03 Thread [EMAIL PROTECTED]
considering that all the command lines are in sys.argv, it's very simple. -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows command line problem

2005-07-20 Thread Steve Holden
[EMAIL PROTECTED] wrote: > I think the lesson there is 'dont depend on getopt, write your own > command line parser'. I always write my own, as it's so easy to do. > I suppose you built your own car so you could get out a bit, too? After all, there's nothing tricky about a simple internal combust

Re: Windows command line problem

2005-07-20 Thread Benji York
[EMAIL PROTECTED] wrote: > I think the lesson there is 'dont depend on getopt, write your own > command line parser'. I always write my own, as it's so easy to do. While I'll agree that getopt isn't ideal, I find optparse to be much better. -- Benji York -- http://mail.python.org/mailman/listinf

Re: Windows command line problem

2005-07-19 Thread [EMAIL PROTECTED]
I think the lesson there is 'dont depend on getopt, write your own command line parser'. I always write my own, as it's so easy to do. -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows command line problem

2005-07-19 Thread Benji York
MarkE wrote: > The answer appears to be: > An example command line for running the script was written in a word > document. The "Autocorrect" (sic) feature in word replaces a normal > dash There is a lesson there I wish more people would learn: Word is not a text editor. :) -- Benji York -- h

Re: Windows command line problem

2005-07-19 Thread MarkE
This was discovered after consultation with a colleague who shall remain nameless but, well, nailed it basically. The answer appears to be: An example command line for running the script was written in a word document. The "Autocorrect" (sic) feature in word replaces a normal dash at least as I kno

Re: Windows command line problem

2005-07-19 Thread MarkE
I'm using getopt. I doubt getopt recognises \x96 as a command line parameter prefix. I suppose I could iterate over sys.argv doing a replace but that seems messy. I'd rather understand the problem. That said, and me not understanding code pages that much, I chcp'd the machines it works on both com

Re: Windows command line problem

2005-07-18 Thread [EMAIL PROTECTED]
does it matter? Have it key off both "\x96" and "-". -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows command line problem

2005-07-18 Thread Jeff Epler
I don't exactly know what is going on, but '\x96' is the encoding for u'\N{en dash}' (a character that looks like the ASCII dash, u'\N{hyphen-minus}', u'\x45') in the following windows code pages: cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp874 Windows is clearly doing

Windows command line problem

2005-07-18 Thread MarkE
I'm sure someone else has posted a similar problem but I can't find it, nor the solution... I have a python script which accepts a command line argument. E.g. python.exe myscript.py -n Foo I build this as part of a package using distutils with the bdist_wininst option on a Windows 2K (SP4) machin