Understanding Python's interpreter

2007-04-06 Thread Rafael Almeida
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

text extractor

2007-04-06 Thread Yusnel Rojas García
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

Re: Extract zip file from email attachment

2007-04-06 Thread Gabriel Genellina
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

Re: Extract zip file from email attachment

2007-04-06 Thread Gabriel Genellina
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

Re: Custom Python Runtime

2007-04-06 Thread Gabriel Genellina
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.

Re: Convert xml symbol notation

2007-04-06 Thread Gabriel Genellina
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

Re: Mail not setting timestamp

2007-04-06 Thread Gabriel Genellina
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

Re: Extract zip file from email attachment

2007-04-06 Thread Basilisk96
> > 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

Re: block scope?

2007-04-06 Thread Paul Rubin
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

Re: block scope?

2007-04-06 Thread John Nagle
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

Re: block scope?

2007-04-06 Thread Paul Rubin
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

Re: block scope?

2007-04-06 Thread James Stroud
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

Re: Database Timestamp conversion error

2007-04-06 Thread kyosohma
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

Re: Getting Stack Trace on segfault

2007-04-06 Thread [EMAIL PROTECTED]
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

Re: Cant access http://cheeseshop.python.org/ or wiki

2007-04-06 Thread Steve Holden
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 =( >> >>

Re: Using os.popen3() to get binary data

2007-04-06 Thread MRAB
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

Re: Hide the python-script from user

2007-04-06 Thread Steven D'Aprano
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

Mail not setting timestamp

2007-04-06 Thread Lorenzo Thurman
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

Re: Cant access http://cheeseshop.python.org/ or wiki

2007-04-06 Thread John Machin
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

Re: Indentifying the LAST occurrence of an item in a list

2007-04-06 Thread John Machin
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

Cant access http://cheeseshop.python.org/ or wiki

2007-04-06 Thread cyb
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

Re: Problems with os.spawnv

2007-04-06 Thread Klaas
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

Re: SNMP agent

2007-04-06 Thread Roy Smith
[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

Custom Python Runtime

2007-04-06 Thread Jack
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

Re: Hide the python-script from user

2007-04-06 Thread hlubenow
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

Re: Comments in ConfigParser module

2007-04-06 Thread James Stroud
Joel Andres Granados wrote: > Hi list: > Any comment greatly appreciated Very clever. -- http://mail.python.org/mailman/listinfo/python-list

Re: Indentifying the LAST occurrence of an item in a list

2007-04-06 Thread mkPyVS
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

Re: Database Timestamp conversion error

2007-04-06 Thread John Machin
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

Re: 08 and 09 in sequence create "invalid token" error?!

2007-04-06 Thread IamIan
Thank you! Ian -- http://mail.python.org/mailman/listinfo/python-list

Re: 08 and 09 in sequence create "invalid token" error?!

2007-04-06 Thread Wojciech Muła
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

08 and 09 in sequence create "invalid token" error?!

2007-04-06 Thread IamIan
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,

Re: Hide the python-script from user

2007-04-06 Thread hlubenow
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

Convert xml symbol notation

2007-04-06 Thread dumbkiwi
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/

Re: Hide the python-script from user

2007-04-06 Thread ts-dev
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

Re: printing longs

2007-04-06 Thread John Machin
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

Hide the python-script from user

2007-04-06 Thread hlubenow
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

printing longs

2007-04-06 Thread garyp
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

Re: Database Timestamp conversion error

2007-04-06 Thread attn . steven . kuo
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

Re: Debugging multithreaded program using Eclipse/Pydev

2007-04-06 Thread John Henry
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

Re: British Marines Were tortured In Iran According to the Washington Conventions Re: Dr Jeff King, A Jewish MIT Engineer is the LEAD SPEAKER on 911 truth, no Islamics involved http://video.google.com

2007-04-06 Thread lemnitzer
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

Re: Basic Serialization - a design decision question

2007-04-06 Thread Terry Reedy
"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

Database Timestamp conversion error

2007-04-06 Thread kyosohma
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

Re: Debugging multithreaded program using Eclipse/Pydev

2007-04-06 Thread Michael Bentley
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

Re: real time updating of popen, bufsize=0 problems

2007-04-06 Thread ianaré
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)

British Marines Were tortured In Iran According to the Washington Conventions Re: Dr Jeff King, A Jewish MIT Engineer is the LEAD SPEAKER on 911 truth, no Islamics involved http://video.google.com/vid

2007-04-06 Thread stj911
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

Re: HTML Parser in python

2007-04-06 Thread eknowles
Beautiful Soup. http://www.crummy.com/software/BeautifulSoup/ Works, well...beautifully. -- http://mail.python.org/mailman/listinfo/python-list

Re: real time updating of popen, bufsize=0 problems

2007-04-06 Thread Rob Wolfe
"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

Re: Basic Serialization - a design decision question

2007-04-06 Thread Steve Holden
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).

Re: Newbie Question about sequence multiplication

2007-04-06 Thread Steve Holden
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

Re: real time updating of popen, bufsize=0 problems

2007-04-06 Thread ianaré
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

Debugging multithreaded program using Eclipse/Pydev

2007-04-06 Thread John Henry
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

Re: real time updating of popen, bufsize=0 problems

2007-04-06 Thread kyosohma
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

Re: tuples, index method, Python's design

2007-04-06 Thread Carsten Haese
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

Re: Basic Serialization - a design decision question

2007-04-06 Thread Robert Kern
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

Re: Picture resolution and PIL

2007-04-06 Thread bearophileHUGS
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

SWIG, Python, C++, and Coca-Cola

2007-04-06 Thread [EMAIL PROTECTED]
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

Re:

2007-04-06 Thread James Stroud
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

Re: zip files as nested modules?

2007-04-06 Thread Luciano Ramalho
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

real time updating of popen, bufsize=0 problems

2007-04-06 Thread ianaré
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

Re: tuples, index method, Python's design

2007-04-06 Thread 7stud
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

Re: Picture resolution and PIL

2007-04-06 Thread kyosohma
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.

Picture resolution and PIL

2007-04-06 Thread Johny
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

Re: HTML Parser in python

2007-04-06 Thread kyosohma
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/

HTML Parser in python

2007-04-06 Thread [EMAIL PROTECTED]
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

Re: Prevent Modification of Script?

2007-04-06 Thread Steven W. Orr
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 =>

Re: BaseHTTPRequestHandler reading .html with python code

2007-04-06 Thread aspineux
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

Re: Welch essential for learning Tkinter well?

2007-04-06 Thread Russell E. Owen
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

Re: block scope?

2007-04-06 Thread Terry Reedy
"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

Re: tkinter canvas

2007-04-06 Thread Gigs_
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

Re: Why NOT only one class per file?

2007-04-06 Thread Greg Donald
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

Re: Python on MIPS

2007-04-06 Thread Lorenzo Mainardi
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

Re: Newbie Question about sequence multiplication

2007-04-06 Thread Scott
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?

Dr Jeff King, A Jewish MIT Engineer is the LEAD SPEAKER on 911 truth, no Islamics involved http://video.google.com/videoplay?docid=1822764959599063248

2007-04-06 Thread thermate
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

Re: block scope?

2007-04-06 Thread Chris Mellon
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

Basic Serialization - a design decision question

2007-04-06 Thread Gizmo
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,

Re: Over a billion people believe Allah will provide 72 virgins to some Muslims.

2007-04-06 Thread thermate
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 >

Re: block scope?

2007-04-06 Thread Steve Holden
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

Re: Python and Java

2007-04-06 Thread Steve Holden
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

block scope?

2007-04-06 Thread Neal Becker
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.

Re: How to access multiple group matches?

2007-04-06 Thread Gary Herron
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

Re: [optparse] Problem with getting an option value

2007-04-06 Thread Mel Wilson
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

Re: Python and Java

2007-04-06 Thread Ed Jensen
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

Re: SNMP agent

2007-04-06 Thread Cameron Laird
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

Re: Why NOT only one class per file?

2007-04-06 Thread Bart Willems
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

Re: Getting Stack Trace on segfault

2007-04-06 Thread kyosohma
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

Re: Simple mx.ODBC prob seeks simple answer

2007-04-06 Thread Greg Corradini
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

How to access multiple group matches?

2007-04-06 Thread Christoph Krammer
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

Re: Extract zip file from email attachment

2007-04-06 Thread erikcw
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

Re: low level networking in python

2007-04-06 Thread Maxim Veksler
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

Re: Using os.popen3() to get binary data

2007-04-06 Thread Christoph Krammer
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

Re: Why NOT only one class per file?

2007-04-06 Thread Steven D'Aprano
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

Re: "Plugin" architecture - how to do?

2007-04-06 Thread Nate Finch
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

Re: tuples, index method, Python's design

2007-04-06 Thread Paul Boddie
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

Re: how to remove multiple occurrences of a string within a list?

2007-04-06 Thread Steven D'Aprano
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] > >

Re: Simple mx.ODBC prob seeks simple answer

2007-04-06 Thread Steve Holden
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: >

Re: elementary tuple question. (sorry)

2007-04-06 Thread mik3l3374
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

Simple mx.ODBC prob seeks simple answer

2007-04-06 Thread Greg Corradini
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

Getting Stack Trace on segfault

2007-04-06 Thread James Stroud
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

Re: Using os.popen3() to get binary data

2007-04-06 Thread Thomas Krüger
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

Re: About python Sybase module and the database manipulation!

2007-04-06 Thread Steve Holden
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   2   >