Hello,
I'm studying compilers now on my university and I can't quite
understand one thing about the python interpreter. Why is its input a
binary file (pyc)? The LOAD_CONST opcode is 100 (dec) and STORE_FAST's
is 125 (dec). The translation of the following code:
foo.py:
x = 10
Could be t
Some one knows some python module for working with pdf files (extract text)?
or any kind of document such as PostScript, doc, etc?
thanks in advance
--
http://mail.python.org/mailman/listinfo/python-list
Basilisk96 wrote:
> >
> > Could the file like object still be encoded in MIME or something?
> >
>
> Yes it is. You don't need to seek(0).
> Try this:
>
> decoded = email.base64mime.decode(part.get_payload())
> fileObj.write(decoded)
Or better:
decoded = part.get_payload(decode=True)
fileObj.write
Basilisk96 wrote:
> >
> > Could the file like object still be encoded in MIME or something?
> >
>
> Yes it is. You don't need to seek(0).
> Try this:
>
> decoded = email.base64mime.decode(part.get_payload())
> fileObj.write(decoded)
>
>
> -Basilisk96
--
http://mail.python.org/mailman/listinfo/py
Jack wrote:
> Since the full installation of Python (from either the standard installer or
> ActiveState installer) is too big for my intended use, I'd like to build a
> custom distribution of Python for Windows platform, omitting some lib files,
> such as audio, tk, printing, testing units, etc.
dumbkiwi wrote:
> I'm working on a script to download and parse a web page, and it
> includes xml symbol notation, such as ' for the ' character. Does
> anyone know of a pre-existing python script/lib to convert the xml
> notation back to the actual symbol it represents?
Try the htmlentitydefs m
Lorenzo Thurman wrote:
> I'm using the Mimewriter and mimetools modules to create html messages.
> They work OK, except that when the messages are received, they always
> have the timestamp of 12/31/1969. I've looked through both packages and
> can't find anything that would allow me to manually s
>
> Could the file like object still be encoded in MIME or something?
>
Yes it is. You don't need to seek(0).
Try this:
decoded = email.base64mime.decode(part.get_payload())
fileObj.write(decoded)
-Basilisk96
--
http://mail.python.org/mailman/listinfo/python-list
John Nagle <[EMAIL PROTECTED]> writes:
> In a language with few declarations, it's probably best not to
> have too many different nested scopes. Python has a reasonable
> compromise in this area. Functions and classes have a scope, but
> "if" and "for" do not. That works adequately.
I think
Paul Rubin wrote:
> James Stroud <[EMAIL PROTECTED]> writes:
>
>>Probably, with good code, block scope would be overkill, except that I
>>would welcome list comprehensions to have a new scope:
>
>
> Block scope is a win because it gets rid of the uncertainty of whether
> the variable is used out
James Stroud <[EMAIL PROTECTED]> writes:
> Probably, with good code, block scope would be overkill, except that I
> would welcome list comprehensions to have a new scope:
Block scope is a win because it gets rid of the uncertainty of whether
the variable is used outside the block or not. The "goo
Neal Becker wrote:
> One thing I sometimes miss, which is common in some other languages (c++),
> is idea of block scope. It would be useful to have variables that did not
> outlive their block, primarily to avoid name clashes. This also leads to
> more readable code. I wonder if this has been d
On Apr 6, 6:20 pm, "John Machin" <[EMAIL PROTECTED]> wrote:
> On Apr 7, 6:48 am, [EMAIL PROTECTED] wrote:
>
> > Hi,
>
> > I am populating a mySQL database with data from the MS Access
> > database. I have successfully figured out how to extract the data from
> > Access, and I can insert the data s
On Apr 6, 8:13 am, James Stroud <[EMAIL PROTECTED]> wrote:
> Hello All,
>
> The built-in mac osx vecLib is segfaulting in some cases--A very fun
> fact to find out the hard way over two nights of work. I also spent an
> embarrassing amount of time figuring out just where. Although I'm in
> quite a
John Machin wrote:
> On Apr 7, 10:43 am, cyb <[EMAIL PROTECTED]> wrote:
>> For some reason I can ping these two sites fine, but when I try to go to
>> them I cannot get to them. Normal python.org homepage works just fine.
>> This is preventing me from getting setuptools and using pyOpenGL =(
>>
>>
On Apr 6, 6:09 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On 6 Apr 2007 04:02:52 -0700, "Christoph Krammer"
> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
>
> > Hello everybody,
>
> > I need to get the different frames from a GIF image in my python
> > script and want to
On Sat, 07 Apr 2007 00:19:20 +0200, hlubenow wrote:
> Hi,
>
> recently there was a thread about hiding the python-script from the user.
> The OP could use
>
> http://freshmeat.net/projects/pyobfuscate/
Wearing my developer hat, I can tell you that there's nothing I love more
than getting error
I'm using the Mimewriter and mimetools modules to create html messages.
They work OK, except that when the messages are received, they always
have the timestamp of 12/31/1969. I've looked through both packages and
can't find anything that would allow me to manually set it. Can someone
help me o
On Apr 7, 10:43 am, cyb <[EMAIL PROTECTED]> wrote:
> For some reason I can ping these two sites fine, but when I try to go to
> them I cannot get to them. Normal python.org homepage works just fine.
> This is preventing me from getting setuptools and using pyOpenGL =(
>
> I'm using COmcast in savan
On Apr 7, 9:25 am, "mkPyVS" <[EMAIL PROTECTED]> wrote:
> On Apr 5, 6:37 pm, "John Machin" <[EMAIL PROTECTED]> wrote:
>
> >>> help(list.index)
> > Help on method_descriptor:
>
> > index(...)
> > L.index(value, [start, [stop]]) -> integer -- return first index
> > of value
>
> > I look forward to
For some reason I can ping these two sites fine, but when I try to go to
them I cannot get to them. Normal python.org homepage works just fine.
This is preventing me from getting setuptools and using pyOpenGL =(
I'm using COmcast in savannah, GA
--
http://mail.python.org/mailman/listinfo/python
On Apr 5, 3:25 pm, "Henrik Lied" <[EMAIL PROTECTED]> wrote:
> > > I'd still love to get a working example of my problem using the
> > > Subprocess module. :-)
>
> > The same thing:
> > p = subprocess.Popen(["mencoder", "/users/...", "-ofps", ...])
>
> That example looked great at first, but on a c
[EMAIL PROTECTED] (Cameron Laird) wrote:
> I understand the sentiment; in principle, it shouldn't be hard
> to write a library which supports construction of SNMP agents
> in Python. I'm aware of no one who has done so publicly, though.
I've used pysnmp (http://pysnmp.sourceforge.net/) in a test
Since the full installation of Python (from either the standard installer or
ActiveState installer) is too big for my intended use, I'd like to build a
custom distribution of Python for Windows platform, omitting some lib files,
such as audio, tk, printing, testing units, etc.
Is there a way to
hlubenow wrote:
> ts-dev wrote:
>
>> On Apr 6, 3:19 pm, hlubenow <[EMAIL PROTECTED]> wrote:
>>> recently there was a thread about hiding the python-script from the
>>> user. The OP could use
>>
>> Interesting - thanks
>
> Well, testing it, it doesn't seem to work very well ...
>
> It seems, Py
Joel Andres Granados wrote:
> Hi list:
> Any comment greatly appreciated
Very clever.
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 5, 6:37 pm, "John Machin" <[EMAIL PROTECTED]> wrote:
>>> help(list.index)
> Help on method_descriptor:
>
> index(...)
> L.index(value, [start, [stop]]) -> integer -- return first index
> of value
>
> I look forward to your next version.
Great point! I was assuming the temp variable spac
On Apr 7, 6:48 am, [EMAIL PROTECTED] wrote:
> Hi,
>
> I am populating a mySQL database with data from the MS Access
> database. I have successfully figured out how to extract the data from
> Access, and I can insert the data successfully into mySQL with Python.
> My problem is that I keep hitting
Thank you!
Ian
--
http://mail.python.org/mailman/listinfo/python-list
IamIan wrote:
> I am confused as to why including 08 or 09 in a sequence (list or
> tuple) causes this error. All other numbers with a leading zero work.
All literals that start with "0" digit are considered as
octal numbers, i.e. only digits "0".."7" are allowed.
See octinteger lexical definitio
Hello all,
I am confused as to why including 08 or 09 in a sequence (list or
tuple) causes this error. All other numbers with a leading zero work.
[01,02,03,04,05,06,07] is fine
[01,02,03,04,05,06,07,10] is fine
[01,02,03,04,05,06,08] produces "SyntaxError: invalid token", as
does: [01,02,03,
ts-dev wrote:
> On Apr 6, 3:19 pm, hlubenow <[EMAIL PROTECTED]> wrote:
>> recently there was a thread about hiding the python-script from the user.
>> The OP could use
>
> Interesting - thanks
Well, testing it, it doesn't seem to work very well ...
It seems, Python-code is rather difficult to o
Hi,
I'm working on a script to download and parse a web page, and it
includes xml symbol notation, such as ' for the ' character. Does
anyone know of a pre-existing python script/lib to convert the xml
notation back to the actual symbol it represents?
--
http://mail.python.org/mailman/listinfo/
On Apr 6, 3:19 pm, hlubenow <[EMAIL PROTECTED]> wrote:
> recently there was a thread about hiding the python-script from the user.
> The OP could use
Interesting - thanks
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 7, 7:54 am, "garyp" <[EMAIL PROTECTED]> wrote:
> Python 2.3.4 (#1, Oct 26 2004, 16:42:40)
> [GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2
>
> >>> x = int("8000", 16)
> >>> x = x | 0x8000
>
> :1: FutureWarning: hex/oct constants > sys.maxint will return
> positive values in Pyt
Hi,
recently there was a thread about hiding the python-script from the user.
The OP could use
http://freshmeat.net/projects/pyobfuscate/
H.
--
http://mail.python.org/mailman/listinfo/python-list
Python 2.3.4 (#1, Oct 26 2004, 16:42:40)
[GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2
>>> x = int("8000", 16)
>>> x = x | 0x8000
:1: FutureWarning: hex/oct constants > sys.maxint will return
positive values in Python 2.4 and up
>>> print "%x" % ( x )
-8000
>>>
How do I get p
On Apr 6, 1:48 pm, [EMAIL PROTECTED] wrote:
(snipped)
> If I look in the MS Access database, I see the timestamp as "5/6/112".
> Obviously some user didn't enter the correct date and the programmer
> before me didn't give Access strict enough rules to block bad dates.
> How do I test for a malfor
On Apr 6, 1:33 pm, Michael Bentley <[EMAIL PROTECTED]> wrote:
> On Apr 6, 2007, at 2:32 PM, John Henry wrote:
>
> > I am back against the wall trying to migrate my multithreaded
> > application from Python 2.3 to 2.5. The part of the code that's
> > failing has to do with queues (2.3 queues and 2
On Apr 6, 1:06 pm, [EMAIL PROTECTED] wrote:
> We have just heard the news that the British Marines are ashamed to
> admit that they were tortured with Electric Wires to their Genitalia
> and two of them have had their penises bitten while a third ones
> testicles were eaten by an Iranian dog for th
"Gizmo" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| Hello
| I am a relative newcomer to Python, and I am studying it to understand
its
| design. It intrigues me.
| I recently studied Serialization of classes via the pickle/cPickle
library,
| and I have a question.
|
| Why is S
Hi,
I am populating a mySQL database with data from the MS Access
database. I have successfully figured out how to extract the data from
Access, and I can insert the data successfully into mySQL with Python.
My problem is that I keep hitting screwy records with what appears to
be a malformed dbiD
On Apr 6, 2007, at 2:32 PM, John Henry wrote:
> I am back against the wall trying to migrate my multithreaded
> application from Python 2.3 to 2.5. The part of the code that's
> failing has to do with queues (2.3 queues and 2.5 queues are not the
> same). Since WingIDE doesn't support multith
On Apr 6, 3:59 pm, Rob Wolfe <[EMAIL PROTECTED]> wrote:
> "ianaré" <[EMAIL PROTECTED]> writes:
> > hey all, I'm trying to get real time updates of batch file output.
>
> [...]
>
> > So I tried subprocess:
> > proc = subprocess.Popen('"C:/path/to/test.bat"', bufsize=0,
> > stdout=subprocess.PIPE)
We have just heard the news that the British Marines are ashamed to
admit that they were tortured with Electric Wires to their Genitalia
and two of them have had their penises bitten while a third ones
testicles were eaten by an Iranian dog for the meal. People are now
preferring the AbuGharib and
Beautiful Soup. http://www.crummy.com/software/BeautifulSoup/
Works, well...beautifully.
--
http://mail.python.org/mailman/listinfo/python-list
"ianaré" <[EMAIL PROTECTED]> writes:
> hey all, I'm trying to get real time updates of batch file output.
[...]
> So I tried subprocess:
> proc = subprocess.Popen('"C:/path/to/test.bat"', bufsize=0,
> stdout=subprocess.PIPE)
Instead of that:
> for line in proc.stdout:
> self.display.Writ
Gizmo wrote:
> Hello
> I am a relative newcomer to Python, and I am studying it to understand
> its design. It intrigues me.
> I recently studied Serialization of classes via the pickle/cPickle
> library, and I have a question.
>
> Why is Serialization handled by a separate library (ie, pickle).
Scott wrote:
[...]
>
> Now when suggesting books, keep in mind that, that while I'm new to Python
> (and programming in general) I'm able to grasp difficult concepts as long
> as I have enough detail as to why it is the way it is. For instance I'm, by
> experience and nature, a computer techn
On Apr 6, 3:22 pm, [EMAIL PROTECTED] wrote:
> On Apr 6, 1:44 pm, "ianaré" <[EMAIL PROTECTED]> wrote:
>
>
>
> > hey all, I'm trying to get real time updates of batch file output.
>
> > Here is my batch file:
> > @echo off
> > echo 1
> > @ping 127.0.0.1 -n 2 -w 1500 > nul
> > echo 2
> > @ping 127.0.0
I am back against the wall trying to migrate my multithreaded
application from Python 2.3 to 2.5. The part of the code that's
failing has to do with queues (2.3 queues and 2.5 queues are not the
same). Since WingIDE doesn't support multithread debugging (they've
been saying that one day they mi
On Apr 6, 1:44 pm, "ianaré" <[EMAIL PROTECTED]> wrote:
> hey all, I'm trying to get real time updates of batch file output.
>
> Here is my batch file:
> @echo off
> echo 1
> @ping 127.0.0.1 -n 2 -w 1500 > nul
> echo 2
> @ping 127.0.0.1 -n 2 -w 1500 > nul
> echo 3
>
> If I run it in cmd.exe it will
On Fri, 2007-04-06 at 11:33 -0700, 7stud wrote:
> On Apr 6, 7:56 am, "Paul Boddie" <[EMAIL PROTECTED]> wrote:
> > The problem with 7stud's quote from GvR is that it's out of date:
>
> I would argue that it shows the very guy who invented the language
> stated publicly there was no good reason for
Gizmo wrote:
> Hello
> I am a relative newcomer to Python, and I am studying it to understand
> its design. It intrigues me.
> I recently studied Serialization of classes via the pickle/cPickle
> library, and I have a question.
>
> Why is Serialization handled by a separate library (ie, pickle). I
Johny:
> Is it possible to find out a picture resolution by using PIL package
By Gian Mario Tagliaretti:
import PIL.Image
a = PIL.Image.open("foo.jpg")
a.info["dpi"]
(72, 72)
(It may raise an exception if that information isn't available)
I don't know if that can be used to read the DPI tag insi
Hi Everyone,
Recently I have been working on building a module for Python from C++
code, with SWIG, and towards the end of compiling the various sets of
code I'm getting an error.
[comp:~/swig_project] user% swig -c++ -python example.i
[comp:~/swig_project] user% g++ -c example.cpp
[comp:~/swig_p
C.L. wrote:
> James Stroud mbi.ucla.edu> writes:
>> C.L. wrote:
>>> I was looking for a function or method that would return the index to the
>>> first matching element in a list. ...
>>> ... __please don't be overly defensive__ ...
>> The amount of typing wasted to defend design decisions such as
Importing modules from zip files was proposed in PEP-273 [1]
Here is how the spec of PEP-273 begins:
'''
Currently, sys.path is a list of directory names as strings. If this
PEP is implemented, an item of sys.path can be a string naming a zip
file archive.
'''
My interpretation of the above is
hey all, I'm trying to get real time updates of batch file output.
Here is my batch file:
@echo off
echo 1
@ping 127.0.0.1 -n 2 -w 1500 > nul
echo 2
@ping 127.0.0.1 -n 2 -w 1500 > nul
echo 3
If I run it in cmd.exe it will print "1", wait 15sec, print "2", wait
15sec, print "3".
I tried doing it
On Apr 6, 7:56 am, "Paul Boddie" <[EMAIL PROTECTED]> wrote:
> The problem with 7stud's quote from GvR is that it's out of date:
I would argue that it shows the very guy who invented the language
stated publicly there was no good reason for tuples not to have an
index method---except for consistenc
On Apr 6, 1:16 pm, "Johny" <[EMAIL PROTECTED]> wrote:
> Is it possible to find out a picture resolution by using PIL package?
> Thanks for help
> L.
Dunno. But I found some ways to read metadata that should give you the
info in most cases:
http://snippets.dzone.com/posts/show/768
http://hachoir.
Is it possible to find out a picture resolution by using PIL package?
Thanks for help
L.
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 6, 1:05 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Is there a HTML parser (not xml) in python?
> I need a html parser which has the ability to handle mal-format html
> pages.
>
> Thank you.
Yeah...it's called Beautiful Soup.
http://www.crummy.com/software/BeautifulSoup/
Hi,
Is there a HTML parser (not xml) in python?
I need a html parser which has the ability to handle mal-format html
pages.
Thank you.
--
http://mail.python.org/mailman/listinfo/python-list
On Wednesday, Apr 4th 2007 at 18:04 -0700, quoth ts-dev:
=>Is it possible to prevent modification of a python file once its been
=>deployed? File permissions of the OS could be used..but that doesn't
=>seem very secure.
=>
=>The root of my question is verifying the integrity of the application
=>
On 6 avr, 11:52, [EMAIL PROTECTED] wrote:
> H!
>
> I was wondering how I can do something like this.
Use a template engine like :
Genshi
Django/Jinja
Cheetah
Kid template
For more engine look at
http://www.turbogears.org/cogbin/
And maybe what you are looking fore is a complete framework like
In article <[EMAIL PROTECTED]>,
Kevin Walzer <[EMAIL PROTECTED]> wrote:
> James Stroud wrote:
> >This begs the
> > question, is anyone truly an expert in Tkinter?
>
> Frederick Lundh is, if anyone is.
>
> http://www.pythonware.com/library/tkinter/introduction/index.htm (outdated)
> http://effb
"Neal Becker" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| One thing I sometimes miss, which is common in some other languages
(c++),
| is idea of block scope. It would be useful to have variables that did
not
| outlive their block, primarily to avoid name clashes. This also
gigs wrote:
> I have made drawing area and few butons.
> How can I make when i click my fill button that later when i click on
> oval oval gets filled with chousen color?
when later click on my oval that is drawn in to change oval color, or to fill
color in oval if click in oval with mouse
--
ht
On 4/6/07, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> For one liners, wouldn't
>
> ECHO the text line >the.file
>
> be more appropriate?
# dd if=/dev/tty of=/dev/hda1
--
Greg Donald
http://destiney.com/
--
http://mail.python.org/mailman/listinfo/python-list
Thomas Krüger ha scritto:
> Lorenzo Mainardi schrieb:
>> I bought a very small embedded card, with a MIPS processor, running
>> Linux. So, I would to use Python on that; I checked on python.org, but I
>> did'nt find any release for this architecture. Could you help me?
>
> How about compiling it f
Thanks to everyone that respondedI would never have figured that out.
7stud,
Your suggestion is being considered lol, as there are a lot more bits of
code in that book that I can't get running correctly.
Any other books you'd, or anyone for that matter, would recommend as
required reading?
See the video with your own EYEBALLS, that is if you have some courage
and shame left:
http://video.google.com/videoplay?docid=1822764959599063248
On Apr 6, 9:39 am, [EMAIL PROTECTED] wrote:
> On Apr 4, 6:31 pm, "Dr. V I Plankenstein" <[EMAIL PROTECTED]>
> wrote:
>
> > The anthrax attack was almo
On 4/6/07, Neal Becker <[EMAIL PROTECTED]> wrote:
> One thing I sometimes miss, which is common in some other languages (c++),
> is idea of block scope. It would be useful to have variables that did not
> outlive their block, primarily to avoid name clashes. This also leads to
> more readable cod
Hello
I am a relative newcomer to Python, and I am studying it to understand its
design. It intrigues me.
I recently studied Serialization of classes via the pickle/cPickle library,
and I have a question.
Why is Serialization handled by a separate library (ie, pickle). Is it
possible, by design,
On Apr 4, 6:31 pm, "Dr. V I Plankenstein" <[EMAIL PROTECTED]>
wrote:
> The anthrax attack was almost certainly carried out by someone who had
> access to Gov labs or other secure facilities, but the attack on WTC was an
> act of Islamic fanaticism, and you're an ass to suggest otherwise without
>
Neal Becker wrote:
> One thing I sometimes miss, which is common in some other languages (c++),
> is idea of block scope. It would be useful to have variables that did not
> outlive their block, primarily to avoid name clashes. This also leads to
> more readable code. I wonder if this has been d
Ed Jensen wrote:
> Steve Holden <[EMAIL PROTECTED]> wrote:
>> Ed Jensen wrote:
>>> Steve Holden <[EMAIL PROTECTED]> wrote:
Jython is an implementation of Python that compiles to Java bytecode,
but at the moment there's some version lag so it won't handle the mos
recent language enh
One thing I sometimes miss, which is common in some other languages (c++),
is idea of block scope. It would be useful to have variables that did not
outlive their block, primarily to avoid name clashes. This also leads to
more readable code. I wonder if this has been discussed?
--
http://mail.
Christoph Krammer wrote:
> Hello,
>
> I want to use the re module to split a data stream that consists of
> several blocks of data. I use the following code:
>
> iter = re.finditer('^(HEADER\n.*)+$', data)
>
> The data variable contains binary data that has the word HEADER in it
> in some places an
Peter Otten wrote:
> Lucas Malor wrote:
>
>> Hello all. I'm trying to do a little script. Simply I want to make a list
>> of all options with them default values. If the option is not specified in
>> the command line, the script must try to read it in a config.ini file. If
>> it's not present also
Steve Holden <[EMAIL PROTECTED]> wrote:
> Ed Jensen wrote:
>> Steve Holden <[EMAIL PROTECTED]> wrote:
>>> Jython is an implementation of Python that compiles to Java bytecode,
>>> but at the moment there's some version lag so it won't handle the mos
>>> recent language enhancements. Probably wort
In article <[EMAIL PROTECTED]>,
alain <[EMAIL PROTECTED]> wrote:
.
.
.
>I still find it strange that, in all these years of existence, no one
>felt the need for a SNMP agent in Python.
>
>Do Pythoneers only write test tools and
Steven D'Aprano wrote:
> On Wed, 04 Apr 2007 14:23:19 -0700, Chris Lasher wrote:
>
>> A friend of mine with a programming background in Java and Perl places
>> each class in its own separate file in . I informed him that keeping
>> all related classes together in a single file is more in the Pytho
On Apr 6, 7:13 am, James Stroud <[EMAIL PROTECTED]> wrote:
> Hello All,
>
> The built-in mac osx vecLib is segfaulting in some cases--A very fun
> fact to find out the hard way over two nights of work. I also spent an
> embarrassing amount of time figuring out just where. Although I'm in
> quite a
Thanks Steve,
Once again your advice solved the problem
Greg
Steve Holden wrote:
>
> Greg Corradini wrote:
>> Hello all,
>> I'm having trouble inserting an SQL selection into a new MS Access table.
>> I
>> get a parameter error on my insert statement when I try this (see below
>> for
>> code an
Hello,
I want to use the re module to split a data stream that consists of
several blocks of data. I use the following code:
iter = re.finditer('^(HEADER\n.*)+$', data)
The data variable contains binary data that has the word HEADER in it
in some places and binary data after this word till the n
On Apr 6, 12:51 am, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> erikcw wrote:
> > resp = p.retr(msg_num)
> > if resp[0].startswith('+OK'):
>
> You don't have to check this; errors are transformed into exceptions.
>
> > fileObj = StringIO.StringIO()
>
> cStri
On 4/4/07, Irmen de Jong <[EMAIL PROTECTED]> wrote:
> Maxim Veksler wrote:
>
> > I'm trying to bind a non-blocking socket, here is my code:
> > """
> > #!/usr/bin/env python
> >
> > import socket, select
> > from time import sleep
> >
> > s_nb1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM
Just got the solution...
After sending the image data with "si.write(image)", I have to close
the pipe to tell the program to convert the image with "si.close()".
Now everything works fine.
Christoph
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 04 Apr 2007 14:23:19 -0700, Chris Lasher wrote:
> A friend of mine with a programming background in Java and Perl places
> each class in its own separate file in . I informed him that keeping
> all related classes together in a single file is more in the Python
> idiom than one file per cl
On Apr 5, 10:57 am, [EMAIL PROTECTED] wrote:
> I'm making a program that consists of a main engine + plugins. Both
> are in Python. My question is, how do I go about importing arbitrary
> code and have it be able to use the engine's functions, classes, etc?
For a true plugin architecture, you do
C.L. wrote:
>
> That doesn't change the fact that this is unfriendly design. It's an ugly
> inconsistent chunk of a Python's past in which built-in types didn't behave
> like
> objects. It sticks out like a sore thumb, maybe just not very often.
When this topic last appeared on my radar, I ended
On Wed, 04 Apr 2007 15:56:34 +0200, Hendrik van Rooyen wrote:
> Now how would one do it and preserve the original order?
> This apparently simple problem is surprisingly FOS...
> But list comprehension to the rescue :
>
[x for x in duplist if duplist.count(x) == 1]
> ['haha', 5, 6]
>
>
Greg Corradini wrote:
> Hello all,
> I'm having trouble inserting an SQL selection into a new MS Access table. I
> get a parameter error on my insert statement when I try this (see below for
> code and error msg). I'm not sure if 'insert' or 'update' is the route I
> should be taking.
>
> CODE:
>
On Apr 6, 5:31 am, "7stud" <[EMAIL PROTECTED]> wrote:
> On Apr 5, 3:08 pm, "Steven W. Orr" <[EMAIL PROTECTED]> wrote:
>
> > I have a tuple that I got from struct.unpack. Now I want to pass the data
> > from the returned tuple to struct.pack
>
> > >>> fmt
>
> > 'l 10l 11i h 4h c 47c 0l'>>>struct.pac
Hello all,
I'm having trouble inserting an SQL selection into a new MS Access table. I
get a parameter error on my insert statement when I try this (see below for
code and error msg). I'm not sure if 'insert' or 'update' is the route I
should be taking.
CODE:
#Import Pythond Standard Library Modu
Hello All,
The built-in mac osx vecLib is segfaulting in some cases--A very fun
fact to find out the hard way over two nights of work. I also spent an
embarrassing amount of time figuring out just where. Although I'm in
quite a self-congratulatory mood right now, in the future, I feel like I
c
Christoph Krammer schrieb:
> for image in images:
> if (image[0:3] == 'GIF'):
> (si, so, se) = os.popen3('giftopnm -image=all', 'b')
> si.write(image)
> frame = so.readlines()
>
> But with this code the script just hangs. When I interrupt the script,
> I get the following er
boyeestudio wrote:
> I write a python program which can insert one record into the Sybase
> databae at a time using the function "fetchone()",But I find it runs slowly.
> So I want speed it up,But I don't know how to manipulate the database
> more efficiently! Thread or any other methods can do i
1 - 100 of 120 matches
Mail list logo