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

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

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: 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

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: 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: 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: 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: 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: 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 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
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: 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: 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: 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: 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: 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: 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

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

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

<    1   2