Stephen Berman writes:
> On Sun, 04 Sep 2022 16:47:07 -0300 Meredith Montgomery
> wrote:
>
>> Meredith Montgomery writes:
>>
>>> Meredith Montgomery writes:
>>>
>>> [...]
>>>
>>>> I would also be interested in a command that
On Sun, 04 Sep 2022 16:47:07 -0300 Meredith Montgomery
wrote:
> Meredith Montgomery writes:
>
>> Meredith Montgomery writes:
>>
>> [...]
>>
>>> I would also be interested in a command that restarts the REPL afresh
>>> and reloads my buffer --- s
Meredith Montgomery writes:
> Meredith Montgomery writes:
>
> [...]
>
>> I would also be interested in a command that restarts the REPL afresh
>> and reloads my buffer --- sort of like keyboard's [F5] of the IDLE.
>
> A partial solution for this is the fol
Meredith Montgomery writes:
[...]
> I would also be interested in a command that restarts the REPL afresh
> and reloads my buffer --- sort of like keyboard's [F5] of the IDLE.
A partial solution for this is the following procedure.
--8<---cut here--
Paul Rubin writes:
> Meredith Montgomery writes:
>> Now in 27.1, things are different. I say C-c C-c and it tells me to
>> start the process with C-c C-p. I mean --- is that the most polite
>> thing to do? I feel like it's telling me --- go send this buffer
>&
a file.py and simply say C-c C-c and it would ask me if I wanted a
dedicated process, load a REPL load my entire buffer.
Now in 27.1, things are different. I say C-c C-c and it tells me to
start the process with C-c C-p. I mean --- is that the most polite
thing to do? I feel like it's te
> On 16 Jan 2020, at 16:12, nerdynels...@gmail.com wrote:
>
> Still hoping a Python developer can weigh in on this or point me where to
> get this issue addressed.
Does this tell you what you want to know?
https://docs.python.org/3/c-api/buffer.html
Barry
> --
> https://mail.python.org/ma
Still hoping a Python developer can weigh in on this or point me where to get
this issue addressed.
--
https://mail.python.org/mailman/listinfo/python-list
Hello,
I am trying to implement the buffer API for the JPype Python module.
Unfortunately the required type slots (Py_bf_getbuffer, Py_bf_releasebuffer)
are currently disabled due to the long since closed issue #10181. JPype is a
bridge module between Java and Python and as such it is
Gregory Ewing at 2018/4/15 PM 08:20 wrote:
Jach Fong wrote:
>>> pvoid = ctypes.c_void_p(ctypes.addressof(buf0))
>>> pvoid.contents
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'c_void_p' object has no attribute 'contents'
I think the 'contents' attribute only app
Jach Fong wrote:
>>> pvoid = ctypes.c_void_p(ctypes.addressof(buf0))
>>> pvoid.contents
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'c_void_p' object has no attribute 'contents'
I think the 'contents' attribute only applies to pointers that are
pointing at part o
On Sat, Apr 14, 2018 at 1:57 AM, Jach Fong wrote:
> eryk sun at 2018/4/14 PM 05:27 wrote:
>
>> The simple types c_void_p, c_char_p, and c_wchar_p are pointers.
>> However, since they subclass _SimpleCData instead of _Pointer, they
>> inherit the behavior of simple types.
>
> The ctypes document sa
eryk sun at 2018/4/14 PM 05:27 wrote:
On Fri, Apr 13, 2018 at 8:44 AM, Jach Fong wrote:
After studying the example you explained in your previous post replied to
Gregory Ewing, I had noticed that until today I was totally misunderstand
the meaning of the c_char_p. I always think it "is" a poin
On Fri, Apr 13, 2018 at 8:44 AM, Jach Fong wrote:
>
> After studying the example you explained in your previous post replied to
> Gregory Ewing, I had noticed that until today I was totally misunderstand
> the meaning of the c_char_p. I always think it "is" a pointer, but actually
> it's just a ct
ever, if you're working with
multi-megabyte data buffers,it's more efficient and safer to use an
array view (ctypes or NumPy) on the returned buffer.
After studying the example you explained in your previous post replied
to Gregory Ewing, I had noticed that until today I was totally
confused with
c_char_p, which is a char * pointer.) However, if you're working with
multi-megabyte data buffers,it's more efficient and safer to use an
array view (ctypes or NumPy) on the returned buffer.
In most cases, you should free the returned pointer after you're
finished p
Gregory Ewing at 2018/4/13 上午 07:25 wrote:
On Thu, Apr 12, 2018 at 2:16 PM, wrote:
This C function returns a buffer which I declared it as a
ctypes.c_char_p. The buffer has size 0x1 bytes long and the valid
data may vary from a few bytes to the whole size.
I think we need to see the
'm not sure where to go from here, though, because the
> ctypes documentation peters out before explaining exactly
> what can be done with a POINTER object.
Pointers can be indexed and sliced. You have to be careful, however,
since there's no bounds checking. Alternatively, without co
On 12Apr2018 16:11, Jach Fong wrote:
This is the first time I am using python-list to interact with
comp.lang.python forum (because there are so many spam when using
browser to view it) so forgive me if something goes wrong.
Python already treat the returned buffer as 'bytes'. The
On Thu, Apr 12, 2018 at 2:16 PM, wrote:
This C function returns a buffer which I declared it as a
ctypes.c_char_p. The buffer has size 0x1 bytes long and the valid
data may vary from a few bytes to the whole size.
I think we need to see the code you're using to call this
C fun
On Apr 12, 2018 09:39, jf...@ms4.hinet.net wrote:
>
> Chris Angelico於 2018年4月12日星期四 UTC+8下午1時31分35秒寫道:
> > On Thu, Apr 12, 2018 at 2:16 PM, wrote:
> > > This C function returns a buffer which I declared it as a
> > > ctypes.c_char_p. The buffer has size 0x
This is the first time I am using python-list to interact with
comp.lang.python forum (because there are so many spam when using
browser to view it) so forgive me if something goes wrong.
Python already treat the returned buffer as 'bytes'. The problem is
Python don't kn
Chris Angelico於 2018年4月12日星期四 UTC+8下午4時05分29秒寫道:
> On Thu, Apr 12, 2018 at 4:20 PM, wrote:
> > Chris Angelico於 2018年4月12日星期四 UTC+8下午1時31分35秒寫道:
> >> On Thu, Apr 12, 2018 at 2:16 PM, wrote:
> >> > This C function returns a buffer which I declared it as a
> >
On 11Apr2018 21:16, jf...@ms4.hinet.net wrote:
This C function returns a buffer which I declared it as a ctypes.c_char_p. The
buffer has size 0x1 bytes long and the valid data may vary from a few bytes
to the whole size.
Could you show us the function?
In every call I know how much the
On Thu, Apr 12, 2018 at 4:20 PM, wrote:
> Chris Angelico於 2018年4月12日星期四 UTC+8下午1時31分35秒寫道:
>> On Thu, Apr 12, 2018 at 2:16 PM, wrote:
>> > This C function returns a buffer which I declared it as a ctypes.c_char_p.
>> > The buffer has size 0x1 bytes long and the
Chris Angelico於 2018年4月12日星期四 UTC+8下午1時31分35秒寫道:
> On Thu, Apr 12, 2018 at 2:16 PM, wrote:
> > This C function returns a buffer which I declared it as a ctypes.c_char_p.
> > The buffer has size 0x1 bytes long and the valid data may vary from a
> > few bytes to the w
On Thu, Apr 12, 2018 at 2:16 PM, wrote:
> This C function returns a buffer which I declared it as a ctypes.c_char_p.
> The buffer has size 0x1 bytes long and the valid data may vary from a few
> bytes to the whole size.
>
> In every call I know how much the valid data
This C function returns a buffer which I declared it as a ctypes.c_char_p. The
buffer has size 0x1 bytes long and the valid data may vary from a few bytes
to the whole size.
In every call I know how much the valid data size is, but I suppose I can't use
slice to get it because there m
On Saturday, January 6, 2018 at 12:02:18 AM UTC, Rob Gaddi wrote:
> I'd like to create a native Python object that exposes the buffer
> protocol. Basically, something with a ._data member which is a
> bytearray that I can still readinto, make directly into a numpy array, etc.
&g
On 01/05/2018 04:27 PM, Ben Finney wrote:
Rob Gaddi writes:
I'd like to create a native Python object that exposes the buffer
protocol. Basically, something with a ._data member which is a
bytearray that I can still readinto, make directly into a numpy array,
etc.
The “etc.” seems p
Rob Gaddi writes:
> I'd like to create a native Python object that exposes the buffer
> protocol. Basically, something with a ._data member which is a
> bytearray that I can still readinto, make directly into a numpy array,
> etc.
The “etc.” seems pretty important, th
On Saturday, January 6, 2018 at 12:02:18 AM UTC, Rob Gaddi wrote:
> I'd like to create a native Python object that exposes the buffer
> protocol. Basically, something with a ._data member which is a
> bytearray that I can still readinto, make directly into a numpy array, etc.
&g
I'd like to create a native Python object that exposes the buffer
protocol. Basically, something with a ._data member which is a
bytearray that I can still readinto, make directly into a numpy array, etc.
I can do it by inheriting the entire thing from bytearray directly, but
that gives
Hi Team,
I have faced fallowing issue::
dev.sendline("*show version*") <<< its printing "show version output"
dev.sendline("*show module*") <<< its printing "shoe module output"
*Runing again*
dev.sendline("show veriosn") <<< its runing 2nd time again
dev.before *output is no
If I try to create a binary io.BufferedReader with a 1GB buffer, either with
open(foo, "rb", buffering=1024*1024*1024)
or with
BufferedReader(open(foo, "rb"), buffer_size=1024*1024*1024)
and then I read some data from a 4GB file, why does Python's memory usage not
go
On Tue, 12 Jan 2016 08:54 am, Saran Ahluwalia wrote:
> Hi Steven:
>
> Just as an update - apparently there were bytes in the Windows Command
> Terminal that were interrupting the process execution. I didn't realize
> this was happening until I dug around Windows' Q&A forum.
Thanks for letting us
alseFalseFalse',0001,0070,","1967-12-25
>> > 22:18:13.471000","2005-12-25 22:18:13.768000","2","70","0"
>>
>>
>>
>> and then a script containing the code you said you used:
>>
>> > import
ta.read().split('","')
> > x = ElementTree.XML(separated[3])
> > y = ElementTree.XML(separated[4])
> > print(dict(flatten_dict(x)))
> > print(dict(flatten_dict(y)))
>
>
> I get a completely different error to you, complete with tra
t; print(dict(flatten_dict(y)))
I get a completely different error to you, complete with traceback as
expected:
Traceback (most recent call last):
File "/tmp/testxml.py", line 9, in
print(dict(flatten_dict(x)))
NameError: name 'flatten_dict' is not defined
This s
Hi Steven:
That is the only message (*xml.etree.ElementTree.Element' does not support
the buffer interface"*). There is no traceback. My apologies for not
clarifying previously.
On Sun, Jan 10, 2016 at 10:19 AM, Steven D'Aprano
wrote:
> On Mon, 11 Jan 2016 02:04 am, kbtyo
On Mon, 11 Jan 2016 02:04 am, kbtyo wrote:
> Hello Everyone:
>
> I am curious to know why I receive the aforementioned message.
It is impossible to be sure from the information you have given us, since we
do not know which line of code caused the error.
Please copy and paste the ENTIRE traceb
Hello Everyone:
I am curious to know why I receive the aforementioned message. I am using
Python 3.4.3 and Windows 7. I am running the following script from Windows
Powershell:
Response = 's.csv'
with open(Response, 'rU', encoding='utf-8') as data:
separated = data.
On Thursday, April 2, 2015 at 8:03:53 PM UTC-4, Dennis Lee Bieber wrote:
> On Thu, 2 Apr 2015 05:46:57 -0700 (PDT), Saran A
> declaimed the following:
>
> >
> >@ChrisA - this is a smaller function that will take the most updated file.
> >My intention is the following:
> >
> >* Monitor a folder f
On Fri, Apr 3, 2015 at 11:03 AM, Dennis Lee Bieber
wrote:
>>o IF all the contents in the file have the same length (let's assume line
>>length)
>>
>>o THEN the file should be moved to a "success" folder and a text file written
>>indicating the total number of records/lines/words processed
>>
>>o
On Fri, Apr 3, 2015 at 12:28 AM, Saran A wrote:
> Does this modification to copyFile do the job of moving the file? I haven't
> written a test yet.
>
> Thanks for catching the indentation for the helper functions.
>
> def copyFile(src, dest):
>> > try:
>> > shutil.rename(src,
On Thursday, April 2, 2015 at 9:06:49 AM UTC-4, Chris Angelico wrote:
> On Thu, Apr 2, 2015 at 11:46 PM, Saran A wrote:
> > @ChrisA - this is a smaller function that will take the most updated file.
> > My intention is the following:
> >
> > * Monitor a folder for files that are dropped throughou
On Thu, Apr 2, 2015 at 11:46 PM, Saran A wrote:
> @ChrisA - this is a smaller function that will take the most updated file. My
> intention is the following:
>
> * Monitor a folder for files that are dropped throughout the day
>
> * When a file is dropped in the folder the program should scan the
a
> > string? I use Python 2.7.
> >
> > "Traceback (most recent call last):
> > before = dict([(f, None) for f in os.listdir(dirlist)])
> > TypeError: coercing to Unicode: need string or buffer, list found"
> >
> >
> > The sample code that I am tr
On Thursday, April 2, 2015 at 8:26:01 AM UTC-4, Chris Angelico wrote:
> On Thu, Apr 2, 2015 at 11:02 PM, Saran A wrote:
> > I understand this error message when I run this code. However, I am curious
> > to know what the most pythonic way is to convert the list to a string? I
> > use Python 2.7
(f, None) for f in os.listdir(dirlist)])
> TypeError: coercing to Unicode: need string or buffer, list found"
>
>
> The sample code that I am trying to run is:
>
> path = "/Users/Desktop/Projects/"
> dirlist = os.listdir(path)
At this point dirlist is a list of
On Thu, Apr 2, 2015 at 11:02 PM, Saran A wrote:
> I understand this error message when I run this code. However, I am curious
> to know what the most pythonic way is to convert the list to a string? I use
> Python 2.7.
>
I don't think you actually want to convert a list into a string, here.
Te
ng to Unicode: need string or buffer, list found"
The sample code that I am trying to run is:
path = "/Users/Desktop/Projects/"
dirlist = os.listdir(path)
before = dict([(f, None) for f in os.listdir(dirlist)])
def main(dirlist):
while True:
time.sleep(10) #time
ompt)
File "/usr/lib64/python3.4/site-packages/paramikoe.py", line 130, in
expect
buffer = buffer.replace('\r', '')
TypeError: 'str' does not support the buffer interface
#!/usr/bin/env python
# PyNet Class Exercises by Nick Ellson
_
hat part seems
> to be working. The issue is that the buffer into which the data is placed
> needs to be of certain alignment (8byte-aligned). Python does not seem to
> have a way that allows me to control that.
>
> Thanks,
> - Mitko
Did you try to set buffering parameter to 0 (unbu
On Tue, Mar 18, 2014 at 1:23 PM, Haralanov, Mitko
wrote:
> Hi all,
>
> I am using Python to read from a binary device file which requires that all
> read sizes are in 8byte multiples and the user's buffer is 8byte aligned.
>
> I am currently using a file object and
Haralanov, Mitko wrote:
The problem is not controlling the number of bytes read. That part seems to
be working. The issue is that the buffer into which the data is placed needs
to be of certain alignment (8byte-aligned). Python does not seem to have a
way that allows me to control that.
Hmmm
> For control at that level you'd be better off using
> direct system calls, i.e. os.open() and os.read(),
> then you can read exacty the number of bytes you want.
>
The problem is not controlling the number of bytes read. That part seems to be
working.
The issue is that the
Haralanov, Mitko wrote:
I am using Python to read from a binary device file which requires that all
read sizes are in 8byte multiples and the user's buffer is 8byte aligned.
Is there a way that I can get file.read() to use an 8byte aligned buffer?
For control at that level you'd be
Hi all,
I am using Python to read from a binary device file which requires that all
read sizes are in 8byte multiples and the user's buffer is 8byte aligned.
I am currently using a file object and the file.read() method. However, the
issue is that the file.read() method allocates the b
I am working on a python script that reads data by tailing a file and then puts
in a different file. The script works in a time bound manner and eventually
flushes out the data from the buffer when the ENDTIME is reached. However there
has been a mismatch in the source and target file in terms
Hi all,
I've been writing an application for capturing multiple HD network video
streams using a linux laptop with packet capture. For this I've used pcapy,
which wraps parts of libpcap. The problem is that with the default network
buffer size, I end up with corrupted video, so I c
Hi Guys!
I am plotting an object in mlab (isoSurface) and then I am adding 2
image_plane_widgets. Till now everything is ok but when I am changing the
opacity of the object to lower than 1 it is suddenly appearing behind the
planes? Why so? Is it dependant on the order of adding objects? But i
newline aren't the only triggers for
> output. Perhaps there's a maximum delay or a maximum cumulated size, and
> the output is flushed when such a limit is reached.
There's a maximum cumulated size; it's called the buffer size.
Output goes into a buffer, and when the b
On 2012-09-28, Chris Angelico wrote:
> On Fri, Sep 28, 2012 at 10:05 AM, Rikishi42 wrote:
>> The scripts in question only increase numbers. But should that not be the
>> case, solutions are simple enough. The numbers can be formatted to have a
>> fixed size. In the case of random line contents (a
On 2012-09-28, Dennis Lee Bieber wrote:
> On Thu, 27 Sep 2012 22:25:39 + (UTC), John Gordon
> declaimed the following in gmane.comp.python.general:
>
>>
>> Isn't terminal output line-buffered? I don't understand why there would
>> be an output delay. (Unless the "\r" is messing things up..
On Fri, Sep 28, 2012 at 10:05 AM, Rikishi42 wrote:
> The scripts in question only increase numbers. But should that not be the
> case, solutions are simple enough. The numbers can be formatted to have a
> fixed size. In the case of random line contents (a list of filesnames, say)
> it's enough to
On 2012-09-27, Chris Angelico wrote:
> On Fri, Sep 28, 2012 at 8:25 AM, John Gordon wrote:
>> Isn't terminal output line-buffered? I don't understand why there would
>> be an output delay. (Unless the "\r" is messing things up...)
>
> This is a classic progress-indication case, which does indee
On 2012-09-27, Chris Angelico wrote:
> On Fri, Sep 28, 2012 at 7:57 AM, Rikishi42 wrote:
>> I have these 2 scripts that are very heavy on the file i/o, consume a very
>> reasonable amount of cpu and output their counters at a - very - relaxed
>> pace to the console. The output is very simply done
On Fri, Sep 28, 2012 at 8:25 AM, John Gordon wrote:
> Isn't terminal output line-buffered? I don't understand why there would
> be an output delay. (Unless the "\r" is messing things up...)
This is a classic progress-indication case, which does indeed mess up
line-buffering. The carriage return
In Chris Angelico
writes:
> On Fri, Sep 28, 2012 at 7:57 AM, Rikishi42 wrote:
> > I have these 2 scripts that are very heavy on the file i/o, consume a very
> > reasonable amount of cpu and output their counters at a - very - relaxed
> > pace to the console. The output is very simply done usin
On Fri, Sep 28, 2012 at 7:57 AM, Rikishi42 wrote:
> I have these 2 scripts that are very heavy on the file i/o, consume a very
> reasonable amount of cpu and output their counters at a - very - relaxed
> pace to the console. The output is very simply done using something like:
>
>print "files:
I have these 2 scripts that are very heavy on the file i/o, consume a very
reasonable amount of cpu and output their counters at a - very - relaxed
pace to the console. The output is very simply done using something like:
print "files:", nFiles, "\r",
Yet alltough there is no real reason for
J gmail.com> writes:
>
> Now, the problem I have is that linux tends to buffer data writes to a
> device, and I want to work around that. When run in normal non-stress
> mode, the program is slow enough that the linux buffers flush and put
> the file on disk before the has
On 14Aug2012 22:55, J wrote:
| Now, the problem I have is that linux tends to buffer data writes to a
| device, and I want to work around that.
To what _specific_ purpose? Benchmarking? Ensuring the device can be
pulled? Ensuring another program can see the data? (The last should be
taken care
ence there as well).
Now, the problem I have is that linux tends to buffer data writes to a
device, and I want to work around that. When run in normal non-stress
mode, the program is slow enough that the linux buffers flush and put
the file on disk before the hash occurs. However, when run in st
Giacomo Alzetta, 11.08.2012 10:55:
> Il giorno sabato 11 agosto 2012 08:40:18 UTC+2, Stefan Behnel ha scritto:
>> Giacomo Alzetta, 11.08.2012 08:21:
>>
>>> I'd prefer to stick to Python and C, without having to put cython
>>> sources or cython-generated c modules (which I know are almost
>>> comple
Il giorno sabato 11 agosto 2012 08:40:18 UTC+2, Stefan Behnel ha scritto:
> Giacomo Alzetta, 11.08.2012 08:21:
>
> > I'd prefer to stick to Python and C, without having to put cython
>
> > sources or cython-generated c modules (which I know are almost
>
> > completely unreadable from a human poi
Giacomo Alzetta, 11.08.2012 08:21:
> I'd prefer to stick to Python and C, without having to put cython
> sources or cython-generated c modules (which I know are almost
> completely unreadable from a human point of view. Or at least the ones I
> saw).
And the cool thing is: you don't have to read t
Il giorno venerdì 10 agosto 2012 20:50:08 UTC+2, Stefan Behnel ha scritto:
> Giacomo Alzetta, 10.08.2012 10:20:
>
> > I'm trying to implement a c-extension which defines a new
> > class(ModPolynomial on the python side, ModPoly on the C-side).
>
> > At the moment I'm writing the in-place additio
Giacomo Alzetta, 10.08.2012 10:20:
> I'm trying to implement a c-extension which defines a new class(ModPolynomial
> on the python side, ModPoly on the C-side).
> At the moment I'm writing the in-place addition, but I get a *really* strange
> behaviour.
You should take a look at Cython. It makes
Il giorno venerdì 10 agosto 2012 14:21:50 UTC+2, Hans Mulder ha scritto:
> On 10/08/12 11:25:36, Giacomo Alzetta wrote:
>
> > Il giorno venerdì 10 agosto 2012 11:22:13 UTC+2, Hans Mulder ha scritto:
>
> [...]
>
> > Yes, you're right. I didn't thought the combined operator would do a
> > Py_DECR
On 10/08/12 11:25:36, Giacomo Alzetta wrote:
> Il giorno venerdì 10 agosto 2012 11:22:13 UTC+2, Hans Mulder ha scritto:
[...]
> Yes, you're right. I didn't thought the combined operator would do a Py_DECREF
> if the iadd operation was implemented, but it obviosuly makes sense.
The += operator cann
gt;
> > tmp = Tself->ob_item[0];
>
> > Tself->ob_item[0] = tmp2;
>
> > Py_DECREF(tmp);
>
> >
>
> > printf("%d\n", (int)ModPoly_Check(self));
>
> > return self;
>
> >
>
> > }
>
>
>
&g
(int)ModPoly_Check(self));
> return self;
>
> }
I have no experience writing extensions in C, but as I see it,
you're returning a new reference to self, so you'd need:
Py_INCREF(self);
If you don't, then a Py_DECREF inside the assignment operator
causes your polynomial to be garbage collected. Its heap slot
is later used for the unrelated buffer object you're seeing.
Hope this helps,
-- HansM
--
http://mail.python.org/mailman/listinfo/python-list
Py_DECREF(tmp);
printf("%d\n", (int)ModPoly_Check(self));
return self;
}
And here's an example usage:
>>> from algebra import polynomials
>>> pol = polynomials.ModPolynomial(3,17)
>>> pol += 5
1
>>> pol
>>>
Now, how come
Am 12.01.2012 06:23 schrieb Kushal Kumaran:
On Wed, Jan 4, 2012 at 8:05 PM, Mihai Badoiu wrote:
is there a way to pipe directly into a preallocated buffer?
(subprocessing.pipe.stdout)
Does io.StringIO fit your needs?
http://docs.python.org/py3k/library/io.html#io.StringIO
Probably not
On Wed, Jan 4, 2012 at 8:05 PM, Mihai Badoiu wrote:
> is there a way to pipe directly into a preallocated buffer?
> (subprocessing.pipe.stdout)
>
Does io.StringIO fit your needs?
http://docs.python.org/py3k/library/io.html#io.StringIO
--
regards,
kushal
--
http://mail.python.or
is there a way to pipe directly into a preallocated buffer?
(subprocessing.pipe.stdout)
thanks,
--mihai
--
http://mail.python.org/mailman/listinfo/python-list
How do you pass a Python buffer() value as an argument to a ctypes
function, which expects a c_void_p argument? I keep getting TypeError:
ctypes.ArgumentError: argument 2: : wrong type
--
http://mail.python.org/mailman/listinfo/python-list
Thanks all, adding the 'rb' and 'wb' solved that test case.
The reason I read the file "the hard way" is that I'm testing why I
cannot unzip a buffer passed in a file upload using django.
While not actually using a file, pointing out the need for the binary
Sells, Fred wrote:
> I'm tring to unzip a buffer that is uploaded to django/python. I can
> unzip the file in batch mode just fine, but when I get the buffer I get
> a "BadZipfile exception. I wrote this snippet to try to isolate the
> issue but I don't understand wha
On 07/26/2011 08:42 AM, Sells, Fred wrote:
I'm tring to unzip a buffer that is uploaded to django/python. I can
unzip the file in batch mode just fine, but when I get the buffer I get
a "BadZipfile exception. I wrote this snippet to try to isolate the
issue but I don't understa
I'm tring to unzip a buffer that is uploaded to django/python. I can
unzip the file in batch mode just fine, but when I get the buffer I get
a "BadZipfile exception. I wrote this snippet to try to isolate the
issue but I don't understand what's going on. I'm guessing th
('imageName', ctypes.c_wchar_p)]
> >...
> >does anyone know how to get this working?
>
> UNICODE_STRING is not just a pointer to wide characters. It is itself a
> structure:
>
> typedef struct _UNICODE_STRING {
> USHORT Length;
> USHOR
STRING is not just a pointer to wide characters. It is itself a
structure:
typedef struct _UNICODE_STRING {
USHORT Length;
USHORT MaximumLength;
PWSTR Buffer;
} UNICODE_STRING;
So, I think you want fields of ctypes.c_ulong, ctypes.c_ushort,
ctypes.c_ushort, and ctypes.c_wchar_p. M
Hey I've been trying to convert this to run through ctypes and i'm
having a hard time
typedef struct _SYSTEM_PROCESS_ID_INFORMATION
{
HANDLE ProcessId;
UNICODE_STRING ImageName;
} SYSTEM_PROCESS_IMAGE_NAME_INFORMATION,
*PSYSTEM_PROCESS_IMAGE_NAME_INFORMATION;
to
class SYSTEM_PROCESS_ID_I
On Wed, 2011-01-12 at 17:29 -0500, Scott McCarty wrote:
> Been digging ever since I posted this. I suspected that the response
> might be use a database.
I use shelve extensively; there are many use-cases where it makes sense.
And there are many where a database makes sense.
Basically, if I just
Scott McCarty wrote:
> Been digging ever since I posted this. I suspected that the response might
> be use a database. I am worried I am trying to reinvent the wheel. The
> problem is I don't want any dependencies and I also don't need persistence
> program runs.
I don't think sqlite3 counts as
Been digging ever since I posted this. I suspected that the response might
be use a database. I am worried I am trying to reinvent the wheel. The
problem is I don't want any dependencies and I also don't need persistence
program runs. I kind of wanted to keep the use of petit very similar to cat,
h
Scott McCarty wrote:
> Sorry to ask this question. I have search the list archives and googled,
> but I don't even know what words to find what I am looking for, I am just
> looking for a little kick in the right direction.
>
> I have a Python based log analysis program called petit (
> http://cr
1 - 100 of 625 matches
Mail list logo