finding/replacing a long binary pattern in a .bin file

2005-01-12 Thread yaipa
What would be the common sense way of finding a binary pattern in a .bin file, say some 200 bytes, and replacing it with an updated pattern of the same length at the same offset? Also, the pattern can occur on any byte boundary in the file, so chunking through the code at 16 bytes a frame maybe a

Re: newbie q

2005-01-12 Thread Egor Bolonev
"Stephen Thorne" <[EMAIL PROTECTED]> ÑÐÐÐÑÐÐ/ÑÐÐÐÑÐÐÐ Ð ÑÐÐÐÑÑÑÐÐ: news:[EMAIL PROTECTED] On Thu, 13 Jan 2005 15:55:10 +1000, Egor Bolonev <[EMAIL PROTECTED]> wrote: how to get rid of 'for' operator in the code? import os, os.path def _test(): src = 'C:\\Documents and Settings\\ÐÐÐÑ\\M

Re: finding/replacing a long binary pattern in a .bin file

2005-01-12 Thread Stephen Thorne
On 12 Jan 2005 22:36:54 -0800, yaipa <[EMAIL PROTECTED]> wrote: > What would be the common sense way of finding a binary pattern in a > .bin file, say some 200 bytes, and replacing it with an updated pattern > of the same length at the same offset? > > Also, the pattern can occur on any byte bound

Re: java 5 could like python?

2005-01-12 Thread F. GEIGER
"vegetax" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > I was a java developer one year ago ,before i moved to python i realy liked > it at the beggining, but i got very disapointed lately since my > previus two python proyects where relatively big,and python didnt feel > wel

Re: newbie q

2005-01-12 Thread Stephen Thorne
On Thu, 13 Jan 2005 15:55:10 +1000, Egor Bolonev <[EMAIL PROTECTED]> wrote: > how to get rid of 'for' operator in the code? > > import os, os.path > > def _test(): > src = 'C:\\Documents and Settings\\ÐÐÐÑ\\My Documents\\My Music\\' > > for i in [x for x in os.listdir(src) if os.path.isf

newbie q

2005-01-12 Thread Egor Bolonev
how to get rid of 'for' operator in the code? import os, os.path def _test(): src = 'C:\\Documents and Settings\\Егор\\My Documents\\My Music\\' for i in [x for x in os.listdir(src) if os.path.isfile(os.path.join(src, x)) and len(x.split('.')) > 1 and x.split('.')[-1].lower() == 'm3u']:

Re: why are people still using classic classes?

2005-01-12 Thread Bengt Richter
On 12 Jan 2005 20:06:39 -0800, Paul Rubin wrote: >Simon Wittber <[EMAIL PROTECTED]> writes: >> > Is there a reason NOT to use them? If a classic class works fine, what >> > incentive is there to switch to new style classes? >> >> Perhaps classic classes will eventual

Re: why are people still using classic classes?

2005-01-12 Thread Aahz
In article <[EMAIL PROTECTED]>, Simon Wittber <[EMAIL PROTECTED]> wrote: > >Is there a legitimate use for classic classes that I am not aware of? >Is there a project to specifically migrate standard library classes to >new-style classes? Exceptions, in addition to the other excellent reasons you'

RE: why are people still using classic classes?

2005-01-12 Thread Robert Brewer
Simon Wittber wrote: > Is there a legitimate use for classic classes that I am not aware of? As was pointed out to me when I asked on this list just a short while ago ;) classic classes can be faster. Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/

Re: Refactoring; arbitrary expression in lists

2005-01-12 Thread Stephen Thorne
On Thu, 13 Jan 2005 05:18:57 GMT, Bengt Richter <[EMAIL PROTECTED]> wrote: > On Thu, 13 Jan 2005 12:19:06 +1000, Stephen Thorne <[EMAIL PROTECTED]> wrote: > > >On Thu, 13 Jan 2005 01:24:29 GMT, Bengt Richter <[EMAIL PROTECTED]> wrote: > >> extensiondict = dict( > >> php = 'application/

Re: why are people still using classic classes?

2005-01-12 Thread John Roth
"Simon Wittber" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I've noticed that a few ASPN cookbook recipes, which are recent additions, use classic classes. I've also noticed classic classes are used in many places in the standard library. I've been using new-style classes since Pyt

Re: Refactoring; arbitrary expression in lists

2005-01-12 Thread Bengt Richter
On Thu, 13 Jan 2005 12:19:06 +1000, Stephen Thorne <[EMAIL PROTECTED]> wrote: >On Thu, 13 Jan 2005 01:24:29 GMT, Bengt Richter <[EMAIL PROTECTED]> wrote: >> extensiondict = dict( >> php = 'application/x-php', >> cpp = 'text/x-c-src', >> # etcetera >> xsl = 'test

Re: Gecko bindings for Python?

2005-01-12 Thread Stephen Thorne
there's wxMozilla, which is for embedding mozilla's rendering engine (I assume that's what you mean by 'Gecko') within wxpython/wxwidgets. Stephen. On 11 Jan 2005 07:10:57 -0800, Cordula's Web <[EMAIL PROTECTED]> wrote: > Hello, > > I'd like to use the Gecko engine in GTK+ or Qt programs writte

Re: py2exe Excludes

2005-01-12 Thread vincent wehren
Ed Leafe wrote: I'm trying to make a Windows runtime for Dabo, and I want to exclude the framework code itself from the exe file, so that people can update with new releases as they are made. The relevant section of setup.py has: setup( # The first three parameters are not required,

Creating text on images

2005-01-12 Thread morphex
Hi all, I'm trying to create a script that will superimpose text on an image. I didn't find any great examples out there on how this can be done (I presume using PIL is necessary), do you know of any examples? Thanks, Morten -- http://mail.python.org/mailman/listinfo/python-list

Re: pyserial and com port interrupts

2005-01-12 Thread Stephen Thorne
On Thu, 13 Jan 2005 03:11:23 GMT, Bengt Richter <[EMAIL PROTECTED]> wrote: > On Wed, 12 Jan 2005 14:24:48 -0800, engsol <[EMAIL PROTECTED]> wrote: > > >Has anyone done a script that will rspond to the serial com port(s) > >receive buffer interrupt, as opposed to polling and timeouts? > >Win2000 is

Re: What strategy for random accession of records in massive FASTA file?

2005-01-12 Thread Bengt Richter
On 12 Jan 2005 14:46:07 -0800, "Chris Lasher" <[EMAIL PROTECTED]> wrote: >Hello, >I have a rather large (100+ MB) FASTA file from which I need to >access records in a random order. The FASTA format is a standard format >for storing molecular biological sequences. Each record contains a >header lin

Re: why are people still using classic classes?

2005-01-12 Thread Paul Rubin
Simon Wittber <[EMAIL PROTECTED]> writes: > > Is there a reason NOT to use them? If a classic class works fine, what > > incentive is there to switch to new style classes? > > Perhaps classic classes will eventually disappear? It just means that the formerly "classic" syntax will define a new-

Re: pyserial and com port interrupts

2005-01-12 Thread Grant Edwards
On 2005-01-13, engsol <[EMAIL PROTECTED]> wrote: > I'm not sure what timeout value I'd use. Using threads, and re-loading the > timeout values on the fly may be a solution, but I'm not experienced with > threadsand was hoping to avoid them. Using threads in Python is really, really painless.

Re: why are people still using classic classes?

2005-01-12 Thread Paul Rubin
Simon Wittber <[EMAIL PROTECTED]> writes: > Is there a legitimate use for classic classes that I am not aware of? Yes, new-style classes don't work in older Python installations. Some Python users prefer not to be on such a frequent upgrade treadmill, so they continue to use old versions. Theref

Re: why are people still using classic classes?

2005-01-12 Thread Simon Wittber
> Is there a reason NOT to use them? If a classic class works fine, what > incentive is there to switch to new style classes? Perhaps classic classes will eventually disappear? It seems strange (and is difficult to explain to my peers) that a language offers two different ways to define a stand

Re: why are people still using classic classes?

2005-01-12 Thread Roy Smith
Simon Wittber <[EMAIL PROTECTED]> wrote: > Is there a legitimate use for classic classes that I am not aware of? Is there a reason NOT to use them? If a classic class works fine, what incentive is there to switch to new style classes? I realize it's not much effort to put "(object)" after your

Apache/mod_python & MySQLdb

2005-01-12 Thread scott
AIUI, global variables are supposed to be preserved within each Apache thread/prcoess. However, I'm importing and using MySQLdb within a class in a separate module, which is in turn imported and used within a _function (ie. not "published"). So, AFAICT, it's not supposed to be preseved. But u

Re: Octal notation: severe deprecation

2005-01-12 Thread and-google
John Machin wrote: > I regard continued usage of octal as a pox and a pestilence. Quite agree. I was disappointed that it ever made it into Python. Octal's only use is: a) umasks b) confusing the hell out of normal non-programmers for whom a leading zero is in no way magic (a) does not outweig

why are people still using classic classes?

2005-01-12 Thread Simon Wittber
I've noticed that a few ASPN cookbook recipes, which are recent additions, use classic classes. I've also noticed classic classes are used in many places in the standard library. I've been using new-style classes since Python 2.2, and am suprised people are still using the classic classes. Is th

Re: Refactoring; arbitrary expression in lists

2005-01-12 Thread Stephen Thorne
On Thu, 13 Jan 2005 01:24:29 GMT, Bengt Richter <[EMAIL PROTECTED]> wrote: > extensiondict = dict( > php = 'application/x-php', > cpp = 'text/x-c-src', > # etcetera > xsl = 'test/xsl' > ) > > def detectMimeType(filename): > extension = os.path.sp

Re: pyserial and com port interrupts

2005-01-12 Thread Bengt Richter
On Wed, 12 Jan 2005 14:24:48 -0800, engsol <[EMAIL PROTECTED]> wrote: >Has anyone done a script that will rspond to the serial com port(s) >receive buffer interrupt, as opposed to polling and timeouts? >Win2000 is the main interest right now. Have you looked into letting the OS do it? I.e., read

Re: Octal notation: severe deprecation

2005-01-12 Thread Stephen Thorne
On 12 Jan 2005 16:21:29 -0800, PJDM <[EMAIL PROTECTED]> wrote: > Maybe P3K will have an integer literal like "n_b" for "the integer n in > base b". I would actually like to see pychecker pick up conceptual errors like this: import datetime datetime.datetime(2005, 04,04) Regards, Stephen Thorne -

Re Wide Unicode build for Windows available somewhere?

2005-01-12 Thread Christian Wittern
> Wide unicode is currently not supported on Windows. A number of > internal APIs (in particular for the registry, and for the "mbcs" > codec) assume that sizeof(Py_UNICODE) is 2. Contributions are > welcome. >Even with that fixed, Pythonwin would still need a major rework > to support wide Unicod

Re: dict.updated

2005-01-12 Thread Bengt Richter
On Wed, 12 Jan 2005 23:47:13 GMT, "Rick Morrison" <[EMAIL PROTECTED]> wrote: >I could live with creating a new dict, sure (although it seems wasteful). I >realize that something like this probably doesn't stand a chance of ever >making it into the std library for what might be called "philosophica

Re: Dynamically add class method causes "SystemError: ... bad argument to internal function"

2005-01-12 Thread Newgene
I have noticed that the exception was caused by the call of "self.f()" within my "_generic" function. It will raise SystemError exception whenever I refer to any method or attribute of "self" within "_generic" function. Otherwise, dynamically adding method works fine. I cannot figure out what's the

Re: Help Optimizing Word Search

2005-01-12 Thread snoe
With a list of letters: 'ABAE?S?' your implementation ran 3.5 times faster than the one from http://blog.vrplumber.com/427 (in 0.437 seconds vs 1.515) Without wildcards yours runs slightly quicker as well. I guess with the wildcards, using an re as a quick filter against each word, versus the tra

Re: counting items

2005-01-12 Thread Bengt Richter
On Wed, 12 Jan 2005 18:07:47 GMT, "Andrew Koenig" <[EMAIL PROTECTED]> wrote: >"It's me" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] > >> What's the best way to count number of items in a list? >> >> For instance, >> >> a=[[1,2,4],4,5,[2,3]] >> >> I want to know how many items are

Re: what would you like to see in a 2nd edition Nutshell?

2005-01-12 Thread kery
Alex Martelli wrote: > Craig Ringer <[EMAIL PROTECTED]> wrote: > > > On Wed, 2004-12-29 at 23:54, Thomas Heller wrote: > > > > > I found the discussion of unicode, in any python book I have, insufficient. > > > > I couldn't agree more. I think explicit treatment of implicit > > conversion, the role

Re: pyserial and com port interrupts

2005-01-12 Thread engsol
On Wed, 12 Jan 2005 17:45:48 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: >engsol wrote: >> Has anyone done a script that will rspond to the serial com port(s) >> receive buffer interrupt, as opposed to polling and timeouts? >> Win2000 is the main interest right now. > >What problem do you hope

Re: dict.updated

2005-01-12 Thread Stephen Thorne
On Wed, 12 Jan 2005 23:47:13 GMT, Rick Morrison <[EMAIL PROTECTED]> wrote: > I could live with creating a new dict, sure (although it seems wasteful). I > realize that something like this probably doesn't stand a chance of ever > making it into the std library for what might be called "philosophica

Re: dict.updated

2005-01-12 Thread hanz
Rick Morrison wrote: > >>> [updated(d, {'c':3}) for d in [{'a':1, 'b':2}, {'x':10, 'y':'11'}]] > [{'a': 1, 'c': 3, 'b': 2}, {'y': '11', 'x': 10, 'c': 3}] I don't really understand the use of this. Can you give a less toy example? I'd probably just do dicts = [{'a':1, 'b':2}, {'x':10, 'y':'11'}]

Re: Another look at language comparisons

2005-01-12 Thread Jon Perez
Terry Reedy wrote: It would hardly make more sense with the photos. The photos would be graphic evidence and would make it more entertaining to read through. "Not the law is clear? There is a beard - there is a success. There is no beard - you are guilty. " Terry J. Reedy And what about the moust

Re: Refactoring; arbitrary expression in lists

2005-01-12 Thread Bengt Richter
On Wed, 12 Jan 2005 18:16:23 +, Frans Englich <[EMAIL PROTECTED]> wrote: > >As continuation to a previous thread, "PyChecker messages", I have a question >regarding code refactoring which the following snippet leads to: > >> > runner.py:200: Function (detectMimeType) has too many returns (11)

Re: Why would I get a TypeEror?

2005-01-12 Thread Steven Bethard
It's me wrote: For this code snip: a=3 b=(1,len(a))[isinstance(a,(list,tuple,dict))] Why would I get a TypeError from the len function? You're looking for lazy evaluation or short-circuiting behavior. Python provides one form of short circuiting behavior with 'and' and 'or', though you need

Matrix-SIG archives

2005-01-12 Thread Robert Kern
It looks like the mailing list archives for the Matrix-SIG and other retired SIGs are down at the moment. I've alerted the python.org webmaster, but in the meantime, does anyone have the early archives sitting around somewhere? I'm trying to answer a question about the motivations of a particul

Re: reference or pointer to some object?

2005-01-12 Thread Steven Bethard
Torsten Mohr wrote: I still wonder why a concept like "references" was not implemented in Python. I think it is (even if small) an overhead to wrap an object in a list or a dictionary. Isn't it possible to extend Python in a way to use real references? Or isn't that regarded as necessary? IMHO it

Re: dict.updated

2005-01-12 Thread Steven Bethard
Rick Morrison wrote: I could live with creating a new dict, sure (although it seems wasteful). I realize that something like this probably doesn't stand a chance of ever making it into the std library for what might be called "philosophical" reasons. I just want it for me (my personal philosophy ru

Re: reference or pointer to some object?

2005-01-12 Thread Steven Bethard
Jeff Shannon wrote: Torsten Mohr wrote: I still wonder why a concept like "references" was not implemented in Python. I think it is (even if small) an overhead to wrap an object in a list or a dictionary. Because Python uses a fundamentally different concept for variable names than C/C++/Java (an

Re: What strategy for random accession of records in massive FASTA file?

2005-01-12 Thread John Machin
Chris Lasher wrote: > Hello, > I have a rather large (100+ MB) FASTA file from which I need to > access records in a random order. The FASTA format is a standard format > for storing molecular biological sequences. Each record contains a > header line for describing the sequence that begins with a

Re: else condition in list comprehension

2005-01-12 Thread Steven Bethard
Steve Holden wrote: Nick Coghlan wrote: z = [newval(i) for i in range(10)] using: def newval(x): if x % 2: return x - 2 else: return x + 2 Just some more mental twiddling relating to the thread on statement local namespaces. I presume the point of this

Re: reference or pointer to some object?

2005-01-12 Thread JCM
Torsten Mohr <[EMAIL PROTECTED]> wrote: ... > I still wonder why a concept like "references" was not > implemented in Python. I think it is (even if small) > an overhead to wrap an object in a list or a dictionary. > Isn't it possible to extend Python in a way to use > real references? Or isn't

Re: Why would I get a TypeEror?

2005-01-12 Thread Terry Reedy
"Peter Hansen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > What did you expect the "length" of the integer 3 to be? Perhaps 2 (bits in a minimal binary representation). I once, for maybe a minute, considered proposing this as an overloaded meaning of len, but realized that th

Re: What strategy for random accession of records in massive FASTA file?

2005-01-12 Thread David E. Konerding DSD staff
In article <[EMAIL PROTECTED]>, Chris Lasher wrote: > Hello, > I have a rather large (100+ MB) FASTA file from which I need to > access records in a random order. The FASTA format is a standard format > for storing molecular biological sequences. Each record contains a > header line for describing

Re: Octal notation: severe deprecation

2005-01-12 Thread PJDM
John Machin wrote: > > 1. Octal notation is of use to systems programmers on computers where > the number of bits in a word is a multiple of 3. Are there any still in > production use? AFAIK word sizes were 12, 24, 36, 48, and 60 bits -- > all multiples of 4, so hexadecimal could be used. The PDP-

Re: What strategy for random accession of records in massive FASTA file?

2005-01-12 Thread Terry Reedy
RE: What strategy for random accession of records in massive FASTA file? "Batista, Facundo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [If you want to keep the memory usage low, you can parse the file once and store in a list the byte position where the record starts and ends. Th

Re: Iteration over two sequences

2005-01-12 Thread Terry Reedy
"It's me" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I tried this and I got: > [(1, 'a'), (2, 'b'), (3, 'c')] > But if I change: > a=[1,2] > I got: > [(1, 'c')] > Why is that? I thought I should be getting: > [(1, 'a'),(2,'b')] > ? Cut and paste the actual input and output

Re: OT: MoinMoin and Mediawiki?

2005-01-12 Thread Paul Rubin
Ian Bicking <[EMAIL PROTECTED]> writes: > If the data has to be somewhere, and you have to have relatively > random access to it (i.e., access any page; not necessarily a chunk of > a page), then the filesystem does that pretty well, with lots of good > features like caching and whatnot. I can't s

Re: Why would I get a TypeEror?

2005-01-12 Thread Steve Holden
It's me wrote: For this code snip: a=3 . b=(1,len(a))[isinstance(a,(list,tuple,dict))] Why would I get a TypeError from the len function? Thanks, because the interpreter evaluates the tuple (1, len(a)) before applying the indexing to it. You are trying to be far too clever. The standard way

Re: else condition in list comprehension

2005-01-12 Thread Stephen Thorne
On 9 Jan 2005 12:20:40 -0800, Luis M. Gonzalez <[EMAIL PROTECTED]> wrote: > Hi there, > > I'd like to know if there is a way to add and else condition into a > list comprehension. I'm sure that I read somewhere an easy way to do > it, but I forgot it and now I can't find it... > > for example: >

Re: dict.updated

2005-01-12 Thread Rick Morrison
I could live with creating a new dict, sure (although it seems wasteful). I realize that something like this probably doesn't stand a chance of ever making it into the std library for what might be called "philosophical" reasons. I just want it for me (my personal philosophy runs more to the pragma

Re: Game programming in Python

2005-01-12 Thread baza
On Wed, 12 Jan 2005 09:49:50 +0800, Simon Wittber wrote: >> I'm looking for any books or on-line resources on game programming >> using Python. Does anyone have any advice? > > Hi Baza, > > If I you are as I assume, a programmer just starting out with game > programming, the best suggestion I c

Re: else condition in list comprehension

2005-01-12 Thread Steve Holden
Nick Coghlan wrote: Luis M. Gonzalez wrote: Hi there, I'd like to know if there is a way to add and else condition into a list comprehension. I'm sure that I read somewhere an easy way to do it, but I forgot it and now I can't find it... for example: z=[i+2 for i in range(10) if i%2==0] what if I w

Re: What strategy for random accession of records in massive FASTA file?

2005-01-12 Thread Larry Bates
You don't say how this will be used, but here goes: 1) Read the records and put into dictionary with key of sequence (from header) and data being the sequence data. Use shelve to store the dictionary for subsequent runs (if load time is excessive). 2) Take a look at Gadfly (gadfly.sourceforge.net)

Re: reference or pointer to some object?

2005-01-12 Thread Jeff Shannon
Torsten Mohr wrote: I still wonder why a concept like "references" was not implemented in Python. I think it is (even if small) an overhead to wrap an object in a list or a dictionary. Because Python uses a fundamentally different concept for variable names than C/C++/Java (and most other static

Re: OT: MoinMoin and Mediawiki?

2005-01-12 Thread Ian Bicking
Paul Rubin wrote: If you are just trying to avoid too many files in a directory, another option is to put files in subdirectories like: base = struct.pack('i', hash(page_name)) base = base.encode('base64').strip().strip('=') filename = os.path.join(base, page_name) Using subdirectories certainly k

Re: Another look at language comparisons

2005-01-12 Thread Jon Perez
Anyone know of a cached copy where the photos are present? The whole thing makes little sense with the photos gone. Pierre Quentel wrote: http://khason.biz/blog/2004/12/why-microsoft-can-blow-off-with-c.html -- http://mail.python.org/mailman/listinfo/python-list

Release date for 2nd edn. Cookbook

2005-01-12 Thread Simon Foster
Does anyone have any idea on this date? Any chance of a signed copy for contributors? -- http://mail.python.org/mailman/listinfo/python-list

Re: What strategy for random accession of records in massive FASTA file?

2005-01-12 Thread John Lenton
> If you could help me figure out how to code a solution > that won't be a resource whore, I'd be _very_ grateful. (I'd prefer to > keep it in Python only, even though I know interaction with a > relational database would provide the fastest method--the group I'm > trying to write this for does not

Re: Another look at language comparisons

2005-01-12 Thread Terry Reedy
"Jon Perez" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Anyone know of a cached copy where the photos are present? > > The whole thing makes little sense with the photos gone. > > Pierre Quentel wrote: >> http://khason.biz/blog/2004/12/why-microsoft-can-blow-off-with-c.html It

Re: Securing a future for anonymous functions in Python

2005-01-12 Thread Jeff Shannon
Jacek Generowicz wrote: One more question. Imagine that Python had something akin to Smalltalk code blocks. Would something like map([x | x+1], seq) be any better for you than map(lambda x:x+1, seq) ? I'd say that this is very slightly better, but it's much closer (in my mind) to map/lambd

What strategy for random accession of records in massive FASTA file?

2005-01-12 Thread Chris Lasher
Hello, I have a rather large (100+ MB) FASTA file from which I need to access records in a random order. The FASTA format is a standard format for storing molecular biological sequences. Each record contains a header line for describing the sequence that begins with a '>' (right-angle bracket) foll

Dynamically add class method causes "SystemError: ... bad argument to internal function"

2005-01-12 Thread Newgene
Hi, group, I am trying to dynamically add a method to class by following this post: http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/2ec2ad7a0a5d54a1/928e91be352c6bfc?q=%22new.code(%22+%22import+new&_done=%2Fgroup%2Fcomp.lang.python%2Fsearch%3Fgroup%3Dcomp.lang.python%26q%

Re: What strategy for random accession of records in massive FASTA file?

2005-01-12 Thread James Stroud
Don't fight it, lite it! You should parse the fasta and put it into a database: http://www.sqlite.org/index.html Then index by name and it will be superfast. James -- http://mail.python.org/mailman/listinfo/python-list

Re: What strategy for random accession of records in massive FASTA file?

2005-01-12 Thread Fredrik Lundh
Chris Lasher wrote: > Since the file I'm working with contains tens of thousands of these > records, I believe I need to find a way to hash this file such that I > can retrieve the respective sequence more quickly than I could by > parsing through the file request-by-request. However, I'm very new

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-12 Thread Steve Holden
Paul Rubin wrote: [EMAIL PROTECTED] writes: I can't imagine how it could be worse than the learning curve of __metaclass__, which we already have. To me, learning macros *and their subtilities* was much more difficult than learning metaclasses. I guess I've only used Lisp macros in pretty straight

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-12 Thread Steve Holden
Paul Rubin wrote: [EMAIL PROTECTED] writes: 2. One could proposed hygienic pattern-matching macros in Python, similar to Scheme syntax-rules macros. Again, it is not obvious how to implement pattern-matching in Python in a non-butt-ugly way. Plus, I feel hygienic macros quite limited and not worth

RE: What strategy for random accession of records in massive FAST A file?

2005-01-12 Thread Batista, Facundo
Title: RE: What strategy for random accession of records in massive FASTA file? [Chris Lasher] #- I have a rather large (100+ MB) FASTA file from which I need to #- access records in a random order. The FASTA format is a #- standard format #- for storing molecular biological sequences. Each

Re: shutil.move has a mind of its own

2005-01-12 Thread Steve Holden
Daniel Bickett wrote: Hello, I'm writing an application in my pastime that moves files around to achieve various ends -- the specifics aren't particularly important. The shutil module was chosen as the means simply because that is what google and chm searches returned most often. My problem has to

Re: pyserial and com port interrupts

2005-01-12 Thread Peter Hansen
engsol wrote: Has anyone done a script that will rspond to the serial com port(s) receive buffer interrupt, as opposed to polling and timeouts? Win2000 is the main interest right now. What problem do you hope to avoid by not using "polling and timeouts"? (Note that if you specify a sizable read t

pyXLwriter and jython

2005-01-12 Thread elbertlev
Hi! I was using pyXLwriter in C-python, but recently had to code in jython. Tried to port pyXLwriter to jython and it does not work. Did somebody uset this module with jython? -- http://mail.python.org/mailman/listinfo/python-list

Re: encryption/decryption help

2005-01-12 Thread elbertlev
For the problem described pycrypto is the best solution. Blowfish is simple and secure. The method you want to use is called "security by obscurity". But chances are very high that the "homebrewed" scheme you will invent will not stand any serious crytoatack. First of all: both sides (sender and

list and generators (WAS: counting items)

2005-01-12 Thread Steven Bethard
Michael Hartl wrote: That's cool! Of course, walk returns a generator, so using a list comprehension to turn it into a list seems natural, but I didn't realize that list() does the same thing (and neither, apparently, did the original implementor) -- although, with a little reflection, it obviousl

Re: encryption/decryption help

2005-01-12 Thread Philippe C. Martin
>>MD5 and SHA are by their very nature one way encryption. You cannot decrypt them. Indeed, the point of these algorithms is to sign data (like a fingerprint). In order to encrypt you may go for Symmetrical algos (AES, 3DES with those, the key must be known on both sides of the pipe) or Asym

pyserial and com port interrupts

2005-01-12 Thread engsol
Has anyone done a script that will rspond to the serial com port(s) receive buffer interrupt, as opposed to polling and timeouts? Win2000 is the main interest right now. Thanks Norm B -- http://mail.python.org/mailman/listinfo/python-list

Re: reference or pointer to some object?

2005-01-12 Thread Torsten Mohr
Hi, thank you all for your explanations. I still wonder why a concept like "references" was not implemented in Python. I think it is (even if small) an overhead to wrap an object in a list or a dictionary. Isn't it possible to extend Python in a way to use real references? Or isn't that regard

Re: Python serial data aquisition

2005-01-12 Thread Flavio codeco coelho
[EMAIL PROTECTED] (Flavio codeco coelho) wrote in message news:<[EMAIL PROTECTED]>... > struct.unpack returns a tuple of values represented by a string(the > output of the read command) packed according to the format specified > by ">BB" > In this forma string, ">" stands for big Endian representa

Re: counting items

2005-01-12 Thread Michael Hartl
That's cool! Of course, walk returns a generator, so using a list comprehension to turn it into a list seems natural, but I didn't realize that list() does the same thing (and neither, apparently, did the original implementor) -- although, with a little reflection, it obviously must! Michael --

Re: "Architecture of Python" was removed ?

2005-01-12 Thread Jon Perez
Skip Montanaro wrote: Yes, perhaps. Note that it doesn't appear that the Wayback Machine contains the meat of the essay, just the front page. It came from a wiki. Perhaps Most of the text seems to be there, but there are some critical diagrams (images) which the Wayback Machine did not archive.

Re: encryption/decryption help

2005-01-12 Thread Jorgen Grahn
On 12 Jan 2005 12:39:05 -0800, Kartic <[EMAIL PROTECTED]> wrote: > Hi, > > Can you use ssh tunneling? You will not be changing anything except add > an extra ssh layer to tunnel your data through. Or, rather, he wouldn't be changing anything at all in the program itself. The approach would be "Ok

Re: dict.updated

2005-01-12 Thread Steven Bethard
Rick Morrison wrote: Would there be any way to add a method to all dict objects that operated like the .update() method, but also returned a reference to the updated dict? Are you looking for updated() to parallel sorted(), where sorted() returns a *new* list? I doubt you'll be able to rally much

Re: pulling info from website

2005-01-12 Thread Jorgen Grahn
On 10 Jan 2005 16:06:33 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote: > bob wrote: > >> i am trying to write a script for Xbox media center that will pull >> information from the bbc news website and display the headlines , how >> do i pull this info into a list??? > > Google for "Python RSS reade

GTK libs don't get events when wrapped for Python

2005-01-12 Thread Mark Asbach
Hi list, I've got a crazy problem: an application fully written C and using a third-party library that itself uses GTK to draw some GUI widgets works as expected. But if I wrap the lib with SWIG and use it in Python, everythings works but the GUI parts. In fact, it looks like the library doesn't

Re: readline, rlcompleter

2005-01-12 Thread Mark Asbach
Hi Michele, > readline.parse_and_bind("tab: complete") > > but I don't find a list of recognized key bindings. The python readline module just wraps the GNU Readline Library, so you need to check the manuals of the latter. It's not that much text and you'll find the information needed at: http

Re: Locale confusion

2005-01-12 Thread Jorgen Grahn
On 11 Jan 2005 05:49:32 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Jorgen Grahn wrote: > [snip] > >> >> frailea> cat foo >> import locale >> print locale.getlocale() >> locale.setlocale(locale.LC_CTYPE) >> print locale.getlocale() ... >> When I run it as a script it isn't though, and

Re: Python & unicode

2005-01-12 Thread Serge Orlov
Michel Claveau - abstraction méta-galactique non triviale en fuite perpétuelle. wrote: > Hi ! > > Sorry, but I think that, for russians, english is an *add-on*, > and not a common-denominator. You miss the point, programs are not English writings, they are written in computer languages using libra

Re: encryption/decryption help

2005-01-12 Thread Kartic
Hi, Can you use ssh tunneling? You will not be changing anything except add an extra ssh layer to tunnel your data through. There is how-to at http://www.ccs.neu.edu/groups/systems/howto/howto-sshtunnel.html (or you can google for tunneling) Please note you can not use MD5 as it is not reversibl

Re: Refactoring; arbitrary expression in lists

2005-01-12 Thread Jeff Shannon
Paul McGuire wrote: "Frans Englich" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] #-- def detectMimeType( filename ): extension = filename[-3:] You might consider using os.path.splitext() here, instead of always assuming

Re: encryption/decryption help

2005-01-12 Thread Philippe C. Martin
Did you look at pycrypto ? http://www.amk.ca/python/code/crypto.html Regards, Philippe -- *** Philippe C. Martin SnakeCard LLC www.snakecard.com *** -- http://mail.python.org/mailman/listinfo/python-list

Re: encryption/decryption help

2005-01-12 Thread Daniel Bowett
MD5 and SHA are by their very nature one way encryption. You cannot decrypt them. A quick google for other encrytion methods found this: http://www.amk.ca/python/code/crypto.html What you will need to do is find an encryption methos that uses a key which you use to encrypt and decrypt the data

dict.updated

2005-01-12 Thread Rick Morrison
Would there be any way to add a method to all dict objects that operated like the .update() method, but also returned a reference to the updated dict? .update() is clumsy to use inside of list comprehensions and the like. Or am I missing something? Thanks, Rick -- http://mail.python.org/mail

Re: OT: MoinMoin and Mediawiki?

2005-01-12 Thread Paul Rubin
Ian Bicking <[EMAIL PROTECTED]> writes: > That sounds like you'd be implementing your own filesystem ;) Yes, this shouldn't be any surprise. Implementing a special purpose file system what every database essentially does. > If you are just trying to avoid too many files in a directory, another >

human readable IPTC field names

2005-01-12 Thread Jonah Bossewitch
Hi, I am using PIL's IptcImagePlugin to extract the IPTC tags from an image file. I was able to successfully retrieve the tags from the image (thanks!), but the results are keyed off of cryptic tuples. I found the lookup codes here - http://demo.imagefolio.com/demo/ImageFolio31_files/skins/coo

Re: Newbie: Pythonwin

2005-01-12 Thread Steve Holden
Brent W. Hughes wrote: 1) I'm running a program within Pythonwin. It's taking too long and I want to stop/kill it. What do I do (other than ctrl-alt-del)? When PythonWin is running it puts an icon in the system tray. You can right-mouse on this icon and select "Break into running code". 2)

py2exe Excludes

2005-01-12 Thread Ed Leafe
I'm trying to make a Windows runtime for Dabo, and I want to exclude the framework code itself from the exe file, so that people can update with new releases as they are made. The relevant section of setup.py has: setup( # The first three parameters are not required, if at least a

  1   2   3   >