Re: PyUSB available for current versions of Windows?

2012-03-09 Thread Tim Roberts
John Nagle wrote: >I want to enumerate the available USB devices. All I really >need is the serial number of the USB devices available to PySerial. >... >(When you plug in a USB device on Windows, it's assigned the next >available COM port number. On a reboot, the numbers are reassigned. >S

Re: "Decoding unicode is not supported" in unusual situation

2012-03-09 Thread Steven D'Aprano
On Fri, 09 Mar 2012 10:11:58 -0800, John Nagle wrote: > On 3/8/2012 2:58 PM, Prasad, Ramit wrote: >>> Right. The real problem is that Python 2.7 doesn't have distinct >>> "str" and "bytes" types. type(bytes() returns "str" is >>> assumed to be ASCII 0..127, but that's not enforced. "bytes" a

Re: stackoverflow question

2012-03-09 Thread Terry Reedy
On 3/9/2012 5:10 PM, Ethan Furman wrote: Hey all! I posted a question/answer on SO earlier, but there seems to be some confusion around either the question or the answer (judging from the comments). http://stackoverflow.com/q/9638921/208880 If anyone here is willing to take a look at it and le

TIME SENSITIVE] Please Open Immediately!

2012-03-09 Thread businessmot...@hotmail.com
TIME SENSITIVE] Please Open Immediately! http://signup.wazzub.info/?lrRef=c18fbd9 Dear partners, Sometimes it is most important to act fast. Imagine a project that has the potential to become the next GooTwitFaceuPon and you have the advantage to be one of the first to join – BEFORE OFFICIAL PRE-LA

stackoverflow question

2012-03-09 Thread Ethan Furman
Hey all! I posted a question/answer on SO earlier, but there seems to be some confusion around either the question or the answer (judging from the comments). http://stackoverflow.com/q/9638921/208880 If anyone here is willing to take a look at it and let me know if I did not write it well,

Re: converting from tcl/tkl to python

2012-03-09 Thread Grant Edwards
On 2012-03-09, Kevin Walzer wrote: > Having said this, if you are seeing other issues with Tcl (lack of > support for certain libraries/API's, code is becoming unmanagable, etc.) > and you have concluded that Python is a superior choice overall, then > there are a number of different routes yo

Re: converting from tcl/tkl to python

2012-03-09 Thread Mark Roseman
Hi Richard, I would strongly second the advice that Kevin provided: rewriting is a substantial step not to be taken lightly. If a mere facelift is desired, migrating to the more modern tools provided in recent versions of Tcl/Tk may well meet your needs at a fraction of the cost/effort. For ad

Re: "Decoding unicode is not supported" in unusual situation

2012-03-09 Thread John Nagle
On 3/8/2012 2:58 PM, Prasad, Ramit wrote: Right. The real problem is that Python 2.7 doesn't have distinct "str" and "bytes" types. type(bytes() returns "str" is assumed to be ASCII 0..127, but that's not enforced. "bytes" and "str" should have been distinct types, but that would have broke

Re: Finding MIME type for a data stream

2012-03-09 Thread Tobiah
> Something like the following might be worth a go: > (untested) > > from PIL import Image > img = Image.open(StringIO(blob)) > print img.format > This worked quite nicely. I didn't see a list of all returned formats though in the docs. The one image I had returned PNG So I'm doing: mime_ty

Re: Does ElementTree's Parent XPath actually work?

2012-03-09 Thread Jason Cooper
On Friday, March 9, 2012 12:24:04 PM UTC-5, Jason Cooper wrote: > I'm curious to know if anyone with ElementTree 1.3 has gotten the parent > XPath to work? According to http://effbot.org/zone/element-xpath.htm, you > should be able to do > > >>> import xml.etree.ElementTree as et > >>> et.V

Does ElementTree's Parent XPath actually work?

2012-03-09 Thread Jason Cooper
I'm curious to know if anyone with ElementTree 1.3 has gotten the parent XPath to work? According to http://effbot.org/zone/element-xpath.htm, you should be able to do >>> import xml.etree.ElementTree as et >>> et.VERSION '1.3.0' ... >>> elem.find('..') >>> but that always return

PyUSB available for current versions of Windows?

2012-03-09 Thread John Nagle
I want to enumerate the available USB devices. All I really need is the serial number of the USB devices available to PySerial. (When you plug in a USB device on Windows, it's assigned the next available COM port number. On a reboot, the numbers are reassigned. So if you have multiple USB ser

Re: Finding MIME type for a data stream

2012-03-09 Thread Tobiah
On 03/08/2012 06:04 PM, Dennis Lee Bieber wrote: > On Thu, 08 Mar 2012 15:40:13 -0800, Tobiah declaimed > the following in gmane.comp.python.general: > > >> Pasting images may sound weird, but I'm using a jquery >> widget called cleditor that takes image data from the >> clipboard and replaces i

Re: Finding MIME type for a data stream

2012-03-09 Thread Tobiah
On 03/08/2012 06:12 PM, Irmen de Jong wrote: > On 8-3-2012 23:34, Tobiah wrote: >> Also, I realize that I could write the data to a file >> and then use one of the modules that want a file path. >> I would prefer not to do that. >> >> Thanks >> > > Use StringIO then, instead of a file on disk > >

Re: converting from tcl/tkl to python

2012-03-09 Thread Rod Person
On Fri, 9 Mar 2012 07:10:19 -0800 (PST) Richard Boothroyd wrote: > Hi there, > > First, I am not a developer so go easy on my ignorance ;-). Our > company designs and develops hearing aid audibility fitting equipment. > (www.audioscan.com). Our current software GUI is all based on TCL/TKL > and

Re: converting from tcl/tkl to python

2012-03-09 Thread Kevin Walzer
On 3/9/12 10:10 AM, Richard Boothroyd wrote: First, I am not a developer so go easy on my ignorance ;-). Our company designs and develops hearing aid audibility fitting equipment. (www.audioscan.com). Our current software GUI is all based on TCL/TKL and we are running into issues on developing a

converting from tcl/tkl to python

2012-03-09 Thread Richard Boothroyd
Hi there, First, I am not a developer so go easy on my ignorance ;-). Our company designs and develops hearing aid audibility fitting equipment. (www.audioscan.com). Our current software GUI is all based on TCL/TKL and we are running into issues on developing a "prettier" GUI in an effort to moder

Re: "Decoding unicode is not supported" in unusual situation

2012-03-09 Thread Neil Cerutti
On 2012-03-08, John Nagle wrote: > So it's possible to get junk characters in a "str", and they > won't convert to Unicode. I've had this happen with databases > which were supposed to be ASCII, but occasionally a non-ASCII > character would slip through. Perhaps encode and then decode, rather t

Re: What's the best way to write this regular expression?

2012-03-09 Thread jkn
Also unrelated to the OP, but a far superior Commnad line interface to Windows is the (unhelpfully-named) 'console' program: http://sourceforge.net/projects/console/ This has tabbed windows, preset directory navigation, good copy/paste facilities, the ability to configure different shells, et

Re: Finding MIME type for a data stream

2012-03-09 Thread Peter Otten
Tobiah wrote: > I'm pulling image data from a database blob, and serving > it from a web2py app. I have to send the correct > Content-Type header, so I need to detect the image type. > > Everything that I've found on the web so far, needs a file > name on the disk, but I only have the data. > >