Re: p2exe using wine/cxoffice

2005-09-19 Thread Caleb Hattingh
The other thing (and this is always true) is that "better" needs definition. On purely technical grounds, on average, MSOffice is better than OO. However, holistically, OO is probably better (no lock-in, open standards, multiplatform and so on). Those soft issues do matter. On Mon, 19 Sep

Re: How to program efficient pattern searches in a list of float numbers?

2005-09-19 Thread Paddy
How about posting example data and results? -- http://mail.python.org/mailman/listinfo/python-list

multithread exception handling

2005-09-19 Thread pegazik
Hello. I have problem and I ask you for help. Probably there is some quite easy solution, but I can't see it. I'm trying to perform some action that have to be timeout safe. So here is the structure of my program: \\\ def TimeoutHandler(): print '!' raise

mathschallenge.net WAS Brute force sudoku cracker

2005-09-19 Thread Caleb Hattingh
Very interesting that sudoku solving appears on the python group - there is a programming competition at mathschallenge.net (euler) where one of the puzzles is developing a sudoku solving algorithm... Actually the python entrants are giving the C guys a good run! On Mon, 19 Sep 2005 09:12:54

Exception raised in wrong thread?

2005-09-19 Thread pegazik
Hello. I have problem and I'm looking for help. Probably there is some quite easy solution, but I can't see it. I'm trying to perform some action that have to be timeout safe. So here is the structure of my program: \\\ def TimeoutHandler(): print '!' raise

Dr. Dobb's Python-URL! - weekly Python news and links (Sep 19)

2005-09-19 Thread Diez B. Roggisch
QOTW: "Python makes data-driven programming easy :-)" -- Kent "Python rewards abstraction." -- Alex Martelli As unicode becomes more and more prevalent, the issue of regular expressions matching unicode character sets occurs more often. A current thread has advice: http:

Re: functional or object-oriented?

2005-09-19 Thread Bruno Desthuilliers
beza1e1 a écrit : > I see myself shifting more and more over to the functional kind of > coding. Could be related to the Haskell, we had to learn in CS. Now i > was wondering, how other people use Python? > > With functional i mean my files mostly consist of functions which is not enough to make

slicing functionality for strings / Python suitability for bioinformatics

2005-09-19 Thread jbperez808
>>> rs='AUGCUAGACGUGGAGUAG' >>> rs[12:15]='GAG' Traceback (most recent call last): File "", line 1, in ? rs[12:15]='GAG' TypeError: object doesn't support slice assignment You can't assign to a section of a sliced string in Python 2.3 and there doesn't seem to be mention of this as a Python

Re: execfile eats memory

2005-09-19 Thread jepler
I generated a ~22-megabyte file with this small Python program: print "[" for i in xrange(200): print "'" + str(i) + "', " print "]" As the original poster suggested, Python uses at least several hundreds of megabytes when execfile()ing that source. I had t

Re: Removing Warning Messages .............

2005-09-19 Thread Bruno Desthuilliers
chand a écrit : > Hi., > > In my api.py file 'g_opt_list' is defined globally > g_opt_list =[[],[],[],[],[],[],[]] > > when I run the py file, I am getting the Following Error > > SyntaxWarning: name 'g_opt_list' is used prior to global declaration > SyntaxWarning: name 'layers' is used prior to

inspect getsource() minor fix?

2005-09-19 Thread Ron Adam
While playing around with the inspect module I found that the Blockfinder doesn't recognize single line function definitions. Adding the following two lines to it fixes it, but I'm not sure if it causes any problems anywhere else. elif self.indent == 0: raise EndOfBlock, self.las

Re: C#3.0 and lambdas

2005-09-19 Thread Bill Mill
On 9/19/05, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > meanwhile, over in python-dev land: > > > > "Is anyone truly attached to nested tuple function parameters; 'def > > fxn((a,b)): print a,b'? /.../ > > > > Would anyone really throw a huge fit if they went away? I am willing >

Re: slicing functionality for strings / Python suitability for bioinformatics

2005-09-19 Thread Reinhold Birkenfeld
[EMAIL PROTECTED] wrote: rs='AUGCUAGACGUGGAGUAG' rs[12:15]='GAG' > Traceback (most recent call last): > File "", line 1, in ? > rs[12:15]='GAG' > TypeError: object doesn't support slice assignment > > You can't assign to a section of a sliced string in > Python 2.3 and there doesn'

Re: multithread exception handling

2005-09-19 Thread Steve Horsley
[EMAIL PROTECTED] wrote: > Hello. > > I have problem and I ask you for help. Probably there is some quite > easy solution, but I can't see it. > > I'm trying to perform some action that have to be timeout safe. So here > is the structure of my program: > > \\\ > d

slice lists

2005-09-19 Thread jbperez808
Reading: http://docs.python.org/ref/slicings.html it would seem to indicate that the ff will work: L=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] however, you get: >>> l[3:4:,5:8:] Traceback (most recent call last): File "", line 1, in ? l[3:4:,5:8:] TypeError: list indices must be integ

Re: very high-level IO functions?

2005-09-19 Thread Larry Bates
While it may "attempt" to recognize the types, it in fact cannot be more correct than the programmer. Example: data="""0X1E04 111""" That "looks" lile a hex and an int. But wait. What if it is instead two strings? In Python you can easily write a class with a interator that can read the data

Exception raised but in wrong thread?

2005-09-19 Thread Krzysztof Nowak
Hello. I hope you didn't receive that email before. I post this question once but there was some error. I have problem and I'm looking for help. Probably there is some quite easy solution, but I can't see it. I'm trying to perform some action that have to be timeout safe. So here is the structure

Re: slice lists

2005-09-19 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Reading: > > http://docs.python.org/ref/slicings.html > > it would seem to indicate that the ff will work: > > L=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] > > however, you get: > > >>> l[3:4:,5:8:] > Traceback (most recent call last): > File "", line 1, in ? >

Re: How am I doing?

2005-09-19 Thread Brett Hoerner
Wouldn't the standard idiom be to actually put the code under the if-name, and not make a whole new main() function? I'm not sure I see the reason behind main(), couldn't that also interfere with other modules since main() seems like it might be common, not sure how it would work as I'm pretty new

Re: threads/sockets quick question.

2005-09-19 Thread [EMAIL PROTECTED]
The problem may be something to do with using "threading" as identifier name. It is name of a module and definitely what you want it done anyway. You are better off having another variable as counter (with a different name). Raghu. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to program efficient pattern searches in a list of float numbers?

2005-09-19 Thread [EMAIL PROTECTED]
I am not interested in doing your homework. -- http://mail.python.org/mailman/listinfo/python-list

Windows paths, Java, and command-line arguments, oh my!

2005-09-19 Thread Steve M
I'm trying to invoke a Java command-line program from my Python program on Windows XP. I cannot get the paths in one of the arguments to work right. The instructions for the program describe the following for the command-line arguments: java -jar sforcedataloader.jar -Dsalesforce.config.dir=CONFI

Re: very high-level IO functions?

2005-09-19 Thread York
Caleb Hattingh wrote: > York > > Short answer: yes > Brilliant! and what are they? > We use python and R at work, and in general you will find python syntax > a little cleaner for functionality they have in common. R is better > for some of the more hard-wired stats stuff, though. I love

Re: very high-level IO functions?

2005-09-19 Thread York
Your are right, a program cannot be smarter than its programmer. However I need a program to parse any table-format data files offered by user. R offer such a function, I hope python such a function too. -York > While it may "attempt" to recognize the types, it in fact cannot > be more correct

ANN: PyTrilinos (wrapper for parallel linear algebra)

2005-09-19 Thread beliavsky
PyTrilinos is a Python wrapper for the Trilinos linear algebra library. It is described at http://software.sandia.gov/trilinos/packages/pytrilinos/index.html and in more detail in the PDF file at that site. It was just announced on NA Digest. I have not tried it myself. Here are some quotes from t

Re: very high-level IO functions?

2005-09-19 Thread Bruno Desthuilliers
York a écrit : (snip) > I love python. However, as a biologist, I like some high-levels > functions in R. I don't want to spend my time on parse a data file. http://www.python.org/doc/current/lib/module-csv.html > Then > in my python script, I call R to read data file and write them into an >

Re: Windows paths, Java, and command-line arguments, oh my!

2005-09-19 Thread Robert Kern
Steve M wrote: > I'm trying to invoke a Java command-line program from my Python program > on Windows XP. I cannot get the paths in one of the arguments to work > right. > > The instructions for the program describe the following for the > command-line arguments: > > java -jar sforcedataloader.ja

Re: C#3.0 and lambdas

2005-09-19 Thread Paul Rubin
Michael Ekstrand <[EMAIL PROTECTED]> writes: > > def drawline((x1, y1), (x2, y2)): > > # draw a line from x1, y1 to x2, y2 > > foo(x1, y1) > > bar(x2, y2) > > Yow! I did not know you could even do this. > > My vote would be +1 for keeping them in the language... they look far > too u

Barcode Recognition

2005-09-19 Thread Rob Cowie
I'd like to be able to take a bitmapped image and identify and decode any barcodes present within it. Does anyone know of an existing module for accomplishing this task? Is there any effort to add this functionality to the Python Imaging Library? Can anyone give me an idea of how diffucult an und

Re: very high-level IO functions?

2005-09-19 Thread Larry Bates
It's so easy (using csv module), no need to build in. You can wrap in a class if you want to make even easier. Same can be done for tables from SQL database. import csv fp=open(r'C:\test.txt', 'r') # # test.txt contains: # # "record","value1","value2" # "1","2","3" # "2","4","5" # "3","6","7" tabl

Re: Best Encryption for Python Client/Server

2005-09-19 Thread James Stroud
SSH can be used for functionality like this, through tunneling. You can even tunnel interprocess communication through SSH. Its not exceptionally complicated. On Sunday 18 September 2005 13:36, Ed Hotchkiss wrote: > Let us say that I am trying to create a very small and simple private > networ

Re: p2exe using wine/cxoffice

2005-09-19 Thread James Stroud
On Saturday 17 September 2005 10:29, Tim Roberts wrote: > James Stroud <[EMAIL PROTECTED]> wrote: > >I think the motivation is to ween people off of M$ products altogether, > > Well, CrossOver Office doesn't really do that. You're still running > Microsoft Office. > > >...to get > >them used to wo

RE: Why is map() preferable in this case?

2005-09-19 Thread Delaney, Timothy (Tim)
Devan L wrote: > Map is in C. It's faster, but not as clear. Some people do think > map(f, L) is nicer though. Google is your friend here, if you want to > read the old arguments. map() will be faster if the function you are calling from map() is *also* in coded in C. If it's coded in python, the

RE: style question: anything wrong with super(type(self), self).f() ?

2005-09-19 Thread Delaney, Timothy (Tim)
As Tom said, using super(type(self), self) will fail when your class gets subclassed. Otherwise we wouldn't have needed that kind of syntax in the first place. You may be interested in my self.super recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286195 and the considerably faster

Re: Barcode Recognition

2005-09-19 Thread D.Hering
Hi Rob, I think ADaM is exactly what your looking for. Let me know what you think about it. http://datamining.itsc.uah.edu/adam/ Dieter -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows paths, Java, and command-line arguments, oh my!

2005-09-19 Thread Daniel Dittmar
Steve M wrote: > I'm trying to invoke a Java command-line program from my Python program > on Windows XP. I cannot get the paths in one of the arguments to work > right. > > The instructions for the program describe the following for the > command-line arguments: > > java -jar sforcedataloader.ja

RE: inspect getsource() minor fix?

2005-09-19 Thread Delaney, Timothy (Tim)
Ron Adam wrote: > While playing around with the inspect module I found that the > Blockfinder doesn't recognize single line function definitions. > > Adding the following two lines to it fixes it, but I'm not sure if it > causes any problems anywhere else. > > elif self.indent == 0: >

Re: Windows paths, Java, and command-line arguments, oh my!

2005-09-19 Thread Steve M
Well, apparently I fried my brain trying to sort this out. There is a typo in my example code in the post but not in my real program. (I know it is a no-no when asking help on c.l.py but I simplified some details from the real code in order not to confuse the issues. Probably backfired by this poin

Re: Question About Logic In Python

2005-09-19 Thread Bengt Richter
On Mon, 19 Sep 2005 23:46:05 +1000, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >On Mon, 19 Sep 2005 12:16:15 +0200, sven wrote: > >> to make sure that an operation yields a boolean value wrap a bool() >> around an expression. >> None, 0 and objects which's len is 0 yield False. >> so you can also

Re: Why is map() preferable in this case?

2005-09-19 Thread Steven Bethard
Delaney, Timothy (Tim) wrote: > Devan L wrote: > >>Map is in C. It's faster, but not as clear. Some people do think >>map(f, L) is nicer though. Google is your friend here, if you want to >>read the old arguments. > > map() will be faster if the function you are calling from map() is > *also* in

Re: How to program efficient pattern searches in a list of float numbers?

2005-09-19 Thread Bengt Richter
On 19 Sep 2005 00:02:34 -0700, "malv" <[EMAIL PROTECTED]> wrote: >Simple case: >In this list, how to find all occurences of intervals of n adjacent >indexes having at least one list-member with a value between given >limits. >Visualizing the list as a two-dimensional curve, this is like >horizonta

undefined symbol: PyUnicodeUCS4*

2005-09-19 Thread Analabha Roy
Hi, I'm running Fedora Core 3, and recently I've encountered serious problems with apps that need python to run. running any such app gives errors like: ImportError: /usr/lib/python2.3/site-packages/rhpl/iconv.so: undefined symbol: PyUnicodeUCS4_AsUTF8String Well, all apps dont produce sa

Re: C#3.0 and lambdas

2005-09-19 Thread Terry Reedy
"Paul Rubin" <"http://phr.cx"@NOSPAM.invalid> wrote in message news:[EMAIL PROTECTED] > I'm +1 for keeping them in the language and +1000 on keeping them > in Python 2.5. Removing them would break existing code and therefore > should not be done until Python 3.0 if at all. I believe the idea of

Re: slicing functionality for strings / Python suitability forbioinformatics

2005-09-19 Thread Terry Reedy
"Reinhold Birkenfeld" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > [EMAIL PROTECTED] wrote: > rs='AUGCUAGACGUGGAGUAG' > rs[12:15]='GAG' >> Traceback (most recent call last): >> File "", line 1, in ? >> rs[12:15]='GAG' >> TypeError: object doesn't support slice assig

Re: How am I doing?

2005-09-19 Thread Jason
I've restructured my code with the assistance of George and Mike which is now as follows... import random class HiScores: def __init__(self,hiScores): self.hiScores=[(entry[:5],entry[5:]) for entry in hiScores] def showScores(self): for name,score in self.hiScores:

Re: Free seminar on domain-specific modeling

2005-09-19 Thread Peter Hansen
Martijn Iseger wrote: > Domain-specific modeling makes software development 5-10 times faster > than approaches based on UML or MDA. It accelerates development and > reduces complexity by automatically generating full code from > higher-abstraction design models. Wow, look everyone! A silver b

web scrapping - POST and auto-login

2005-09-19 Thread james hal-pc.org
please excuse my ignorance of Python. i know enough to be dangerous (was able however to make Freevo support my FM tuner with a little hacking). Ultimate goal: read N bytes from PATTERN on page A into VARIABLE. POST VARIABLE into TABLE on site B. email VARIABLE to myself. what i have to work wi

Re: Best Encryption for Python Client/Server

2005-09-19 Thread Ed Hotchkiss
  Is SSL something which needs a script to register (and pay for) a certificate, or is it just another form of encryption ... also - is there a free implementation of OpenSSL for windows, and is openSSL a default application with *NIX? Thanks.   On 9/19/05, James Stroud <[EMAIL PROTECTED]> wrote:

Re: How to program efficient pattern searches in a list of float numbers?

2005-09-19 Thread Bengt Richter
On Mon, 19 Sep 2005 22:58:40 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote: >On 19 Sep 2005 00:02:34 -0700, "malv" <[EMAIL PROTECTED]> wrote: > >>Simple case: >>In this list, how to find all occurences of intervals of n adjacent >>indexes having at least one list-member with a value between given >

Re: How am I doing?

2005-09-19 Thread John Hazen
* Jason <[EMAIL PROTECTED]> [2005-09-19 16:28]: > I've restructured my code with the assistance of George and Mike which > is now as follows... > > import random > > class HiScores: > def __init__(self,hiScores): > self.hiScores=[(entry[:5],entry[5:]) for entry in hiScores] With y

Re: Best Encryption for Python Client/Server

2005-09-19 Thread Robert Kern
Ed Hotchkiss wrote: > > Is SSL something which needs a script to register (and pay for) a > certificate, or is it just another form of encryption ... also - is > there a free implementation of OpenSSL for windows, and is openSSL a > default application with *NIX? > Thanks. It's SS*H*, and you're

Re: inspect getsource() minor fix?

2005-09-19 Thread Ron Adam
Delaney, Timothy (Tim) wrote: > Ron Adam wrote: > > >>While playing around with the inspect module I found that the >>Blockfinder doesn't recognize single line function definitions. >> >>Adding the following two lines to it fixes it, but I'm not sure if it >>causes any problems anywhere else. >>

Re: Best Encryption for Python Client/Server

2005-09-19 Thread Ed Hotchkiss
  I apologize for misreading your H my dear professor. Perhaps you can google:asshole and see if your image is present, I would highly doubt that it is not within the first page of results.   I'm sorry that I did not see the message in the thread which recommended SSH rather than SSL. There is no

ANNOUNCE: KirbyBase 1.9

2005-09-19 Thread Jamey Cribbs
KirbyBase is a simple, plain-text, database management system written in Python. It can be used either embedded in a python script or in a client/server, multi-user mode. You use python code to express your queries instead of having to use another language such as SQL. KirbyBase is disk-base

Re: Best Encryption for Python Client/Server

2005-09-19 Thread Peter Decker
On 9/19/05, Ed Hotchkiss <[EMAIL PROTECTED]> wrote: > Perhaps you can > google:asshole and see if your image is present, I would highly doubt that > it is not within the first page of results. Now that's a reply I'm gonna have to copy!!! ;-) -- # p.d. -- http://mail.python.org/mailman/listi

Re: How am I doing?

2005-09-19 Thread Andrew Durdin
On 9/20/05, Jason <[EMAIL PROTECTED]> wrote: > class HiScores: > def __init__(self,hiScores): > self.hiScores=[(entry[:5],entry[5:]) for entry in hiScores] In your original code, you were using slicing to extract the first five digits (being the score) from the string; now that you'r

Re: How to write this iterator?

2005-09-19 Thread George Sakkis
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Sorry, my description was not very good, I meant something behaving as: > > >>>example=Liter("abc","12345","XY") > >>>for x in example: print x, > > a 1 X b 2 Y c 3 4 5 > > or for that append() method, > > >>>example=Liter("abc", "12345"

ANNOUNCE: Mod_python 3.2.2 Beta

2005-09-19 Thread Gregory (Grisha) Trubetskoy
The Apache Software Foundation and The Apache HTTP Server Project are pleased to announce the 3.2.2 Beta release mod_python. Version 3.2.2b of mod_python features several new functions and attributes providing better access to apache internals, file-based sessions and other session improvement

Re: slice lists

2005-09-19 Thread jbperez808
> Lists are one-dimensional. They can only take one slice, not two. Ah ok, I thought l[3:4,5:8] would return [3,5,6,7] -- http://mail.python.org/mailman/listinfo/python-list

Re: slicing functionality for strings / Python suitability for bioinformatics

2005-09-19 Thread jbperez808
right, i forgot about that... -- http://mail.python.org/mailman/listinfo/python-list

Re: Best Encryption for Python Client/Server

2005-09-19 Thread Robert Kern
Ed Hotchkiss wrote: > > I apologize for misreading your H my dear professor. Perhaps you can > google:asshole and see if your image is present, I would highly doubt > that it is not within the first page of results. > > I'm sorry that I did not see the message in the thread which recommended >

Re: slicing functionality for strings / Python suitability forbioinformatics

2005-09-19 Thread jbperez808
Having to do an array.array('c',...): >>> x=array.array('c','ATCTGACGTC') >>> x[1:9:2]=array.array('c','') >>> x.tostring() 'AACAGACATC' is a bit klunkier than one would want, but I guess the efficient performance is the silver lining here. -- http://mail.python.org/mailman/listinfo

Re: How am I doing?

2005-09-19 Thread Mike Meyer
"Brett Hoerner" <[EMAIL PROTECTED]> writes: > Wouldn't the standard idiom be to actually put the code under the > if-name, and not make a whole new main() function? Depends on how big the main() function is. By making it a function, you make it possible for other modules to run it directly. In pa

Re: slicing functionality for strings / Python suitability for bioinformatics

2005-09-19 Thread Sebastian Bassi
On 19 Sep 2005 12:25:16 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >>> rs='AUGCUAGACGUGGAGUAG' > >>> rs[12:15]='GAG' > Traceback (most recent call last): > File "", line 1, in ? > rs[12:15]='GAG' > TypeError: object doesn't support slice assignment You should try Biopython (www.bi

Re: web scrapping - POST and auto-login

2005-09-19 Thread james hal-pc.org
"james hal-pc.org" wrote: > the entire 26 character string from site A, but [1] how do i crop it to > 10 characters. [1] still at a loss on this one, but i can get to it later, unless you've got any ideas. > [2] how can i then auto-login to site B (the router's web config via > pop-up dialo

Re: slicing functionality for strings / Python suitability forbioinformatics

2005-09-19 Thread jbperez808
Great suggestion... I was naively trying to turn the string into a list and slice that which I reckon would be significantly slower. -- http://mail.python.org/mailman/listinfo/python-list

Re: Question About Logic In Python

2005-09-19 Thread Ron Adam
Steven D'Aprano wrote: > On Mon, 19 Sep 2005 12:16:15 +0200, sven wrote: > > >>to make sure that an operation yields a boolean value wrap a bool() >>around an expression. >>None, 0 and objects which's len is 0 yield False. >>so you can also do stuff like that: > > > Are there actually any usa

Re: web scrapping - POST and auto-login

2005-09-19 Thread Max Erickson
"james hal-pc.org" wrote in news:[EMAIL PROTECTED]: > "james hal-pc.org" wrote: >> the entire 26 character string from site A, but [1] how do i >> crop it to 10 characters. > > [1] still at a loss on this one, but i can get to it later, > unless you've got any ideas. strings are slicable: >>

Re: web scrapping - POST and auto-login

2005-09-19 Thread Jonathan Ellis
"james hal-pc.org" wrote: >I'm trying to update the WEP key on a wireless router via script and > email the results to myself. this will be run once a week. Look up Mechanize (http://wwwsearch.sourceforge.net/mechanize/) or the more low-level ClientForm by the same author. This will be _muc

Re: Best Encryption for Python Client/Server

2005-09-19 Thread Ed Hotchkiss
No worries, I apologize for my outburst. I will check out the viability of using an SSH module, or using pyCrypto or something to encrypt the data.   Here's my mission: simple P2P class with encryption of whatever type of file is being sent, and authentication via encrypted user name/password. So

Python OGL Shader Programming

2005-09-19 Thread Michael Schneider
Just curious, is anyone using python for OGL 2.0 shader language development? Which lib are you using? Thanks, Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: web scrapping - POST and auto-login

2005-09-19 Thread james hal-pc.org
Max Erickson wrote: >>>the entire 26 character string from site A, but [1] how do i >>>crop it to 10 characters. > > strings are slicable: The only reason i've gotten this far is a basic understanding of syntax and programming in general :) care to enlighten me a little on how to do that? > As

Re: web scrapping - POST and auto-login

2005-09-19 Thread james hal-pc.org
Jonathan Ellis wrote: > "james hal-pc.org" wrote: > >> I'm trying to update the WEP key on a wireless router via script and >>email the results to myself. this will be run once a week. > > > Look up Mechanize (http://wwwsearch.sourceforge.net/mechanize/) or the > more low-level ClientForm by

Re: web scrapping - POST and auto-login

2005-09-19 Thread Max Erickson
"james hal-pc.org" wrote in news:[EMAIL PROTECTED]: > Max Erickson wrote: the entire 26 character string from site A, but [1] how do i crop it to 10 characters. >> >> strings are slicable: > > The only reason i've gotten this far is a basic understanding of > syntax and programming in

Re: web scrapping - POST and auto-login

2005-09-19 Thread james hal-pc.org
Max Erickson wrote: > strings are slicable: wep64 = wep128[0:10] sorry for the stupid question. thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: web scrapping - POST and auto-login

2005-09-19 Thread james hal-pc.org
What i have so far: #!/usr/local/bin/python from urllib import urlopen from ClientForm import ParseResponse from re import search URL = "http://www.hal-pc.org/networking/cgi-bin/wepgen.cgi"; pattern = "*([0-9,a-f,]*)" doc = urlopen(URL).read() result = search(pattern, doc) w

Re: web scrapping - POST and auto-login

2005-09-19 Thread james hal-pc.org
What i have so far: #!/usr/local/bin/python from urllib import urlopen from ClientForm import ParseResponse from re import search URL = "http://www.hal-pc.org/networking/cgi-bin/wepgen.cgi"; pattern = "*([0-9,a-f,]*)" doc = urlopen(URL).read() result = search(pattern, doc) w

Re: undefined symbol: PyUnicodeUCS4*

2005-09-19 Thread Fredrik Lundh
Analabha Roy wrote: > I'm running Fedora Core 3, and recently I've encountered serious problems > with apps that need python to run. > > running any such app gives errors like: > > ImportError: /usr/lib/python2.3/site-packages/rhpl/iconv.so: undefined > symbol: PyUnicodeUCS4_AsUTF8String > > Well

Re: C#3.0 and lambdas

2005-09-19 Thread Bryan
Diez B. Roggisch wrote: >>meanwhile, over in python-dev land: >> >>"Is anyone truly attached to nested tuple function parameters; 'def >>fxn((a,b)): print a,b'? /.../ >> >>Would anyone really throw a huge fit if they went away? I am willing >>to write a PEP for their removal in 2.

Re: Can someone explain what I've done wrong...

2005-09-19 Thread Tim Roberts
Jason <[EMAIL PROTECTED]> wrote: > >Have to say, I was confused with the post (I received via email, Want to have even more fun? Rename the variable "Sophie" to "Mophie", and your script will work just as you expect. >can't >see it on the newsgroup yet) from Astan Chee saying he couldn't >unde

Re: functional or object-oriented?

2005-09-19 Thread beza1e1
You are right, this is not the essence of functional programming. Functional and procedural python code would look quite the same (at least in pydoc). It is the implementation of my functions, wether they are functional or procedural. If i use global variables, it is not functional any more. Whil

RE: Can someone explain what I've done wrong...

2005-09-19 Thread Delaney, Timothy (Tim)
Tim Roberts wrote: > Everything works OK while your script runs. When the script exits, > your "main" module goes to clean things up. Apparently, it does so > alphabetically. Nope - it would do it in the iteration order of the module's __dict__. Not something that can be relied on. Tim Delaney

Re: functional or object-oriented?

2005-09-19 Thread beza1e1
This nails it down, yes. :) I probably was too deep into OOP thinking-mode to work pythonic. So i am now rediscovering the python way. Have you read Paul Grahams On Lisp (or was it one of his essays)? He is strongly in favor of functional programming. Mainly because Lisp favors it. He does say th

Re: Python game coding

2005-09-19 Thread simonwittber
This article describes a system very similar to my own. The LGT library (http://developer.berlios.de/projects/lgt) provides a simple, highly tuned 'microthread' implementation using generators. It is called NanoThreads. It allows a microthread to be paused, resumed, and killed, but not pickled.

Re: Searching for a working example of a curses application that resizesin xterm

2005-09-19 Thread schwerdy
Thanks, but I had already read these discussions (hope the grammar is correct...), and thought I understood them. But my exact problem: If I resize a xterm, in most cases curses prints crap (if it does not crash python). And I could not find any python-curses application that is displayed correctly

Re: Why is map() preferable in this case?

2005-09-19 Thread Ray
Delaney, Timothy (Tim) wrote: > map() will be faster if the function you are calling from map() is > *also* in coded in C. If it's coded in python, then the generator > expression will probably be faster. > > Use whatever reads better to you. Look at optimising when you need to, > and not before.

<    1   2