Re: Python3 "pickle" vs. stdin/stdout - unable to get clean byte streams in Python 3

2015-03-13 Thread Steven D'Aprano
John Nagle wrote: >I'm starting to think that the "cpickle" module, which Python 3 > uses by default, has a problem. After the program has been > running for a while, I start seeing errors such as > > File "C:\projects\sitetruth\InfoSiteRating.py", line 200, in scansite > if len(self.ba

Re: Python3 "pickle" vs. stdin/stdout - unable to get clean byte streams in Python 3

2015-03-12 Thread John Nagle
On 3/12/2015 5:18 PM, John Nagle wrote: > On 3/12/2015 2:56 PM, Cameron Simpson wrote: >> On 12Mar2015 12:55, John Nagle wrote: >>> I have working code from Python 2 which uses "pickle" to talk to a >>> subprocess via stdin/stdio. I'm trying to make that work in Python >>> 3. I'm starting to

Re: Python3 "pickle" vs. stdin/stdout - unable to get clean byte streams in Python 3

2015-03-12 Thread John Nagle
On 3/12/2015 2:56 PM, Cameron Simpson wrote: > On 12Mar2015 12:55, John Nagle wrote: >> I have working code from Python 2 which uses "pickle" to talk to a >> subprocess via stdin/stdio. I'm trying to make that work in Python >> 3. First, the subprocess Python is invoked with the "-d' option, so >

Re: Python3 "pickle" vs. stdin/stdout - unable to get clean byte streams in Python 3

2015-03-12 Thread Peter Otten
John Nagle wrote: > I have working code from Python 2 which uses "pickle" > to talk to a subprocess via stdin/stdio. I'm trying to > make that work in Python 3. > > First, the subprocess Python is invoked with the "-d' option, > so stdin and stdio are supposed to be unbuffered binary streams

Re: Python3 "pickle" vs. stdin/stdout - unable to get clean byte streams in Python 3

2015-03-12 Thread Cameron Simpson
On 12Mar2015 12:55, John Nagle wrote: I have working code from Python 2 which uses "pickle" to talk to a subprocess via stdin/stdio. I'm trying to make that work in Python 3. First, the subprocess Python is invoked with the "-d' option, so stdin and stdio are supposed to be unbuffered binary

Python3 "pickle" vs. stdin/stdout - unable to get clean byte streams in Python 3

2015-03-12 Thread John Nagle
I have working code from Python 2 which uses "pickle" to talk to a subprocess via stdin/stdio. I'm trying to make that work in Python 3. First, the subprocess Python is invoked with the "-d' option, so stdin and stdio are supposed to be unbuffered binary streams. That was enough in Python 2,

Re: [Python-ideas] Unicode stdin/stdout

2013-11-18 Thread Andrew Barnert
feredReader/Writer around that, then constructs a TextIOWrapper with UTF-16 or the default encoding around that. At startup, you just do that for the three GetStdHandle handles, and that's your stdin, stdout, and stderr. Besides not being reusable enough for people who want to wrap HANDLEs from

Re: [Python-ideas] Unicode stdin/stdout

2013-11-18 Thread random832
On Mon, Nov 18, 2013, at 7:33, Robin Becker wrote: > UTF-8 stuff This doesn't really solve the issue I was referring to, which is that windows _console_ (i.e. not redirected file or pipe) I/O can only support unicode via wide character (UTF-16) I/O with a special function, not via using byte-based

Re: Unicode stdin/stdout

2013-11-18 Thread Robin Becker
On 18/11/2013 15:25, Victor Stinner wrote: Why do you need to force the UTF-8 encoding? Your locale is not correctly configured? It's better to set PYTHONIOENCODING rather than replacing sys.stdout/stderr at runtime. There is an open issue to add a TextIOWrapper.set_encoding() method: http://bu

Re: [Python-ideas] Unicode stdin/stdout

2013-11-18 Thread Victor Stinner
Why do you need to force the UTF-8 encoding? Your locale is not correctly configured? It's better to set PYTHONIOENCODING rather than replacing sys.stdout/stderr at runtime. There is an open issue to add a TextIOWrapper.set_encoding() method: http://bugs.python.org/issue15216 Victor -- https://

Re: [Python-ideas] Unicode stdin/stdout

2013-11-18 Thread Nick Coghlan
On 18 Nov 2013 22:36, "Robin Becker" wrote: > > On 18/11/2013 11:47, Robin Becker wrote: > ... >> >> #c:\python33\lib\site-packages\sitecustomize.py >> import sys, codecs >> sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach()) >> sys.stderr = codecs.getwriter("utf-8")(sys.stderr.det

Re: Unicode stdin/stdout

2013-11-18 Thread Robin Becker
On 18/11/2013 11:47, Robin Becker wrote: ... #c:\python33\lib\site-packages\sitecustomize.py import sys, codecs sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach()) sys.stderr = codecs.getwriter("utf-8")(sys.stderr.detach()) it seems that the above needs extra stuff to ma

Re: Unicode stdin/stdout

2013-11-18 Thread Robin Becker
On 15/11/2013 18:16, random...@fastmail.us wrote: Of course, the real solution to this issue is to replace sys.stdout on windows with an object that can handle Unicode directly with the WriteConsoleW function - the problem there is that it will break code that expects to be able to use sys.stdout

Unicode stdin/stdout (was: Re: python 3.3 repr)

2013-11-15 Thread random832
Of course, the real solution to this issue is to replace sys.stdout on windows with an object that can handle Unicode directly with the WriteConsoleW function - the problem there is that it will break code that expects to be able to use sys.stdout.buffer for binary I/O. I also wasn't able to get th

Re: merge stdin, stdout?

2010-02-07 Thread Anssi Saari
jonny lowe writes: > The result is the same as before. I've tested in fedora11. I don't think script is the answer here, since it only stores what's displayed on a terminal and your program's input comes from a file and is not displayed on the terminal. Simplest solution is probably that you ha

Re: merge stdin, stdout?

2010-02-06 Thread jonny lowe
On Feb 5, 11:10 pm, "Gabriel Genellina" wrote: > En Fri, 05 Feb 2010 17:39:07 -0300, jonny lowe > escribió: > > > > > > > On Feb 4, 8:20 pm, exar...@twistedmatrix.com wrote: > >> On 01:56 am, jonny.lowe.12...@gmail.com wrote: > >> >What I want is to have an easy way tomergeinput.txt and thestdout

Re: merge stdin, stdout?

2010-02-05 Thread Gabriel Genellina
En Fri, 05 Feb 2010 17:39:07 -0300, jonny lowe escribió: On Feb 4, 8:20 pm, exar...@twistedmatrix.com wrote: On 01:56 am, jonny.lowe.12...@gmail.com wrote: >What I want is to have an easy way to merge input.txt and thestdout >so that output.txt look like: >Enter a number: 42 >You entered 42

Re: merge stdin, stdout?

2010-02-05 Thread jonny lowe
On Feb 4, 8:20 pm, exar...@twistedmatrix.com wrote: > On 01:56 am, jonny.lowe.12...@gmail.com wrote: > > > > >Hi everyone, > > >Is there an easy way to mergestdinandstdout? For instance suppose I > >havescriptthat prompts for a number and prints the number. If you > >execute this with redirection f

Re: merge stdin, stdout?

2010-02-04 Thread exarkun
On 01:56 am, jonny.lowe.12...@gmail.com wrote: Hi everyone, Is there an easy way to merge stdin and stdout? For instance suppose I have script that prompts for a number and prints the number. If you execute this with redirection from a file say input.txt with 42 in the file, then executing ./my

merge stdin, stdout?

2010-02-04 Thread jonny lowe
Hi everyone, Is there an easy way to merge stdin and stdout? For instance suppose I have script that prompts for a number and prints the number. If you execute this with redirection from a file say input.txt with 42 in the file, then executing ./myscript < input.txt > output.txt the output.txt m

Re: UTF-8 and stdin/stdout?

2008-05-28 Thread Martin v. Löwis
> $ cat utf8_from_stdin.py > import sys > data = sys.stdin.read() > print "length of data =", len(data) sys.stdin is a byte stream in Python 2, not a character stream. To make it a character stream, do sys.stdin = codecs.getreader("utf-8")(sys.stdin) HTH, Martin -- http:/

Re: UTF-8 and stdin/stdout?

2008-05-28 Thread Ulrich Eckhardt
Chris wrote: > On May 28, 11:08 am, [EMAIL PROTECTED] wrote: >> Say I have a file, utf8_input, that contains a single character, é, >> coded as UTF-8: >> >> $ hexdump -C utf8_input >>  c3 a9 >> 0002 [...] > weird thing is 'c3 a9' is é on my side... and copy/pasting the é > gives me 'e

Re: UTF-8 and stdin/stdout?

2008-05-28 Thread dave_140390
> Shouldn't you do data = data.decode('utf8') ? Yes, that's it! Thanks. -- dave -- http://mail.python.org/mailman/listinfo/python-list

Re: UTF-8 and stdin/stdout?

2008-05-28 Thread Chris
On May 28, 11:08 am, [EMAIL PROTECTED] wrote: > Hi, > > I have problems getting my Python code to work with UTF-8 encoding > when reading from stdin / writing to stdout. > > Say I have a file, utf8_input, that contains a single character, é, > coded as UTF-8: > >         $ hexdump -C utf8_input >  

Re: UTF-8 and stdin/stdout?

2008-05-28 Thread Arnaud Delobelle
[EMAIL PROTECTED] writes: > Hi, > > I have problems getting my Python code to work with UTF-8 encoding > when reading from stdin / writing to stdout. > > Say I have a file, utf8_input, that contains a single character, é, > coded as UTF-8: > > $ hexdump -C utf8_input > c3 a9

UTF-8 and stdin/stdout?

2008-05-28 Thread dave_140390
Hi, I have problems getting my Python code to work with UTF-8 encoding when reading from stdin / writing to stdout. Say I have a file, utf8_input, that contains a single character, é, coded as UTF-8: $ hexdump -C utf8_input c3 a9 0002 If I read this file by

Re: stdin, stdout, redmon

2008-01-22 Thread Thynnus
On 1/21/2008 9:02 AM, Bernard Desnoues wrote: > Hi, > > I've got a problem with the use of Redmon (redirection port monitor). I > intend to develop a virtual printer so that I can modify data sent to > the printer. FWIW: there is a nice update the RedMon (v1.7) called RedMon EE (v1.81) availab

Re: stdin, stdout, redmon

2008-01-22 Thread Thynnus
On 1/22/2008 8:54 AM, Konstantin Shaposhnikov wrote: > Hi, > > This is Windows bug that is described here: > http://support.microsoft.com/default.aspx?kbid=321788 > > This article also contains solution: you need to add registry value: > > HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVe

Re: stdin, stdout, redmon

2008-01-22 Thread Konstantin Shaposhnikov
Sorry, I meant: Alternatively you can use following command cat file | python script.py instead of cat file | script.py On Jan 22, 1:54 pm, Konstantin Shaposhnikov <[EMAIL PROTECTED]> wrote: > Hi, > > This is Windows bug that is described > here:http://support.microsoft.com/default.asp

Re: stdin, stdout, redmon

2008-01-22 Thread Konstantin Shaposhnikov
Hi, This is Windows bug that is described here: http://support.microsoft.com/default.aspx?kbid=321788 This article also contains solution: you need to add registry value: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies \Explorer InheritConsoleHandles = 1 (REG_DWORD type)

Re: stdin, stdout, redmon

2008-01-22 Thread Rolf van de Krol
Well, that's at least weird. I did test my code with Python 2.5 on Win XP, using the command prompt. But testing it with IDLE gives exactly the same error Bernard has. So apparently STDIN can't be accessed with IDLE. Rolf John Machin wrote: > > Excuse me, gentlemen, may I be your referee *befor

Re: stdin, stdout, redmon

2008-01-22 Thread John Machin
On Jan 22, 8:42 pm, Bernard Desnoues <[EMAIL PROTECTED]> wrote: > Hello, > > I checked under linux and it works : > text.txt : > "first line of the text file > second line of the text file" > > test.py : > "import sys > a = sys.stdin.readlines() > x = ''.join(a) > x = x.upper() > sys.stdout.write(x

Re: stdin, stdout, redmon

2008-01-22 Thread Tim Golden
x.upper() > sys.stdout.write(x)" > > >cat text.txt | python test.py > > But I reinstalled Python 2.5 under Windows XP and it doesn't work > anyway. Can you confirm that your script works with Win XP and Python 2.5 ? How are you invoking the script under WinXP? If you&#

Re: stdin, stdout, redmon

2008-01-22 Thread Bernard Desnoues
Hello, I checked under linux and it works : text.txt : "first line of the text file second line of the text file" test.py : "import sys a = sys.stdin.readlines() x = ''.join(a) x = x.upper() sys.stdout.write(x)" >cat text.txt | python test.py But I reinstalled Python 2.5 under Windows XP and i

Re: stdin, stdout, redmon

2008-01-21 Thread Rolf van de Krol
I don't know what you did with your Python installation, but for me this works perfectly. test3.py contains: import sys print sys.stdin.readlines() test.txt contains: Testline1 Testline2 Output of 'python test3.py < test.txt' is: ['Testline1\n', 'Testline2'] Just plain simple and just w

Re: stdin, stdout, redmon

2008-01-21 Thread Bernard Desnoues
Rolf van de Krol a écrit : > According to various tutorials this should work. > > > |import sys > data = sys.stdin.readlines() > print "Counted", len(data), "lines."| > > > Please use google before asking such questions. This was found with only > one search for the terms 'python read stdin' >

Re: stdin, stdout, redmon

2008-01-21 Thread Rolf van de Krol
According to various tutorials this should work. |import sys data = sys.stdin.readlines() print "Counted", len(data), "lines."| Please use google before asking such questions. This was found with only one search for the terms 'python read stdin' Rolf Bernard Desnoues wrote: > Hi, > > I've go

stdin, stdout, redmon

2008-01-21 Thread Bernard Desnoues
Hi, I've got a problem with the use of Redmon (redirection port monitor). I intend to develop a virtual printer so that I can modify data sent to the printer. Redmon send the data flow to the standard input and lauchs the Python program which send modified data to the standard output (Windows X

Re: annoying stdin/stdout + pipes problem

2007-09-24 Thread Gabriel Genellina
En Mon, 24 Sep 2007 04:04:07 -0300, per9000 <[EMAIL PROTECTED]> escribi�: > On 23 Sep, 18:24, Damjan <[EMAIL PROTECTED]> wrote: >> > I want to create a program that reads input from stdio that can prompt >> > a user for input while doing so without getting into problems. >> ... >> >> The trick (wh

Re: annoying stdin/stdout + pipes problem

2007-09-24 Thread per9000
r a windows version of the same? /Per -- PS: for the record: ***>cat replace3.py && echo "---" && cat input.txt | python replace3.py from sys import stdin, stdout def censor(foo, bar, input): return input.replace(foo, bar) fp = open('/dev/tty', &#x

Re: annoying stdin/stdout + pipes problem

2007-09-23 Thread Damjan
> I want to create a program that reads input from stdio that can prompt > a user for input while doing so without getting into problems. ... > As you can see I have commented out what I'd like to do but do not > know how to. Can I somehow halt the previous print to stdout (cat > input.txt) - if so

annoying stdin/stdout + pipes problem

2007-09-23 Thread per9000
hat replaces certain words ***>cat replace2.py from sys import stdin, stdout def censor(foo, bar, input): return input.replace(foo, bar) # i = raw_input('Remove what? ').strip() # o = raw_input('Replace "%s" with what? ' %i).strip() for line in stdin.xreadlines():

Re: Smarter way to do this? Unicode + stdin, stdout

2006-12-17 Thread Martin v. Löwis
BenjaMinster schrieb: > I want to read and write unicode on stdin and stdout. I can't seem to > find any way to force sys.stdin.encoding and sys.stdout.encoding to be > utf-8, so I've got the following workaround: What operating system are you using? Why do you want to do this? Python attempts to

Smarter way to do this? Unicode + stdin, stdout

2006-12-16 Thread BenjaMinster
I want to read and write unicode on stdin and stdout. I can't seem to find any way to force sys.stdin.encoding and sys.stdout.encoding to be utf-8, so I've got the following workaround: import codecs, sys out = codecs.getwriter("utf-8")(sys.stdout) def tricky(): return sys.stdin.readline().decod

Re: Some general questions about using "stdin","stdout"....

2006-02-17 Thread Steve Holden
asdsd sir wrote: > thank you very much for your help... > my big mistake,was to believe that "|" is the pipe symbol for both,unix and > python... > it is really annoying,how such a simple thing can mess things > > Thank you for clearing this out. > It is indeed annoying when assumptions we carry

RE: Some general questions about using "stdin","stdout"....

2006-02-17 Thread asdsd sir
thank you very much for your help... my big mistake,was to believe that "|" is the pipe symbol for both,unix and python... it is really annoying,how such a simple thing can mess things Thank you for clearing this out. _ Free bloggin

Re: Some general questions about using "stdin","stdout"....

2006-02-16 Thread Diez B. Roggisch
asdsd sir wrote: > Hi!I'm new in Python and i'd like to ask some general questions about > stdin,stdout... > > Firstly... > > if we type like something like : >cat "file.txt"|python somefile.py > > #somefile.py > import sys >

Re: Some general questions about using "stdin","stdout"....

2006-02-16 Thread Dan
Hello. If you're new to Python, then input/output isn't the best place to start. Begin with the tutorial: http://docs.python.org/tut/tut.html Other documentation is also linked to from there. However, I will briefly answer your questions. > print "hello"|sys.stdin.read() In Python the | ope

Some general questions about using "stdin","stdout"....

2006-02-16 Thread asdsd sir
Hi!I'm new in Python and i'd like to ask some general questions about stdin,stdout... Firstly... if we type like something like : cat "file.txt"|python somefile.py #somefile.py import sys text=sys.stdin.read() ...then "sys.stdin.read()" will read fr

Re: Redirecting stdin/stdout to self

2006-01-23 Thread Dan M
>>> And if I'm reading it correctly, the Perl >>> script's process starts tcpdump, but redirects its output to its own >>> input, and reads it line by line. And to clarify, what the Perl script is doing is redirecting the standard error to standard out. STDIN is file handle 0, STDOUT is file handl

Re: Redirecting stdin/stdout to self

2006-01-23 Thread Grant Edwards
On 2006-01-23, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2006-01-23, Jan Danielsson <[EMAIL PROTECTED]> wrote: > >> And if I'm reading it correctly, the Perl >> script's process starts tcpdump, but redirects its output to its own >> input, and reads it line by line. > [...] >>...however, th

Re: Redirecting stdin/stdout to self

2006-01-23 Thread Grant Edwards
On 2006-01-23, Jan Danielsson <[EMAIL PROTECTED]> wrote: > And if I'm reading it correctly, the Perl > script's process starts tcpdump, but redirects its output to its own > input, and reads it line by line. [...] >...however, the Perl script solution looks interresting.. Is it > possible to d

Redirecting stdin/stdout to self

2006-01-23 Thread Jan Danielsson
Hello, I thought I'd write a program to collect information from pf (packet filter) and insert it into a postgresql database for review on a web page. First I checked if this has been done already, and found that it has.. Using Perl and SQLite in a program called "hatchet". Well, I want to do i

Re: closing stdin, stdout and stderr

2005-12-27 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Martijn Brouwer <[EMAIL PROTECTED]> wrote: ... > I read this one, which was the reason that I tried os.close instead of > sys.stdXXX.close(). But I would like to know why it does not close a > file discriptor is I call its close method(). They're special. I suppos

Re: closing stdin, stdout and stderr

2005-12-26 Thread Martijn Brouwer
On Mon, 2005-12-26 at 23:15 +, Robin Becker wrote: > Robin Becker wrote: > > Martijn Brouwer wrote: > > > >> I am writing a unix daemon in python, so I want to close stdin, stdout > >> and stderr. > >> My first attempt was to the standard file de

Re: closing stdin, stdout and stderr

2005-12-26 Thread Martijn Brouwer
On Mon, 2005-12-26 at 23:13 +, Robin Becker wrote: > Martijn Brouwer wrote: > > I am writing a unix daemon in python, so I want to close stdin, stdout > > and stderr. > > My first attempt was to the standard file descriptors using their > > close() methods. After

Re: closing stdin, stdout and stderr

2005-12-26 Thread Robin Becker
Robin Becker wrote: > Martijn Brouwer wrote: > >> I am writing a unix daemon in python, so I want to close stdin, stdout >> and stderr. >> My first attempt was to the standard file descriptors using their >> close() methods. After closing stdout, I could not print

Re: closing stdin, stdout and stderr

2005-12-26 Thread Robin Becker
Martijn Brouwer wrote: > I am writing a unix daemon in python, so I want to close stdin, stdout > and stderr. > My first attempt was to the standard file descriptors using their > close() methods. After closing stdout, I could not print anymore, so > this seemed to work. However,

closing stdin, stdout and stderr

2005-12-26 Thread Martijn Brouwer
I am writing a unix daemon in python, so I want to close stdin, stdout and stderr. My first attempt was to the standard file descriptors using their close() methods. After closing stdout, I could not print anymore, so this seemed to work. However, later I noticed that they were not really closed

Re: stdin -> stdout

2005-08-20 Thread Jeff Schwab
max(01)* wrote: > i was wondering, what's the simplest way to echo the standard input to > the standard output, with no modification. ... > ps: in perl you ca do this: > > ... > while ($line = ) > { > print STDOUT ("$line"); > } > ... I guess you could, but there wouldn't be much point.

Re: stdin -> stdout

2005-08-20 Thread Jorgen Grahn
On Fri, 19 Aug 2005 15:26:27 GMT, max(01)* <[EMAIL PROTECTED]> wrote: > hi. > > i was wondering, what's the simplest way to echo the standard input to > the standard output, with no modification. > > i came up with: ... > but i guess there must be a simpler way. > > using bash i simply do 'cat', *

Re: stdin -> stdout

2005-08-19 Thread John Machin
limodou wrote: > 2005/8/19, max(01)* <[EMAIL PROTECTED]>: > >>hi. >> >>i was wondering, what's the simplest way to echo the standard input to >>the standard output, with no modification. >> >>i came up with: >> >>... >>while True: >> try: >> raw_input() >> except EOFError: >> break >>.

Re: stdin -> stdout

2005-08-19 Thread Steven Bethard
gry@ll.mit.edu wrote: > import sys > for l in sys.stdin: > sys.stdout.write(l) This is fine if you don't need the reads and writes of lines to run in lockstep. File iterators read into a buffer, so you'll probably read 4096 bytes from stdin before you ever write a line to stdout. If th

Re: stdin -> stdout

2005-08-19 Thread Steven Bethard
max(01)* wrote: > i was wondering, what's the simplest way to echo the standard input to > the standard output, with no modification. import sys for line in iter(sys.stdin.readline, ''): sys.stdout.write(line) Note that this uses the second form of iter(), which calls its first argument re

Re: stdin -> stdout

2005-08-19 Thread gry
import sys for l in sys.stdin: sys.stdout.write(l) -- George -- http://mail.python.org/mailman/listinfo/python-list

Re: stdin -> stdout

2005-08-19 Thread Dan Sommers
On Fri, 19 Aug 2005 15:26:27 GMT, "max(01)*" <[EMAIL PROTECTED]> wrote: > ps: in perl you ca do this: > ... > while ($line = ) >{ > print STDOUT ("$line"); >} > ... import fileinput import sys for line in fileinput.input(): sys.stdout.write(line) Regards, Dan -- Dan Sommers

Re: stdin -> stdout

2005-08-19 Thread limodou
2005/8/19, max(01)* <[EMAIL PROTECTED]>: > hi. > > i was wondering, what's the simplest way to echo the standard input to > the standard output, with no modification. > > i came up with: > > ... > while True: >try: > raw_input() >except EOFError: > break > ... > > but i guess

stdin -> stdout

2005-08-19 Thread max(01)*
hi. i was wondering, what's the simplest way to echo the standard input to the standard output, with no modification. i came up with: ... while True: try: raw_input() except EOFError: break ... but i guess there must be a simpler way. using bash i simply do 'cat', *sigh*! bye

Re: stdin/stdout fileno() always returning -1 from windows service

2005-07-18 Thread chuck
"common wisdom" interesting. The value of the closed attribute is "False" when tested from within the service. Still digging -- http://mail.python.org/mailman/listinfo/python-list

Re: stdin/stdout fileno() always returning -1 from windows service

2005-07-18 Thread Jeff Epler
It seems to simply be common wisdom. e.g., http://mail.python.org/pipermail/python-win32/2004-September/002332.html http://mail.mems-exchange.org/pipermail/quixote-users/2004-March/002743.html http://twistedmatrix.com/pipermail/twisted-python/2001-December/000644.html etc If you can find chapter

Re: stdin/stdout fileno() always returning -1 from windows service

2005-07-18 Thread chuck
Interesting. The stdin and stdout objects in my service seems respond to returing a string for the statements str(sys.stdin) and str(sys.stdout). I guess they are just not attached to files? Can you provide a reference (MSDN or otherwise) that indicates that Windows Services don't have standard

Re: stdin/stdout fileno() always returning -1 from windows service

2005-07-18 Thread Jeff Epler
On Sun, Jul 17, 2005 at 06:43:00PM -0700, chuck wrote: > I have found that sys.stdin.fileno() and sys.stdout.fileno() always > return -1 when executed from within a win32 service written using the > win32 extensions for Python. > > Anyone have experience with this or know why? because there *is*

stdin/stdout fileno() always returning -1 from windows service

2005-07-17 Thread chuck
I have found that sys.stdin.fileno() and sys.stdout.fileno() always return -1 when executed from within a win32 service written using the win32 extensions for Python. Anyone have experience with this or know why? -- http://mail.python.org/mailman/listinfo/python-list

Re: Redirecting stdin, stdout, and stderr to a window

2004-12-16 Thread Michael Fuhr
Michael McGarry <[EMAIL PROTECTED]> writes: > How do I redirect stdin, stdout and stderr to a window? I am using Qt > for GUI. I don't know what specific mechanisms Qt provides, but the general solution is to write a class that implements I/O methods like read, readline, and

Redirecting stdin, stdout, and stderr to a window

2004-12-16 Thread Michael McGarry
Hi, How do I redirect stdin, stdout and stderr to a window? I am using Qt for GUI. Thanks, Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: SOAPpy/ZSI/Twisted SOAP over stdin/stdout?

2004-12-01 Thread Harry George
Harry George <[EMAIL PROTECTED]> writes: > Normally the SOAP Servers are designed to take control of a port and > run their own sockets via inheritance from SocktServer. > > But under inetd and xinetd, the port is controlled elsewhere and the > service just gets the st

Re: SOAPpy/ZSI/Twisted SOAP over stdin/stdout?

2004-11-30 Thread Jp Calderone
gt; service just gets the stdin/stdout. I need to configure (or tweak) one > of the SOAP servers to use that connection. > > Has anyone done this with any of the above named SOAP servers? > Recommmendations or hints if I try it myself? > Twisted can run any protoco

SOAPpy/ZSI/Twisted SOAP over stdin/stdout?

2004-11-30 Thread Harry George
Normally the SOAP Servers are designed to take control of a port and run their own sockets via inheritance from SocktServer. But under inetd and xinetd, the port is controlled elsewhere and the service just gets the stdin/stdout. I need to configure (or tweak) one of the SOAP servers to use that