Re: Path / Listing and os.walk problem.

2010-08-26 Thread Peter Otten
Alban Nona wrote: > Hi > > So here is my problem: > > I have my render files that are into a directory like this: > > c:\log\renderfiles\HPO7_SEQ004_031_VDM_DIF_V001.0001.exr > c:\log\renderfiles\HPO7_SEQ004_031_VDM_DIF_V001.0002.exr > c:\log\renderfiles\HPO7_SEQ004_031_VDM_DIF_V001.0003.exr >

Re: Iterative vs. Recursive coding

2010-08-26 Thread Bruno Desthuilliers
BartC a écrit : "Steven D'Aprano" wrote in message news:4c6f8edd$0$28653$c3e8...@news.astraweb.com... On Fri, 20 Aug 2010 17:23:23 +0200, Bruno Desthuilliers wrote: I onced worked in a shop (Win32 desktop / accouting applications mainly) where I was the only guy that could actually understan

Python Editor or IDE ActiveX control

2010-08-26 Thread Sathish S
Hi Ppl, Is there any python IDE or editor that has an ActiveX control which could be embed in other Windows applications. I'm basically looking to write a application that can show the indentations of python, change the color of keywords etc on a application, which will save this python script and

Webcam support

2010-08-26 Thread Navkirat Singh
Hi Guys, I am programming a web centric app in python for customer, which needs to click a snap of the customer and forward the pic to the server via POST. I am not very familiar with how I can achieve this. Any direction would be much appreciated. Regards, Nav -- http://mail.python.org/mailm

Re: Webcam support

2010-08-26 Thread Chris Rebert
On Thu, Aug 26, 2010 at 1:35 AM, Navkirat Singh wrote: > Hi Guys, > > I am programming a web centric app in python for customer, which needs to > click a snap of the customer and forward the pic to the server via POST. I am > not very familiar with how I can achieve this. Any direction would be

Re: seach for pattern based on string

2010-08-26 Thread richie05 bal
On Aug 24, 11:05 pm, Alex Willmer wrote: > On Aug 24, 5:33 pm, richie05 bal wrote: > > > i am starting to learn python and I am stuck with query I want to > > generate with python > > File looks something like this > > TRACE: AddNewBookD {bookId 20, noofBooks 6576, authorId 41, > > publishingComp

pil and reportlab: image compression

2010-08-26 Thread steph
Hi group, I've written a small application that puts images into a pdf document. It works ok, but my problem is that the pdf-files become quite huge, bigger than the original jpegs. The problem seems to arise because I use PIL to resize the pictures - and the images seem to get uncompressed in the

bug? pkgutil.walk_packages returns packages that result in an ImportError

2010-08-26 Thread Chris Withers
Hi All, From the docs of pkgutils.walk_packages: """ 'onerror' is a function which gets called with one argument (the name of the package which was being imported) if any exception occurs while trying to import a package. If no onerror function is supplied, ImportErrors are caugh

Re: matplotlib pyplot contourf with 1-D array (vector)

2010-08-26 Thread becky_s
On Aug 26, 1:52 am, Dennis Lee Bieber wrote: > On Wed, 25 Aug 2010 14:57:33 -0700 (PDT), becky_s > declaimed the following in gmane.comp.python.general: > > > > > px,py = p(mesolon, mesolat) > >         For my elucidation, what does that      p(x,y)  actually do? > Especially > as you appear to

Re: bug? pkgutil.walk_packages returns packages that result in an ImportError

2010-08-26 Thread Peter Otten
Chris Withers wrote: > From the docs of pkgutils.walk_packages: > """ > 'onerror' is a function which gets called with one argument (the > name of the package which was being imported) if any exception > occurs while trying to import a package. If no onerror function is > sup

Re: Iterative vs. Recursive coding

2010-08-26 Thread John Bokma
Bruno Desthuilliers writes: > BartC a écrit : >> "Steven D'Aprano" wrote in >> message news:4c6f8edd$0$28653$c3e8...@news.astraweb.com... >>> On Fri, 20 Aug 2010 17:23:23 +0200, Bruno Desthuilliers wrote: >> I onced worked in a shop (Win32 desktop / accouting applications mainly) where

Re: Path / Listing and os.walk problem.

2010-08-26 Thread Alban Nona
Hey ! Thank you guys ! It help me a lot ! @Dennis (Gomes): Thanks ! I tried it it worked well but list me the whole files :P (and finally crashed python...lol) I looked at the Peter method and, Im really dumb to didnt tough about defining a pattern like *_v001.0001.exr * like this, it sort me onl

Re: Webcam support

2010-08-26 Thread garabik-news-2005-05
Navkirat Singh wrote: > Hi Guys, > > I am programming a web centric app in python for customer, which needs > to click a snap of the customer and forward the pic to the server via > POST. I am not very familiar with how I can achieve this. Any > direction would be much appreciated. > For somethi

Writing byte stream as jpeg format to disk

2010-08-26 Thread Navkirat Singh
Hey guys, I am programming a webserver, I receive a jpeg file with the POST method.The file (.jpeg) is encoded in bytes, I parse the bytes by decoding them to a string. I wanted to know how i could write the file (now a string) as a jpeg image on disk. When I try to encode the same string to a

Re: Webcam support

2010-08-26 Thread Navkirat Singh
On 26-Aug-2010, at 9:49 PM, garabik-news-2005...@kassiopeia.juls.savba.sk wrote: > Navkirat Singh wrote: >> Hi Guys, >> >> I am programming a web centric app in python for customer, which needs >> to click a snap of the customer and forward the pic to the server via >> POST. I am not very famil

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread John Bokma
Navkirat Singh writes: > Hey guys, > > I am programming a webserver, I receive a jpeg file with the POST > method.The file (.jpeg) is encoded in bytes, I parse the bytes by > decoding them to a string. Why? -- John Bokma j3b Blog:

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Navkirat Singh
On 26-Aug-2010, at 11:01 PM, John Bokma wrote: > Navkirat Singh writes: > >> Hey guys, >> >> I am programming a webserver, I receive a jpeg file with the POST >> method.The file (.jpeg) is encoded in bytes, I parse the bytes by >> decoding them to a string. > > Why? > > -- > John Bokma

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Grant Edwards
On 2010-08-26, Navkirat Singh wrote: > > On 26-Aug-2010, at 11:01 PM, John Bokma wrote: > >> Navkirat Singh writes: >> >>> Hey guys, >>> >>> I am programming a webserver, I receive a jpeg file with the POST >>> method.The file (.jpeg) is encoded in bytes, I parse the bytes by >>> decoding them

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Stefan Schwarzer
Hi Navkirat, On 2010-08-26 19:22, Navkirat Singh wrote: > I am programming a webserver, I receive a jpeg file with > the POST method.The file (.jpeg) is encoded in bytes, I > parse the bytes by decoding them to a string. I wanted to > know how i could write the file (now a string) as a jpeg > imag

Re: Path / Listing and os.walk problem.

2010-08-26 Thread Alban Nona
So I found a way to do it, maybe some people could be interested: listNames = [] for n in names: listNames.append('_'.join(n.split('_')[:-1])) #It will cut the last part of the file name convention listNames = list(set(listNames)) #we Delete duplicates from the list, like this we only have wh

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Navkirat Singh
I am sorry, maybe I was not elaborate in what I was having trouble with. I am using a jpegcam library, which on my web page captures a webcam image and sends it to the server via the POST method. On the Server side (python 3), I receive this image as a part of header content in bytes (I know tha

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread MRAB
On 26/08/2010 19:57, Navkirat Singh wrote: I am sorry, maybe I was not elaborate in what I was having trouble with. I am using a jpegcam library, which on my web page captures a webcam image and sends it to the server via the POST method. On the Server side (python 3), I receive this image as a p

Re: Overload print

2010-08-26 Thread John Roth
On Aug 25, 3:42 pm, Alexander Kapps wrote: > Ross Williamson wrote: > > Hi All > > > Is there anyway in a class to overload the print function? > > In Python <= 2.x "print" is a statement and thus can't be > "overloaded". That's exactly the reason, why Python 3 has turned > "print" into a function

Re: CRIMINAL YanQui MARINES Cesar Laurean Regularly RAPE GIRLS Maria Lauterbach and KILL THEM - CIA/Mossad/Jew did 911 - Wikileaks for ever CRIMES of YANQUI Bustards

2010-08-26 Thread Simon Brooke
On Wed, 25 Aug 2010 07:31:03 -0700, Standish P wrote: > ... so you want to render this in TeX ... ? It was very thoughtful of you to repost the whole spammer text for the benefit of those of us who have the spammer killfiled, and consequently would not otherwise have been able to read it. --

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Robert Kern
On 8/26/10 1:25 PM, Navkirat Singh wrote: On 26-Aug-2010, at 11:01 PM, John Bokma wrote: Navkirat Singh writes: Hey guys, I am programming a webserver, I receive a jpeg file with the POST method.The file (.jpeg) is encoded in bytes, I parse the bytes by decoding them to a string. Why? -

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Navkirat Singh
On 27-Aug-2010, at 1:10 AM, Robert Kern wrote: > On 8/26/10 1:25 PM, Navkirat Singh wrote: >> >> On 26-Aug-2010, at 11:01 PM, John Bokma wrote: >> >>> Navkirat Singh writes: >>> Hey guys, I am programming a webserver, I receive a jpeg file with the POST method.The file (.

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Navkirat Singh
On 27-Aug-2010, at 12:45 AM, MRAB wrote: > On 26/08/2010 19:57, Navkirat Singh wrote: >> I am sorry, maybe I was not elaborate in what I was having trouble >> with. I am using a jpegcam library, which on my web page captures a >> webcam image and sends it to the server via the POST method. On the

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Dave Angel
Navkirat Singh wrote: Hey guys, I am programming a webserver, I receive a jpeg file with the POST method.The file (.jpeg) is encoded in bytes, I parse the bytes by decoding them to a string. I wanted to know how i could write the file (now a string) as a jpeg image on disk. When I try to enco

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Navkirat Singh
On 27-Aug-2010, at 1:32 AM, Dave Angel wrote: > Navkirat Singh wrote: >> Hey guys, >> >> I am programming a webserver, I receive a jpeg file with the POST method.The >> file (.jpeg) is encoded in bytes, I parse the bytes by decoding them to a >> string. I wanted to know how i could write the f

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Navkirat Singh
On 27-Aug-2010, at 1:32 AM, Dave Angel wrote: > Navkirat Singh wrote: >> Hey guys, >> >> I am programming a webserver, I receive a jpeg file with the POST method.The >> file (.jpeg) is encoded in bytes, I parse the bytes by decoding them to a >> string. I wanted to know how i could write the f

Re: matplotlib pyplot contourf with 1-D array (vector)

2010-08-26 Thread becky_s
I was able to figure this out on my own. First, to eliminate the masked arrays, I used a combination of the where and compress functions to remove any missing data from my 1-D arrays. Then, I used the griddata function as described above. This did the trick. -- http://mail.python.org/mailman/li

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread MRAB
On 26/08/2010 21:14, Navkirat Singh wrote: On 27-Aug-2010, at 1:32 AM, Dave Angel wrote: Navkirat Singh wrote: Hey guys, I am programming a webserver, I receive a jpeg file with the POST method.The file (.jpeg) is encoded in bytes, I parse the bytes by decoding them to a string. I wanted to

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Dave Angel
Navkirat Singh wrote: O I am using Python3 and I receive a byte stream with a jpeg attached sent by the web browser over a socket, which looks like this: b': image/jpeg\r\nAccept: text/*\r\nReferer: http://127.0.0.1:8001/\r\nAccept-Language: en-us\r\nAccept-Encoding: gzip, deflate\r\nContent

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-26 Thread Brad
On Aug 25, 4:05 am, Alex McDonald wrote: > Your example of writing code with > memory leaks *and not caring because it's a waste of your time* makes > me think that you've never been a programmer of any sort. "Windows applications are immune from memory leaks since programmers can count on regula

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Navkirat Singh
On 27-Aug-2010, at 1:57 AM, MRAB wrote: > On 26/08/2010 21:14, Navkirat Singh wrote: >> >> On 27-Aug-2010, at 1:32 AM, Dave Angel wrote: >> >>> Navkirat Singh wrote: Hey guys, I am programming a webserver, I receive a jpeg file with the POST method.The file (.jpeg) is encod

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-26 Thread Navkirat Singh
On 27-Aug-2010, at 2:14 AM, Brad wrote: > On Aug 25, 4:05 am, Alex McDonald wrote: >> Your example of writing code with >> memory leaks *and not caring because it's a waste of your time* makes >> me think that you've never been a programmer of any sort. > > "Windows applications are immune from

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread John Bokma
Navkirat Singh writes: >>> I am using Python3 and I receive a byte stream with a jpeg attached sent >>> by the web browser over a socket, which looks like this: >>> >>> b': image/jpeg\r\nAccept: text/*\r\nReferer: >>> http://127.0.0.1:8001/\r\nAccept-Language: en-us\r\nAccept-Encoding: >>> gzip,

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Robert Kern
On 8/26/10 3:47 PM, Navkirat Singh wrote: On 27-Aug-2010, at 1:57 AM, MRAB wrote: On 26/08/2010 21:14, Navkirat Singh wrote: On 27-Aug-2010, at 1:32 AM, Dave Angel wrote: Navkirat Singh wrote: Hey guys, I am programming a webserver, I receive a jpeg file with the POST method.The file (.j

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Navkirat Singh
On 27-Aug-2010, at 1:57 AM, MRAB wrote: > On 26/08/2010 21:14, Navkirat Singh wrote: >> >> On 27-Aug-2010, at 1:32 AM, Dave Angel wrote: >> >>> Navkirat Singh wrote: Hey guys, I am programming a webserver, I receive a jpeg file with the POST method.The file (.jpeg) is encod

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread MRAB
On 26/08/2010 21:47, Navkirat Singh wrote: On 27-Aug-2010, at 1:57 AM, MRAB wrote: On 26/08/2010 21:14, Navkirat Singh wrote: On 27-Aug-2010, at 1:32 AM, Dave Angel wrote: Navkirat Singh wrote: Hey guys, I am programming a webserver, I receive a jpeg file with the POST method.The file (.

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Navkirat Singh
On 27-Aug-2010, at 2:40 AM, Robert Kern wrote: > On 8/26/10 3:47 PM, Navkirat Singh wrote: >> >> On 27-Aug-2010, at 1:57 AM, MRAB wrote: >> >>> On 26/08/2010 21:14, Navkirat Singh wrote: On 27-Aug-2010, at 1:32 AM, Dave Angel wrote: > Navkirat Singh wrote: >> Hey guys,

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Navkirat Singh
On 27-Aug-2010, at 2:48 AM, MRAB wrote: > On 26/08/2010 21:47, Navkirat Singh wrote: >> >> On 27-Aug-2010, at 1:57 AM, MRAB wrote: >> >>> On 26/08/2010 21:14, Navkirat Singh wrote: On 27-Aug-2010, at 1:32 AM, Dave Angel wrote: > Navkirat Singh wrote: >> Hey guys, >>

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Robert Kern
On 8/26/10 4:17 PM, Navkirat Singh wrote: Here is what I needed to do: a) Separate image content from header content of the byte stream received from the web browser. b) Save the image content to disk for further use. Here is what I did. Following is just a snippet: #---

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Robert Kern
On 8/26/10 4:25 PM, Navkirat Singh wrote: @Robert - Thanks a lot for your time :-) , I did know that the body starts after the occurrence two CRLF sequences, but I was following RFC2616 as a guide, which specifically mentions: "The presence of a message-body in a request is signaled by the incl

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Navkirat Singh
On 27-Aug-2010, at 2:58 AM, Navkirat Singh wrote: > > On 27-Aug-2010, at 2:48 AM, MRAB wrote: > >> On 26/08/2010 21:47, Navkirat Singh wrote: >>> >>> On 27-Aug-2010, at 1:57 AM, MRAB wrote: >>> On 26/08/2010 21:14, Navkirat Singh wrote: > > On 27-Aug-2010, at 1:32 AM, Dave Angel

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Robert Kern
On 8/26/10 4:28 PM, Navkirat Singh wrote: On 27-Aug-2010, at 2:48 AM, MRAB wrote: On 26/08/2010 21:47, Navkirat Singh wrote: On 27-Aug-2010, at 1:57 AM, MRAB wrote: On 26/08/2010 21:14, Navkirat Singh wrote: On 27-Aug-2010, at 1:32 AM, Dave Angel wrote: Navkirat Singh wrote: Hey guys,

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Navkirat Singh
On 27-Aug-2010, at 3:02 AM, Robert Kern wrote: > On 8/26/10 4:17 PM, Navkirat Singh wrote: > >> Here is what I needed to do: >> >> a) Separate image content from header content of the byte stream received >> from the web browser. >> b) Save the image content to disk for further use. >> >> Her

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Robert Kern
On 8/26/10 4:17 PM, Navkirat Singh wrote: #-HERE IS WHERE I RECEIVE THE DATA while True: buff = socket.recv(8192) byteStr +=buff if not buff: break Also, you probably shouldn't bother writing an HTTP server using raw s

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Navkirat Singh
On 27-Aug-2010, at 3:04 AM, Robert Kern wrote: > On 8/26/10 4:25 PM, Navkirat Singh wrote: > >> @Robert - Thanks a lot for your time :-) , I did know that the body starts >> after >> the occurrence two CRLF sequences, but I was following RFC2616 as a guide, >> which >> specifically mentions: >

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Navkirat Singh
On 27-Aug-2010, at 3:15 AM, Robert Kern wrote: > On 8/26/10 4:17 PM, Navkirat Singh wrote: > >> #-HERE IS WHERE I RECEIVE THE DATA >> while True: >> buff = socket.recv(8192) >> byteStr +=buff >> if not buff: break > > Also, you probab

Re: Python Editor or IDE ActiveX control

2010-08-26 Thread Thomas Jollans
On Thursday 26 August 2010, it occurred to Sathish S to exclaim: > Hi Ppl, > > Is there any python IDE or editor that has an ActiveX control which could > be embed in other Windows applications. I'm basically looking to write a > application that can show the indentations of python, change the col

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Terry Reedy
On 8/26/2010 5:28 PM, Navkirat Singh wrote: b = b'asdf' type(b) s = b.split(':') You are trying to split bytes with a string, which is impossible. Split bytes with bytes, strings with strings. Traceback (most recent call last): File "", line 1, in TypeError: Type str doesn't support th

Re: Writing byte stream as jpeg format to disk

2010-08-26 Thread Navkirat Singh
On 27-Aug-2010, at 4:23 AM, Terry Reedy wrote: > On 8/26/2010 5:28 PM, Navkirat Singh wrote: > > b = b'asdf' > type(b) >> > s = b.split(':') > > You are trying to split bytes with a string, which is impossible. > Split bytes with bytes, strings with strings. > >> Traceback (most r

Re: Python Editor or IDE ActiveX control

2010-08-26 Thread Stef Mientki
On 27-08-2010 00:22, Thomas Jollans wrote: > On Thursday 26 August 2010, it occurred to Sathish S to exclaim: >> Hi Ppl, >> >> Is there any python IDE or editor that has an ActiveX control which could >> be embed in other Windows applications. I'm basically looking to write a >> application that c

Re: pyxser-1.5r --- Python Object to XML serializer/deserializer

2010-08-26 Thread Josh English
It looks nice, but it's a shame it doesn't work on Windows. This could solve a lot of the problems I'm running into in my own attempt to build a python Class implementation of an XML Validation object. -- http://mail.python.org/mailman/listinfo/python-list

Trouble importing cx_Oracle on HPUX

2010-08-26 Thread Cliff Martin
I have just gotten done building Python 3.1.2 on HPUX 11.31 Itanium (IA64) using gcc 4.4.3, and have tried building cx_Oracle to go with it. The build succeeds, but test and importing does not. I have tried building Python with threads and without. The only exotic thing I do with the configure for

Re: pyxser-1.5r --- Python Object to XML serializer/deserializer

2010-08-26 Thread Stefan Behnel
Josh English, 27.08.2010 01:30: solve a lot of the problems I'm running into in my own attempt to build a python Class implementation of an XML Validation object. How would object serialisation help here? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Editor or IDE ActiveX control

2010-08-26 Thread Michel Claveau - MVP
Hi! Scintilla come like a "control" (a piece for a window), raleted to the file SciLexer.DLL For call the scintilla-componant, use "messages". Example : SendMessage(Sci, SCI_GOTOLINE, line, 0) For the constant SCI_GOTOLINE, I suggest scintillacon.py, include in Pywin32. @-salutations -- Mich