Convert PySerial to python 3.0

2009-02-24 Thread Seth
I am just messing around trying to get pyserial to work with 3.0. I am stuck on this line: if type(port) in [type(''), type(u'')] how can I convert this to 3.0? I tried changing the u to a d that did not do anything. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert PySerial to python 3.0

2009-02-25 Thread Seth
On Feb 24, 10:55 pm, Chris Rebert wrote: > On Tue, Feb 24, 2009 at 7:46 PM, Seth wrote: > > I am just messing around trying to get pyserial to work with 3.0. > > > I am stuck on this line: > > > if type(port) in [type(''), type(u'')] > > >

Re: Convert PySerial to python 3.0

2009-02-25 Thread Seth
ectly Originally: if type(port) in [type(''), type(u'')] self.portstr = port else: self.portstr = self.makeDeviceName(port) On Feb 25, 8:47 am, Christian Heimes wrote: > Seth wrote: > > I implemented "if isinstance(p

Re: Convert PySerial to python 3.0

2009-02-25 Thread Seth
Py3k on this project that I am working on and pyserial has not been converted so I just started messing around with it. Thanks for the help. Seth On Feb 25, 10:16 am, Christian Heimes wrote: > Seth wrote: > > I tried all three ways you guys listed nothing seems to convert the >

shelve.open generates (22, 'Invalid argument') Os X 10.5 with Python 2.5

2010-02-09 Thread seth
There is something you could possibly help me with. We have a code that creates a simple Python shelve database. We are able to serialize objects and store them in the dbm file. This seem to work the same on Windows XP Python 2.5, Ubuntu 9.1 with Python 2.6, but on Os X 10.5 with Python 2.5 the da

Re: shelve.open generates (22, 'Invalid argument') Os X 10.5 with Python 2.5

2010-02-16 Thread seth
On Feb 14, 1:21 pm, a...@pythoncraft.com (Aahz) wrote: > Nope -- any reason you can't change the filename? > -- Os X 10.5 did not recognized the dbm extension. But, I have been able to fix the problem (hope it helps somebody): At http://docs.python.org/library/shelve.html it says: "shelve.open(

Pyserial and pyQt

2009-07-21 Thread Seth
box and eventually a graph in pyQt. I can't find any documentation or tutorials on how to do this. If anyone can point me in the right direction or give me some tips I would be grateful. Thanks, Seth -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyserial and pyQt

2009-07-22 Thread Seth
On Jul 21, 7:24 pm, David Boddie wrote: > On Tuesday 21 July 2009 21:37, Seth wrote: > > > I have used pyserial in the past but this is my first experience with > > pyQt.  I am using the Python xy package for windows current but might > > move to linux.  I have a small dev

Help with Asyncore

2005-07-29 Thread Seth Nielson
designed for channel-internal buffers. Should I also overwrite "send" and have the data appended to a buffer? If not, how should writable and handle_write be implemented? I'm not sure what to do here... Thank you in advance, -- Seth Nielson -- http://mail.python.org/mailman/listinfo/python-list

Re: A replacement for lambda

2005-07-30 Thread Seth Nielson
of saying, "don't do this now". That is why I use lambda. -- Seth Nielson On 7/30/05, Reinhold Birkenfeld <[EMAIL PROTECTED]> wrote: > Stefan Rank wrote: > > on 30.07.2005 10:20 Paolino said the following: > >> why (x**2 with(x))<(x**3 with(x)) is not

gdbm dying wierdly

2005-08-27 Thread Seth Nielson
dies WITHOUT an exception! It just disappears! (signal maybe?) Please help! I'm up against the wall! -- Seth N. -- http://mail.python.org/mailman/listinfo/python-list

Re: gdbm dying wierdly

2005-08-27 Thread Seth Nielson
Nevermind. The problem wasn't in gdbm. I had "exception" in stead of "Exception" in the try-except statement. -- SethNOn 8/27/05, Seth Nielson <[EMAIL PROTECTED]> wrote: Hi guys. I'm using a python script as a redirector for Squid. My python script uses gdbm

tarfile vs zipfile

2015-03-02 Thread Seth P
Is there a reason tarfile and zipfile don't use the same method/member names, where it makes sense? Consider the following six methods/members, which I would expect to be the same (with the possible exception of mtime vs date_time, which are of different types). It almost seems like someone we

minidom and unicode errors

2006-03-06 Thread Abhimanyu Seth
Hi all,I'm trying to parse and modify an XML document using xml.dom.minidom module and Python 2.4.2>> from xml.dom import minidom>> dom = minidom.parse ("c:/test.txt")If the xml file contains a non-ascii character, then i get a parse error. I have the following line in my xml file:Exception beim Lö

Re: minidom and unicode errors

2006-03-06 Thread Abhimanyu Seth
On 3/7/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: Abhimanyu Seth wrote:> I'm trying to parse and modify an XML document using xml.dom.minidom module> and Python 2.4.2>> >> from xml.dom import minidom> >> dom = minidom.parse ("c:/test.txt")>>

Re: minidom and unicode errors

2006-03-06 Thread Abhimanyu Seth
On 3/7/06, Abhimanyu Seth <[EMAIL PROTECTED]> wrote: On 3/7/06, Fredrik Lundh < [EMAIL PROTECTED]> wrote: Abhimanyu Seth wrote:> I'm trying to parse and modify an XML document using xml.dom.minidom module> and Python 2.4.2>> >> from xml.dom import minidom>

Re: minidom and unicode errors

2006-03-06 Thread Abhimanyu Seth
On 3/7/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: Abhimanyu Seth wrote:> > I have the following line in my xml file:> > Exception beim Löschen des Audit-Moduls aufgetreten. Exception> Stack> > lautet: %1. > > ExpatError: not well-formed (invalid token): line 8, c

Re: minidom and unicode errors

2006-03-06 Thread Abhimanyu Seth
On 3/7/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: Abhimanyu Seth wrote:> Sorry, my mistake. The file was not saved as utf-8. Saving it as utf-8> solves my problems.> >> f = codecs.open ("c:/test.txt", "r", "utf-8") > >> dom = minidom.

Re: Performance: sets vs dicts.

2010-08-29 Thread Seth Rees
On 08/29/10 14:43, Peter Otten wrote: John Nagle wrote: Is the "in" test faster for a dict or a set? Is "frozenset" faster than "set"? Use case is for things like applying "in" on a list of 500 or so words while checking a large body of text. As Arnaud suspects: no significant differenc

Re: accessing a text file

2010-09-05 Thread Seth Rees
On 09/05/10 16:47, Baba wrote: > level: beginner > > how can i access the contents of a text file in Python? > > i would like to compare a string (word) with the content of a text > file (word_list). i want to see if word is in word_list. let's assume > the TXT file is stored in the same director

Combinations or Permutations

2010-09-20 Thread Seth Leija
I need to know how to generate a list of combinations/permutations (can't remember which it is). Say I have a list of variables: [a,b,c,d,...,x,y,z] I am curious if there is an optimized way to generate this: [[a,b],[a,c],[a,d],...,[x,z],[y,z]] I currently have an iteration that does this: #li

Re: Combinations or Permutations

2010-09-20 Thread Seth Leija
On Sep 20, 3:08 pm, Mark Lawrence wrote: > On 20/09/2010 21:54, Seth Leija wrote: > > > > > > > I need to know how to generate a list of combinations/permutations > > (can't remember which it is). Say I have a list of variables: > > > [a,b,c,d,