Re: buffer objects (C-API)

2010-05-12 Thread Carl Banks
On May 12, 7:33 pm, moerchendiser2k3 wrote: > Hi at all, > > is it possible that a buffer object deallocates the memory when the > object is destroyed? I want to wrap the buffer object around some > memory. Or is there any chance that the buffer object copies the > memory so it will be responsible

Re: buffer interface problem

2010-01-07 Thread Chris Rebert
On Thu, Jan 7, 2010 at 4:47 AM, Andrew Gillanders wrote: > On 07/01/2010, at 7:13 PM, Chris Rebert wrote: >> On Thu, Jan 7, 2010 at 12:19 AM, Andrew Gillanders >> wrote: >>> >>> I have run into a problem running a Python script that is part of the >>> TerraGear suite for building scenery for Flig

Re: buffer interface problem

2010-01-07 Thread Andrew Gillanders
Thanks Chris. The atoi function was coming from the locale library (from locale import atoi). I changed it to int and now it works. The next hurdle is this: gzin = GzipFile(fname, 'rb') data = gzin.readline() #min_x,min_y = map(atoi,data.split()[:2]) min_x,min_y = map(int,data.

Re: buffer interface problem

2010-01-07 Thread Chris Rebert
On Thu, Jan 7, 2010 at 12:19 AM, Andrew Gillanders wrote: > I have run into a problem running a Python script that is part of the > TerraGear suite for building scenery for FlightGear. I am using Mac OS X > 10.4, running Python (version 3.0.1) in a Unix terminal. > > The purpose of the script is t

Re: Buffer pair for lexical analysis of raw binary data

2009-06-28 Thread Aahz
In article , Angus Rodgers wrote: > >By "recipes", do you mean > (also new to me)? Yup! You may also want to pick up the edited recipes in the Python Cookbook. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "

Re: Buffer pair for lexical analysis of raw binary data

2009-06-28 Thread Angus Rodgers
On 28 Jun 2009 08:00:23 -0700, a...@pythoncraft.com (Aahz) wrote: >In article <0qec45lho8lkng4n20sb1ad4eguat67...@4ax.com>, >Angus Rodgers wrote: >> >>Partly as an educational exercise, and partly for its practical >>benefit, I'm trying to pick up a programming project from where >>I left off in

Re: Buffer pair for lexical analysis of raw binary data

2009-06-28 Thread Aahz
In article <0qec45lho8lkng4n20sb1ad4eguat67...@4ax.com>, Angus Rodgers wrote: > >Partly as an educational exercise, and partly for its practical >benefit, I'm trying to pick up a programming project from where >I left off in 2001. It implemented in slightly generalised form >the "buffer pair" sc

Re: buffer

2008-11-03 Thread Tim Roberts
"Aditi Meher" <[EMAIL PROTECTED]> wrote: > >i am using it postgresql as back-end and HTML as front-end,i want to, >display 10-10 records at a time which is there in the database using, >python.so what is function for buffer that we can use it in python?i, >am able to connect my databse in python,bu

Re: Buffer objects

2008-09-01 Thread Terry Reedy
Tom Harris wrote: Greetings, I need a little help with buffer objects. Many Python objects export the buffer interface, or can be persuaded to create a buffer object with a buffer() call. ... It must be me but I have found the whole buffer thing difficult to understand from the docs, it appe

Re: Buffer size when receiving data through a socket?

2008-06-21 Thread John Salerno
Dennis Lee Bieber wrote: On Wed, 18 Jun 2008 09:56:29 -0400, "John Salerno" <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: Interesting point. I'm not sure if it works that way though. I *think* I tried sending an empty string from the server back to the client, and as expecte

Re: Buffer size when receiving data through a socket?

2008-06-18 Thread John Salerno
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The first if is checking for lack of interactive input -- and, as > coded, will never break out as ANY response to the > prompt will have a > newline attached. > > Try with raw_input("> ").strip() instead Well, I kn

Re: Buffer size when receiving data through a socket?

2008-06-18 Thread MRAB
On Jun 18, 7:52 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Tue, 17 Jun 2008 09:39:07 -0400, "John Salerno" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > > > while True: > > >    data = raw_input('> ') > > >    if not data: > > >        break > > >    client_s

Re: Buffer size when receiving data through a socket?

2008-06-18 Thread Gabriel Genellina
En Tue, 17 Jun 2008 14:32:44 -0300, John Salerno <[EMAIL PROTECTED]> escribió: > "Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Note that most of the time you want to use the sendall() method, because >> send() doesn't guarantee that all the data was actually

Re: Buffer size when receiving data through a socket?

2008-06-18 Thread Gabriel Genellina
En Tue, 17 Jun 2008 14:32:44 -0300, John Salerno <[EMAIL PROTECTED]> escribió: > "Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Note that most of the time you want to use the sendall() method, because >> send() doesn't guarantee that all the data was actually

Re: Buffer size when receiving data through a socket?

2008-06-17 Thread Gabriel Genellina
En Tue, 17 Jun 2008 10:34:24 -0300, John Salerno <[EMAIL PROTECTED]> escribió: > I was wondering about sendall(). The examples I've read in two different > books are consistent in their use of send() and don't even mention > sendall(), so I thought maybe it was for a more specialized situation. «

Re: Buffer size when receiving data through a socket?

2008-06-17 Thread John Salerno
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Note that most of the time you want to use the sendall() method, because > send() doesn't guarantee that all the data was actually sent. > If I use sendall(), am I

Re: Buffer size when receiving data through a socket?

2008-06-17 Thread John Salerno
"John Salerno" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > from socket import * > > host = 'localhost' > port = 51567 > address = (host, port) > buffer_size = 1024 > > client_socket = socket(AF_INET, SOCK_STREAM) > client_socket.connect(address) > > while True: >data = raw_in

Re: Buffer size when receiving data through a socket?

2008-06-17 Thread John Salerno
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Both programs say recv(buffer_size) - buffer_size is the maximum number of > bytes to be RECEIVED, that is, READ. recv will return at most buffer_size > bytes. It may return less than that, even if the other side s

Re: Buffer size when receiving data through a socket?

2008-06-16 Thread Gabriel Genellina
En Mon, 16 Jun 2008 21:21:35 -0300, John Salerno <[EMAIL PROTECTED]> escribió: > I wrote some pretty basic socket programming again, but I'm still confused > about what's happening with the buffer_size variable. Here are the server and > client programs: > > -- > > from socket import

Re: Buffer Overflow with Python 2.5 on Vista in import site

2008-03-30 Thread Fuzzyman
On Mar 30, 3:53 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sat, 29 Mar 2008 17:34:27 -0300, Fuzzyman <[EMAIL PROTECTED]> escribió: > > > A very odd error with Python 2.5 (both 2.5.1 and 2.5.2 from the > > official msi installers and running on Vista under Parallels on the > > Mac). > >

Re: Buffer Overflow with Python 2.5 on Vista in import site

2008-03-29 Thread Gabriel Genellina
En Sat, 29 Mar 2008 17:34:27 -0300, Fuzzyman <[EMAIL PROTECTED]> escribió: > A very odd error with Python 2.5 (both 2.5.1 and 2.5.2 from the > official msi installers and running on Vista under Parallels on the > Mac). It may be actually a Parallels issue - I've installed 2.5.1 on Vista (just o