char buffer

2005-03-10 Thread doodle4
Hello all, I need to create 6 buffers in python and keep track of it. I need to pass this buffer, say buffer 1 as an index to a test app. Has any one tried to do this. Any help with buffer management appreciated. Thanks, -Joe -- http://mail.python.org/mailman/listinfo/python-list

inbuilt function buffer()

2005-01-18 Thread km
Hi all, I which context is the inbuilt function buffer() used ? regards, KM -- http://mail.python.org/mailman/listinfo/python-list

Re: char buffer

2005-03-10 Thread Jaime Wyant
You'll probably want to be more specific. First thing that comes to mind is how do you plan on passing the `buffer' to your `test app'. I can think of a couple of ways off hand -- socket, stdin or maybe as a command line argument. If you're doing one of those, then I don&#

Re: char buffer

2005-03-10 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hello all, > > I need to create 6 buffers in python and keep track of it. > I need to pass this buffer, say buffer 1 as an index to a test app. Has > any one tried to do this. Any help with buffer management appreciated. Use the module array. -- R

Re: char buffer

2005-03-10 Thread doodle4
Each buffer need to hold 512 bytes of data. Thanks, -Joe -- http://mail.python.org/mailman/listinfo/python-list

references and buffer()

2006-10-08 Thread km
the address of a variable or a class ? read abt buffers as a refernce to a buffer object. actually i tried passing list and dict types to buffer function, but only with string type i could createa buffer reference, >>>y = 'GATCGTACC' >>>x = buffer(y, 0,8) >>> x &g

Re: inbuilt function buffer()

2005-01-18 Thread Aldo Cortesi
Thus spake km ([EMAIL PROTECTED]): > I which context is the inbuilt function buffer() used ? It's an efficiency measure. Say you have a string x. Taking a slice of the string - x[a:a+10] - will implicitly create a new string containing the specified data. Doing the same using buffer -

C type buffer copy

2005-03-22 Thread [EMAIL PROTECTED]
Hello, How does Python deal with C type memory buffers. Does Python return everything as an object irrespective of the data type? Here's what i am trying to achieve? testCode(unsigned char buf, unsigned long len) { unsigned long data=0x0; while (len--) { *buf++ = (unsigned ch

Filling up commands.getstatusoutput's buffer

2005-07-20 Thread travislspencer
Hey, Has anyone ever had commands.getstatusoutput's buffer fill up when executing a verbose command? If so, what workaround did you use? Did you just pipe the output into a file and then read it in or fork a processes or something else? -- Regards, Travis Spencer -- http://mail.pytho

Tkinter Canvas Pre-Buffer

2006-05-05 Thread [EMAIL PROTECTED]
Is there a way that using Tkinter I can pre-render the canvas then draw it on the screen? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: references and buffer()

2006-10-08 Thread Fredrik Lundh
km wrote: > > Hi all, > > was looking at references in python... > >>> a = 10 > >>> b = a > >>> id(a) > 153918788 > >>>id(b) > 153918788 > > where a and b point to the same id. now is this id an address ? no, it's the object identity, and all it tells you is that both names point to the s

Re: references and buffer()

2006-10-08 Thread Theerasak Photha
ar to the address of a variable or a class ? Exactly. Similar. Not the same, but similar. > read abt buffers as a refernce to a buffer object. > actually i tried passing list and dict types to buffer function, but only > with string type i could createa buffer reference, > >>

Re: references and buffer()

2006-10-08 Thread km
Hi all, in the CPython implementation, it's the address where the object isstored.  but that's an implementation detail.  ok so can i point a vairiable to an address location just as done in C language ? >>> y = 'ATGCATGC' >>> x = buffer(y) >>> del(

Re: references and buffer()

2006-10-08 Thread Carl Friedrich Bolz
Fredrik Lundh wrote: [snip] >> is id similar to the address of a variable or a class ? > > in the CPython implementation, it's the address where the object is > stored. but that's an implementation detail. Just as an obscure sidenote, in PyPy it is ~address some of the time. This is due to the fa

Re: references and buffer()

2006-10-08 Thread Fredrik Lundh
km wrote: > ok so can i point a vairiable to an address location just as done in C > language ? no. there are no C-style "variables" in Python; just objects and names bound to objects. Python variables are names, not memory locations. > >>> y = 'ATGCATGC&#

Re: references and buffer()

2006-10-08 Thread Theerasak Photha
> language ? > >>> y = 'ATGCATGC' > >>> x = buffer(y) > >>> del(y) > >>> x > > >>> print x > ATGCATGC > > now even when i delete y, why is that x still exists ? Say that you copy the contents of file

Re: references and buffer()

2006-10-08 Thread Steve Holden
km wrote: > Hi all, > > in the CPython implementation, it's the address where the object is > stored. but that's an implementation detail. > > > ok so can i point a vairiable to an address location just as done in C > language ? > >>>

Re: references and buffer()

2006-10-08 Thread km
Hi all,Say that you copy the contents of file foo into file bar and delete the original foo. Of course file bar still exists in this case. Notmuch of a difference; I haven't seen buffer objects yet (I am also newto Python), but the initialization for the buffer probably copieswhatever is

Re: references and buffer()

2006-10-08 Thread Theerasak Photha
On 10/8/06, km <[EMAIL PROTECTED]> wrote: > Hi all, > > > > Say that you copy the contents of file foo into file bar and delete > > the original foo. Of course file bar still exists in this case. Not > > much of a difference; I haven't seen buffer objects yet

Re: references and buffer()

2006-10-08 Thread km
Hi all, Congratulations, you understand both Hinduism and Python better than Ido now.  :) c.f.http://www.swami-krishnananda.org/brdup/brhad_III-09.html"Kati references, Yajnavalkya, iti?"  the answer lies in a single line as pronounced by sri adi sankaracharya - "aham bramhasmi sivoha sivoham "

Re: references and buffer()

2006-10-08 Thread Fredrik Lundh
km wrote: > why is that python doesnt implement direct memory addressing provided a > reference to an object exists ? because Python is a portable high-level language. if you want assembler, you shouldn't use Python. did you read the "reset your brain" article ? -- http://mail.python.org/

Managing a file buffer

2007-04-09 Thread David Johnson
Hi, I have an application that reads video from a socket and saves it to a file, which I then play using GStreamer. The major problem with this approach is that the file keeps getting bigger and bigger until the disk is full ;-) What I'd like to do is have a buffer, say 5MB in size, wh

socket buffer flush question

2006-07-05 Thread Kiran
responses from that hardware. When a timeout happens, for some reason extra data is stored inside the buffer, so when the timeout is over, that extra data (remember this data is instructions) is executed by the hardware, which I don't want. For timeout purposes, I want the socket to be nonblo

StringIO objects sharing a buffer

2005-02-15 Thread Thomas Lotze
izer class (which is ugly) or use two tokenizers on the same data buffer (which seems impossible to me using my preferred approach as a file-like object has exactly one file pointer). Is there a way for multiple StringIO objects to share a buffer of data, or do I have to give up on subclassing StringI

Re: C type buffer copy

2005-03-22 Thread Ivan Van Laningham
Hi All-- def testCode(data): buf=data[:] # and I hope you're going to do something with buf, # because otherwise this function's a bit of a waste;-) "[EMAIL PROTECTED]" wrote: > > Hello, > > How does Python deal with C type memory buffers. Does Python return > everything as an object i

Re: C type buffer copy

2005-03-22 Thread Neil Hodgson
Joe: > testCode(unsigned char buf, unsigned long len) > { > unsigned long data=0x0; > while (len--) > { > *buf++ = (unsigned char)data++ This C code will crash since buf is declared as an unsigned char, not an unsigned char*. Stop thinking in terms of translating low level

Re: C type buffer copy

2005-03-22 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > What's the best way to deal with this in python? I can't tell what you're trying to do. If you want an array containing the numbers 0,1,...,n-1, just say buf = range(n) -- http://mail.python.org/mailman/listinfo/python-list

Re: Filling up commands.getstatusoutput's buffer

2005-07-21 Thread Jeff Epler
On Wed, Jul 20, 2005 at 03:10:49PM -0700, [EMAIL PROTECTED] wrote: > Hey, > > Has anyone ever had commands.getstatusoutput's buffer fill up when > executing a verbose command? [...] How much output are you talking about? I tried outputs as large as about 260 megabytes wi

Re: Filling up commands.getstatusoutput's buffer

2005-07-21 Thread travislspencer
Jeff Epler wrote: > On Wed, Jul 20, 2005 at 03:10:49PM -0700, [EMAIL PROTECTED] wrote: > How much output are you talking about? Honestly, I don't know. I came on to a project were they said they were hitting up against some limit, and had a hack to work around it. I just wondered if others had hi

Re: Tkinter Canvas Pre-Buffer

2006-05-05 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Is there a way that using Tkinter I can pre-render the canvas then draw > it on the screen? not really; the canvas is double-buffered, but it regenerates (portions of) the buffer when necessary. if you want to draw in a separate buffer, and use that when updati

disabling the line buffer somehow

2006-03-05 Thread Can Burak Cilingir
Hi, I'm trying to proxy all keys typed by the user to a process spawned via popen2. Unfortunately, I figured out that I can't control really interactive applications such as mc or aptitude. All user input seems to be line buffered. http://pexpect.sourceforge.net/ has some words about the situatio

Re: Managing a file buffer

2007-04-09 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, David Johnson wrote: > What I'd like to do is have a buffer, say 5MB in size, which I can point > GStreamer at. So every time I write 60K to the tail of the file, I'd need to > remove 60K from the head of the file. You can't remove dat

Re: Managing a file buffer

2007-04-09 Thread Jeremy Sanders
David Johnson wrote: > I have an application that reads video from a socket and saves it to a > file, which I then play using GStreamer. The major problem with this > approach is that the file keeps getting bigger and bigger until the disk > is full ;-) > > What I'd like

Re: socket buffer flush question

2006-07-05 Thread Laszlo Nagy
ece of hardware, and data recieved is just > responses from that hardware. > When a timeout happens, for some reason extra data is stored inside > the buffer, so when the timeout is over, that extra data (remember this > data is instructions) is executed by the hardware, which I don

Re: socket buffer flush question

2006-07-05 Thread Jim Segrave
s sent to the device >is instructions for that piece of hardware, and data recieved is just >responses from that hardware. > When a timeout happens, for some reason extra data is stored inside >the buffer, so when the timeout is over, that extra data (remember this >data is instructi

Re: StringIO objects sharing a buffer

2005-02-15 Thread Mathias Waack
Thomas Lotze wrote: > Is there a way for multiple StringIO objects to share a buffer of > data, or do I have to give up on subclassing StringIO for this > purpose? (An alternative would be a tokenizer class that has a > StringIO instead of being one and do the file pointer housekeepin

help with c <-> python buffer transfer

2006-08-11 Thread tkirke
How does one transfer a buffer object from python -> c and back again (assuming the data gets modified)? I can't seem to get this or anything else to work, but am clueless as to what I'm doing wrong using namespace boost::python; static PyObject * proc_buf(PyObject *self, P

Adjusting the 1024 byte stdin buffer limit

2005-01-17 Thread brucoder
Are there runtime settings that can be used to adjust the default 1024 byte stdin buffer limit or a buildtime setting in pyconfig.h? I have a need to pump this up to permit input of a large data block via stdin. Tim Jones -- http://mail.python.org/mailman/listinfo/python-list

Re: help with c <-> python buffer transfer

2006-08-11 Thread John Machin
[EMAIL PROTECTED] wrote: > How does one transfer a buffer object from python -> c and back again > (assuming the data gets modified)? > I can't seem to get this or anything else to work, but am clueless as > to what I'm doing wrong > > > using namespace boo

Re: help with c <-> python buffer transfer

2006-08-11 Thread [EMAIL PROTECTED]
John Machin wrote: > [EMAIL PROTECTED] wrote: > > How does one transfer a buffer object from python -> c and back again > > (assuming the data gets modified)? > > I can't seem to get this or anything else to work, but am clueless as > > to what I'm doing

Re: help with c <-> python buffer transfer

2006-08-11 Thread John Machin
[EMAIL PROTECTED] wrote: > This is the part I need help with. I've also used PyBuffer_... > subroutines which gave similar problems. Thanks for all of your other > comments, but I was hoping someone could just tell me what was wrong > with the code without having to worry about all of the other

Getting text into the copy-paste buffer...

2006-09-05 Thread David Hirschfield
Strange request, but is there any way to get text into the linux copy-paste buffer from a python script ? I know the standard python libraries won't have that functionality (except as a side-effect, perhaps?), but is there a simple trick that would do it on linux? A command line to get

Re: Adjusting the 1024 byte stdin buffer limit

2005-01-17 Thread Andrew Koenig
"brucoder" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Are there runtime settings that can be used to adjust the default 1024 > byte stdin buffer limit or a buildtime setting in pyconfig.h? I have a > need to pump this up to permit input of a large da

Re: Adjusting the 1024 byte stdin buffer limit

2005-01-17 Thread brucoder
Currently, when sending a data stream that exceeds 1024 bytes via stdin, the stream blocks at the 1024th byte. This precludes completion of the submission of the data stream. Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Adjusting the 1024 byte stdin buffer limit

2005-01-17 Thread brucoder
Currently, when sending a data stream that exceeds 1024 bytes via stdin, the stream blocks at the 1024th byte. This precludes completion of the submission of the data stream. Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Adjusting the 1024 byte stdin buffer limit

2005-01-17 Thread Steve Holden
brucoder wrote: Currently, when sending a data stream that exceeds 1024 bytes via stdin, the stream blocks at the 1024th byte. This precludes completion of the submission of the data stream. But surely the blocking will only last as long as the consuming process leaves buffered input unread? reg

Re: Adjusting the 1024 byte stdin buffer limit

2005-01-17 Thread Fredrik Lundh
"brucoder" <[EMAIL PROTECTED]> wrote: > Currently, when sending a data stream that exceeds 1024 bytes via > stdin, the stream blocks at the 1024th byte. This precludes completion > of the submission of the data stream. you can pass in a buffer size when you open a

Re: Adjusting the 1024 byte stdin buffer limit

2005-01-17 Thread brucoder
g a data stream that exceeds 1024 bytes via > > stdin, the stream blocks at the 1024th byte. This precludes completion > > of the submission of the data stream. > > you can pass in a buffer size when you open a file: > > >>> help(open) > &g

How to increase buffer size of a file ?

2006-10-16 Thread durumdara
Hello ! How to increase buffer size of a file ? I want to use more buffer, but I don't want to replace every file object with my class. It have a contant in a module ? Thanks for your help: dd -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting text into the copy-paste buffer...

2006-09-05 Thread kdart
David Hirschfield wrote: > Strange request, but is there any way to get text into the linux > copy-paste buffer from a python script ? > > I know the standard python libraries won't have that functionality > (except as a side-effect, perhaps?), but is there a simple trick t

Re: Getting text into the copy-paste buffer...

2006-09-05 Thread David Hirschfield
ut is there any way to get text into the linux copy-paste buffer from a python script ? I know the standard python libraries won't have that functionality (except as a side-effect, perhaps?), but is there a simple trick that would do it on linux? A command line to get text into the buffer? U

Re: Getting text into the copy-paste buffer...

2006-09-05 Thread David Hirschfield
Ah, indeed it does...my distro didn't have it, but a quick download and compile and there it is. Thanks a bunch, -Dave Keith Dart wrote: On 9/5/06, David Hirschfield <[EMAIL PROTECTED]> wrote: This is good info...but I'm looking for the opposite direction: I want to place so

Re: How to increase buffer size of a file ?

2006-10-16 Thread Fredrik Lundh
durumdara wrote: > How to increase buffer size of a file ? > I want to use more buffer, but I don't want to replace every file object > with my class. the open() file factory takes the buffer size as an optional third argument. see the documentation for details. -- http://m

coercing to Unicode: need string or buffer, NoneType found

2006-07-27 Thread Jon Bowlas
Hi listers, I wrote this script in Zope some time ago and it worked for a while, but now I'm getting the following error: TypeError: coercing to Unicode: need string or buffer, NoneType found Here's my script: results = context.module_retriever().tuples() # call to ZSQLMethod

How do I save the contents of a text buffer

2007-02-17 Thread google
Hi, I'm using Python with pygtk and have this problem - I have read the contents of a file into the text buffer with this code, infile = open("mytextfile", "r") if infile: string = infile.read() infile.close() textbuff

Re: coercing to Unicode: need string or buffer, NoneType found

2006-07-27 Thread blue99
Jon Bowlas wrote: > Here's my script: > > results = context.module_retriever().tuples() # call to ZSQLMethod > converted = [] > for result in results: >result = list(result) # make a list from the tuple >for i in range(len(result)): > # for each element in the listified tuple, make de

Re: coercing to Unicode: need string or buffer, NoneType found

2006-07-27 Thread Jon Bowlas
Ahh, that did it, thanks very much. Jon - Original Message - From: <[EMAIL PROTECTED]> Newsgroups: comp.lang.python To: Sent: Thursday, July 27, 2006 11:19 AM Subject: Re: coercing to Unicode: need string or buffer, NoneType found > > Jon Bowlas wrote: > >

Re: coercing to Unicode: need string or buffer, NoneType found

2006-07-27 Thread Peter Otten
Jon Bowlas wrote: > I wrote this script in Zope some time ago and it worked for a while, but > now I'm getting the following error: > TypeError: coercing to Unicode: need string or buffer, NoneType found > > Here's my script: > > results = context.module

Re: coercing to Unicode: need string or buffer, NoneType found

2006-07-27 Thread Jon Bowlas
Ahh yes there are a couple of dodgy records that seem to have been added. many thanks. Jon - Original Message - From: "Peter Otten" <[EMAIL PROTECTED]> Newsgroups: comp.lang.python To: Sent: Thursday, July 27, 2006 11:22 AM Subject: Re: coercing to Unicode: need

Re: coercing to Unicode: need string or buffer, NoneType found

2006-07-27 Thread Jon Bowlas
It says line 8 in the traceback so I guess its result[i] = unicode(result[i], 'latin-1') Jon - Original Message - From: "Sybren Stuvel" <[EMAIL PROTECTED]> Newsgroups: comp.lang.python To: Sent: Thursday, July 27, 2006 11:06 AM Subject: Re: coercing to Unic

Re: How do I save the contents of a text buffer

2007-02-17 Thread Steven D'Aprano
On Sat, 17 Feb 2007 15:47:20 -0800, google wrote: > As a test, I tried to write the buffer back to a file with this code > but did not work, Oooh, guessing games! I love guessing games! Let me see... did it reboot your PC? Did Python crash? Did you get an exception? Maybe something abo

Re: How do I save the contents of a text buffer

2007-02-17 Thread Gabriel Genellina
En Sat, 17 Feb 2007 20:47:20 -0300, <[EMAIL PROTECTED]> escribió: > I'm using Python with pygtk and have this problem - I have read the > contents of a file into the text buffer with this code, > > infile = open("mytextfile", "r") >

Re: How do I save the contents of a text buffer

2007-02-17 Thread google
I just included file opening code just to show how i read the file into the text buffer - I have no issues with this as such. Problem is only with the writing of the text buffer back to a file. When I try to write the buffer to a file it gave the following, Traceback (most recent call last

Re: How do I save the contents of a text buffer

2007-02-17 Thread google
On Feb 18, 1:14 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sat, 17 Feb 2007 15:47:20 -0800, google wrote: > > As a test, I tried to write the buffer back to a file with this code > > but did not work, > > Oooh, guessing games! I love guessing games! Goo

Re: How do I save the contents of a text buffer

2007-02-17 Thread Steven D'Aprano
On Sat, 17 Feb 2007 17:19:06 -0800, google wrote: >> Did you get an exception? Maybe something about not being able to open >> the file for reading? Or perhaps disk full? > > File read ok for input, its the file write thats the problem Well, duh. I know that -- that's what your first email said.

Re: How do I save the contents of a text buffer

2007-02-17 Thread Steven D'Aprano
On Sat, 17 Feb 2007 17:10:50 -0800, google wrote: > I just included file opening code just to show how i read the file > into the text buffer - I have no issues with this as such. Problem is > only with the writing of the text buffer back to a file. When I try to > write the buffer

Re: How do I save the contents of a text buffer

2007-02-18 Thread google
where - thats why I asked for the groups help. Anyway, thanks to all that replied via emailed and in this group. On Feb 18, 7:34 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sat, 17 Feb 2007 17:10:50 -0800, google wrote: > > I just included file opening code just to show

ctypes: how to make a structure pointer to point to a buffer

2007-04-23 Thread 人言落日是天涯,望极天涯不见家
first, I'm try the POINTER to convesion the pointer type. but failed. class STUDENT(Structure): _fields_ = [('name', c_int), ('id', c_int), ('addition',c_ubyte)] buffer = c_byte * 1024 student_p = cast(buffer,

very strange bug coercing to Unicode: need string or buffer, int found

2006-06-21 Thread bussiere maillist
i truly didn't understand this error :Traceback (most recent call last):  File "D:\Programmation\FrancePaquet\FrancePaquet.py", line 77, in ?    cabtri = "zz" + chiffrescabtri + clefcTypeError: coercing to Unicode: need string or buffer, int found >>> if someone

TypeError: send() argument 1 must be string or read-only buffer, not int

2005-02-17 Thread Manish Gupta (BBS)
Hello invoking something like following - sock.send(100) generates the following error - TypeError: send() argument 1 must be string or read-only buffer, not int how can I work around this? I wish to write msg-length on a stream socket. thanks in advance. manish -- http

An editable buffer for the Python shell (similar to '\e' on sql prompts)

2005-08-05 Thread Steve
Hi, When working in the python command shell, I often end up writing more than 10+ lines of indented code before making a stupid typo. This got irritating enough for me to do something about it. So, here's an 'InteractiveConsole with an editable buffer'. http://aspn.activestate.co

replacing all 'rng's in a buffer with consecutive r[1], r[2]'s

2006-10-04 Thread m g william
I read a file into a buffer and subject it to re.sub() I can replace every occurrence of a pattern with a fixed string but when I try to replace each occurrence with a string that changes (by having an incrementing number in it, (ie 'repTxt[1]','repTxt[2]'etc), I note that the

Re: ctypes: how to make a structure pointer to point to a buffer

2007-04-23 Thread Diez B. Roggisch
人言落日是天涯,望极天涯不见家 wrote: > first, I'm try the POINTER to convesion the pointer type. but failed. > > class STUDENT(Structure): > _fields_ = [('name', c_int), > ('id', c_int), > ('addition',c_u

Re: ctypes: how to make a structure pointer to point to a buffer

2007-04-23 Thread 人言落日是天涯,望极天涯不见家
',  c_int), > >                     ('id',   c_int), > >                     ('addition',    c_ubyte)] > > > buffer = c_byte * 1024 > > student_p = cast(buffer, POINTER(STUDENT)) > > > The parameter of the POINTER must be ctypes type. > > How coul

Re: very strange bug coercing to Unicode: need string or buffer, int found

2006-06-21 Thread Max Erickson
> cabtri = "zz" + chiffrescabtri + clefc > TypeError: coercing to Unicode: need string or buffer, int found > > def calculclef(nombre): > if clef == 10: > clef = 0 > return clef > > clefb = calculclef(debutplage) >

Re: very strange bug coercing to Unicode: need string or buffer, int found

2006-06-21 Thread Fredrik Lundh
"bussiere maillist" wrote: >i truly didn't understand this error : > Traceback (most recent call last): > File "D:\Programmation\FrancePaquet\FrancePaquet.py", line 77, in ? >cabtri = "zz" + chiffrescabtri + clefc > TypeError: coercing to Un

Re: TypeError: send() argument 1 must be string or read-only buffer, not int

2005-02-17 Thread Fredrik Lundh
Manish Gupta wrote: > invoking something like following - > > sock.send(100) > > generates the following error - > > TypeError: send() argument 1 must be string or read-only buffer, not int > > > how can I work around this? I wish to write > msg-le

Re: TypeError: send() argument 1 must be string or read-only buffer, not int

2005-02-17 Thread [EMAIL PROTECTED]
if you want to send the value '1000' over a socket connection in a socket object do something like sock.send(str(1000)) if socket is a socket.socket object. -- http://mail.python.org/mailman/listinfo/python-list

Re: An editable buffer for the Python shell (similar to '\e' on sql prompts)

2005-08-05 Thread Robert Kern
Steve wrote: > Hi, > When working in the python command shell, I often end up writing more > than 10+ lines of indented code before making a stupid typo. This got > irritating enough for me to do something about it. So, here's an > 'InteractiveConsole with an ed

Re: replacing all 'rng's in a buffer with consecutive r[1], r[2]'s

2006-10-04 Thread Peter Otten
m g william wrote: > I read a file into a buffer and subject it to re.sub() > I can replace every occurrence of a pattern with a fixed string but when > I try to replace each occurrence with a string that changes (by having > an incrementing number in it, (ie 'repTxt[1]',&

Re: replacing all 'rng's in a buffer with consecutive r[1], r[2]'s

2006-10-04 Thread Paul McGuire
"m g william" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > #now replace all 'rng's with consecutive streams > #=== > def static_num(): >''' this is a generator function that avoids globals > yield differentiates fn as generator fn w

SECURITY ADVISORY [PSF-2006-001] Buffer overrun in repr() for UCS-4 encoded unicode strings

2006-10-12 Thread Anthony Baxter
SECURITY ADVISORY [PSF-2006-001] Buffer overrun in repr() for UCS-4 encoded unicode strings http://www.python.org/news/security/PSF-2006-001/ Advisory ID: PSF-2006-001 Issue Date: October 12, 2006 Product: Python Versions: 2.2, 2.3, 2.4 prior to 2.4.4, wide unicode

Re: SECURITY ADVISORY [PSF-2006-001] Buffer overrun in repr() for UCS-4 encoded unicode strings

2006-10-12 Thread Anthony Baxter
On Thursday 12 October 2006 17:31, Anthony Baxter wrote: >SECURITY ADVISORY [PSF-2006-001] > Buffer overrun in repr() for UCS-4 encoded unicode strings > > http://www.python.org/news/security/PSF-2006-001/ As a few people noted in email to me - the patch direc