Re: Possible memory leak?

2006-01-24 Thread Steven D'Aprano
Tuvas wrote: > However, I would like to make a few more statements. The max image size > is 1024x1024. The length of time it takes to do the row statement > increased fairly substationally every time it was ran, in the order of > ~.5%. That seems small, but when you run it 1M times, the last > ope

Re: Loop exception catching

2006-01-24 Thread Fredrik Lundh
Aldo Cortesi wrote: > > What do you mean? > > Well, the problem with "input" is that it allows the user to supply an > arbitrary Python expression, which will then be executed. Among other things, > this means that your pet cat could make your script exit due to an uncaught > exception by simply w

Re: Possible memory leak?

2006-01-24 Thread Steven D'Aprano
Tuvas wrote: > Oh, I should also mention, I used a memory monitor and saw the amount > of memory being used go up with time, even when the function ended, > meaning I did the 10 128x128 pictures, never was any memory dealocated > until I exited the program. Are you really trying to say that the a

Re: Real-world use cases for map's None fill-in feature?

2006-01-24 Thread Steven D'Aprano
[EMAIL PROTECTED] wrote: >>4. A terminating bug is preferred to a non-terminating bug. > > > This is not self-evident to me. Is this somehow > related to the design philosophy of functional > languages? I was never aware of such a preference > in conventional procedural languages (though I > c

Re: Using non-ascii symbols

2006-01-24 Thread Robert Kern
James Stroud wrote: > Robert Kern wrote: > >>James Stroud wrote: >> >>>I can't find "≤, ≥, or ≠" on my keyboard. >> >>Get a better keyboard? or OS? > > Please talk to my boss. Tell him I want a Quad G5 with about 2 Giga ram. > I'll by the keyboard myself, no problemo. Alternatively, you can sim

Re: Is there a way to profile underlying C++ code?

2006-01-24 Thread Travis E. Oliphant
Bo Peng wrote: > Dear list, > > I have a C++-SWIG-wrapped python module. The running time for one of the > functions is pretty unpredictable so I would like to profile it. > However, the python profiler does not seem to enter the compiled module > (.so file). Is there a way to profile the C++ f

Is there a way to profile underlying C++ code?

2006-01-24 Thread Bo Peng
Dear list, I have a C++-SWIG-wrapped python module. The running time for one of the functions is pretty unpredictable so I would like to profile it. However, the python profiler does not seem to enter the compiled module (.so file). Is there a way to profile the C++ functions? Many thanks in a

Re: Loop exception catching

2006-01-24 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > He'd sure empty your bank account and hard drive, but even he wouldn't > send your porn to your mom, that's just... *mean*!-) He'd send kitty porn, except no one would figure it out ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Loop exception catching

2006-01-24 Thread Alex Martelli
Paul Rubin wrote: > [EMAIL PROTECTED] (Alex Martelli) writes: > > I thought I knew some pretty evil cats, but I see my experience with > > felines was nothing compared to yours! > > Catbert? He'd sure empty your bank account and hard drive, but even he wouldn't send yo

Re: Using non-ascii symbols

2006-01-24 Thread James Stroud
Robert Kern wrote: > James Stroud wrote: > > >>I can't find "≤, ≥, or ≠" on my keyboard. > > > Get a better keyboard? or OS? Please talk to my boss. Tell him I want a Quad G5 with about 2 Giga ram. I'll by the keyboard myself, no problemo. > On OS X, > > ≤ is Alt-, > ≥ is Alt-. > ≠ is Alt-=

Re: Dynamic pull down menus (CGI)

2006-01-24 Thread [EMAIL PROTECTED]
You will be quite limited without the use of JavaScript to perform this kind of dynamic functionality. HTML alone cannot do this. You can use dynamically generated Javascript, AJAX, Flash or Java. One possible would be to just use HTML forms and add in an extra button click after the user makes th

Re: Loop exception catching

2006-01-24 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > I thought I knew some pretty evil cats, but I see my experience with > felines was nothing compared to yours! Catbert? -- http://mail.python.org/mailman/listinfo/python-list

Re: Loop exception catching

2006-01-24 Thread Alex Martelli
Aldo Cortesi <[EMAIL PROTECTED]> wrote: ... > this means that your pet cat could make your script exit due to an uncaught > exception by simply walking accross your keyboard. If your cat is sufficiently > clever, it could also empty your bank account, email your entire porn > collection to your

Re: Loop exception catching

2006-01-24 Thread Aldo Cortesi
Thus spake Ivan Shevanski ([EMAIL PROTECTED]): > Thanks, that seems to work fine. But about your other comment. . . > > >Well, leaving aside the merits of using "input" (which should be avoided at > >all costs) > > What do you mean? Well, the problem with "input" is that it allows the user to su

Re: Is there a maximum length of a regular expression in python?

2006-01-24 Thread fuzzylollipop
this should really be posted to http://www.thedailywtf.com/, I wonder if they have a german version of TheDailyWTF.com? -- http://mail.python.org/mailman/listinfo/python-list

Re: logging into secure website with script

2006-01-24 Thread James Stroud
dpoehls wrote: > Hello there, > > I am new to python, and shell scriping in general..I have done quite a > bit of php, but that it about it. Anyhow, I am wondering if it would be > possible to write a python script that would login to a password > enabled site (qmailadmin) and then be able to add

logging into secure website with script

2006-01-24 Thread dpoehls
Hello there, I am new to python, and shell scriping in general..I have done quite a bit of php, but that it about it. Anyhow, I am wondering if it would be possible to write a python script that would login to a password enabled site (qmailadmin) and then be able to add a new account. I imagine i

Dynamic pull down menus (CGI)

2006-01-24 Thread Keith Burns
Hi, I have seen two entries in the archives for this topic: 1. Uses hypertext, not a pulldown menu to feed parameters back to the python CGI 2. The other actually used Java. Is there a way using Python for CGI such that when a user selects an item from one pull down menu (ie FRUIT or VEGETABLE

Re: Possible memory leak?

2006-01-24 Thread Tuvas
Oh, I should also mention, I used a memory monitor and saw the amount of memory being used go up with time, even when the function ended, meaning I did the 10 128x128 pictures, never was any memory dealocated until I exited the program. -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible memory leak?

2006-01-24 Thread Tuvas
Hmm. The problem is that the required form for the image is as a string of characters to convert with the tkimage interface, at least, as I understood it. Perhaps an array would work, I'll try that when I get ahold of the computer in question (One thing required is a linux only library, and I don't

Codec Search Function

2006-01-24 Thread James Stroud
Hello All, I'm using pyinstaller 1.0 (stable) on win32xp and it is not able to find the codec for several encodings (hex, base64, etc.). I resorted to writing my own for hex, just to see if I could get my program deployed. But I think a more permanent solution would be to get pyinstaller worki

Re: Real-world use cases for map's None fill-in feature?

2006-01-24 Thread Andrae Muys
[EMAIL PROTECTED] wrote: > > 4. A terminating bug is preferred to a non-terminating bug. > > This is not self-evident to me. Is this somehow > related to the design philosophy of functional > languages? I was never aware of such a preference > in conventional procedural languages (though I > cou

Re: "wxPython in Action" book

2006-01-24 Thread Dave Cook
On 2006-01-24, Iain King <[EMAIL PROTECTED]> wrote: > New book on wxPython: http://www.manning.com/books/rappin > > Release date of this month. Does anyone know if it's out yet / has > anyone read it and has an opinion? Someone (the author?) on the wxpython-users mailing list said it was delayed

Re: Possible memory leak?

2006-01-24 Thread Travis E. Oliphant
Tuvas wrote: > I have a function in a program that works something like this. > > def load_pic_data(width,heigth,inpdat, filt=TRUE): > data='' > total=0 > tnum=0 > size=100 > for y in range(0,heigth): > row='' > for x in range

Re: Possible memory leak?

2006-01-24 Thread Stephen Kellett
In message <[EMAIL PROTECTED]>, Steven D'Aprano <[EMAIL PROTECTED]> writes >But the real killer is this one line: > >row=row+chr(num/64) > >Bad, bad BAD idea. Every time you add two strings together, Python has to >copy BOTH strings. As row gets huge, this takes longer and longer to do. > >A rule o

Re: Weird generator id() behaviour (was Re: Python code written in1998, howto improve/change it?)

2006-01-24 Thread Carl Cerecke
Adding a continue statemtent after the yield statements yields :-) a speed increase. Still not as good as functions though. (about 30% slower) Cheers, Carl Carl Cerecke wrote: > Carl Cerecke wrote: > Generator FSM done properly (well, better anyway). They are still almost > twice as slow as pla

Re: Weird generator id() behaviour (was Re: Python code written in1998, how to improve/change it?)

2006-01-24 Thread Carl Cerecke
Carl Cerecke wrote: > Fredrik Lundh wrote: > >> Carl Cerecke wrote: >> >> >>> It turns out that generators are more efficient than the eval function >>> excuting bits of compiled code. About 20-25% faster. >> >> >> >> why are you using generators to return things from a function, when >> you can j

Re: Pulling numbers from ASCII filename not working

2006-01-24 Thread Fredrik Lundh
"IamIan" <[EMAIL PROTECTED]> wrote: > The exception I get is "TypeError: Cannot add value 'int' to string." now that you've posted the exception, can you please post the code you're using, and the *complete* traceback. (the stuff you posted earlier contained syntax errors, and didn't con- tain a

Re: Is there a maximum length of a regular expression in python?

2006-01-24 Thread Frithiof Andreas Jensen
"Bryan Olson" <[EMAIL PROTECTED]> skrev i en meddelelse news:[EMAIL PROTECTED] > Roy Smith wrote: > Does no one care about an internal error in the regular expression > engine? Yes, but - given the example - In about the same way that I care about an internal error in my car engine after dropp

Re: obtain client ip address from SimpleXMLRPCServer ?

2006-01-24 Thread Peter Gsellmann
[EMAIL PROTECTED] wrote: > Is it possible to obtain the client's ip address from a > SimpleXMLRPCServer instance or subclass instance? When running > SimpleXMLRPCServer with logRequests = 1, the xmlrpc server prints out > the fqdn on the console, however, I'm not sure if this information > (eithe

Re: Weird generator id() behaviour (was Re: Python code written in1998, how to improve/change it?)

2006-01-24 Thread Carl Cerecke
Fredrik Lundh wrote: > Carl Cerecke wrote: > > >>It turns out that generators are more efficient than the eval function >>excuting bits of compiled code. About 20-25% faster. > > > why are you using generators to return things from a function, when > you can just return the things ? Trying to

Re: Possible memory leak?

2006-01-24 Thread Paul Rubin
Paul Rubin writes: > Probably better to use StringIO or the array module. That's cStringIO of course. -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible memory leak?

2006-01-24 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > row = [] > # processing in a loop... > row.append(chr(num/64) > # finished processing > row = "".join(row) # convert to a string in one hit > print row Probably better to use StringIO or the array module. -- http://mail.python.org/mailman/listinfo/py

Re: socket examples

2006-01-24 Thread Bryan Olson
le dahut wrote: > I've read the Gordon McMillan's "Socket Programming HOWTO" Just a few days ago, another participant in this group noted that code in Gordon McMillan's "Socket Programming HOWTO" does not work. He was right. The code is wrong. Currently, one can Google up "Python socket howto",

ANN: ActivePython 2.4.2.10 is now available

2006-01-24 Thread Trent Mick
I'm happy to announce that ActivePython 2.4.2.10 is now available for free download from: http://www.ActiveState.com/Products/ActivePython/ This release is a maintenance/update release for existing platforms and adds support for three new ones: Mac OS X/x86, Windows/x64 and Linux/x86_64. See

Re: Pulling numbers from ASCII filename not working

2006-01-24 Thread IamIan
The exception I get is "TypeError: Cannot add value 'int' to string." I have looked at LatString, and it is the string representation of latitude ('17' etc.). What's odd is that the exception is raised not when I include LatInt = int(LatString), but when I try to print LatInt's value or multiply it

Re: Weird generator id() behaviour (was Re: Python code written in 1998, how to improve/change it?)

2006-01-24 Thread Fredrik Lundh
Carl Cerecke wrote: > It turns out that generators are more efficient than the eval function > excuting bits of compiled code. About 20-25% faster. why are you using generators to return things from a function, when you can just return the things ? def f_on(): print "on" acti

Re: file_name_fixer.py

2006-01-24 Thread Bruno Desthuilliers
eww a écrit : (top-post corrected) > bruno at modulix wrote: > >>[EMAIL PROTECTED] wrote: >> >>>i put this together to fix a bunch of files with wierd names, please >>>gimme feedback, i am a newbie >> >>Ok, so let's go... Hope you won't hate me too much !-) (snip program and comments) > thanks

Re: Using non-ascii symbols

2006-01-24 Thread Steven D'Aprano
On Tue, 24 Jan 2006 15:58:35 -0600, Dave Hansen wrote: > On Wed, 25 Jan 2006 08:26:16 +1100 in comp.lang.python, Steven > D'Aprano <[EMAIL PROTECTED]> wrote: > >>On Tue, 24 Jan 2006 10:38:56 -0600, Dave Hansen wrote: >> >>> The latter, IMHO. Especially variable names. Consider i vs. ì vs. í >>>

Re: Possible memory leak?

2006-01-24 Thread Steven D'Aprano
On Tue, 24 Jan 2006 13:51:36 -0800, Tuvas wrote: > The purpose of this part of a program is to take a 14 bit numerical > representation and convert it to an 8 bit representation. This will > later be displayed as an image. However, I've noticed the following > about this code. I was noticing when

Re: Loop exception catching

2006-01-24 Thread Ivan Shevanski
On 1/23/06, Aldo Cortesi <[EMAIL PROTECTED]> wrote: Well, leaving aside the merits of using "input" (which should be avoided at allcosts), here's one way to do what you want:while 1:try:x = input("> ")break except SyntaxError:print "explain the problem here"Cheers,Al

Re: Converting date to milliseconds since 1-1-70

2006-01-24 Thread NateM
Thank you! If I am reading in dates as strings from a text file, like "5/11/1998", how do I convert that to a format I can pass into mktime? Thanks again. -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible memory leak?

2006-01-24 Thread Fredrik Lundh
Tuvas wrote: > I have a function in a program that works something like this. > > def load_pic_data(width,heigth,inpdat, filt=TRUE): > data='' > total=0 > tnum=0 > size=100 > for y in range(0,heigth): > row='' > for x in range

Re: Using non-ascii symbols

2006-01-24 Thread Dave Hansen
On Wed, 25 Jan 2006 08:26:16 +1100 in comp.lang.python, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >On Tue, 24 Jan 2006 10:38:56 -0600, Dave Hansen wrote: > >> The latter, IMHO. Especially variable names. Consider i vs. ì vs. í >> vs. î vs. ï vs. ... > >Agreed, but that's the programmer's fault

Re: Creating a more random int?

2006-01-24 Thread Steven D'Aprano
On Tue, 24 Jan 2006 09:36:49 -0800, Paul Rubin wrote: > Try reading bytes from os.urandom and converting them to ints in your > program. He'll have the same problem with them, since the problem isn't the quality of the randomness, but his intuition of what a random sequence should look like. --

Re: Weird generator id() behaviour (was Re: Python code written in 1998, how to improve/change it?)

2006-01-24 Thread Wolfgang Keller
On Tue, 24 Jan 2006 21:19:26 +0100, Carl Cerecke wrote (in article <[EMAIL PROTECTED]>): > def g_on(): > > print "on" > action = next_action() > if action == 'lift': > yield g_on() > elif action == 'push': > yield g_off() > else: > yield None >

Possible memory leak?

2006-01-24 Thread Tuvas
I have a function in a program that works something like this. def load_pic_data(width,heigth,inpdat, filt=TRUE): data='' total=0 tnum=0 size=100 for y in range(0,heigth): row='' for x in range(0,width):

Re: Creating a more random int?

2006-01-24 Thread Steven D'Aprano
On Tue, 24 Jan 2006 18:47:01 +0200, Steven Macintyre wrote: > Hi all, > > I need to retrieve an integer from within a range ... this works ... below > is my out puts ... it just does not seem so random ... You are choosing from six values. You should expect each value _about_ 17% of the time, i

Re: Some thougts on cartesian products

2006-01-24 Thread Christoph Zwerschke
I think this has been discussed thoroughgoing enough. All I wanted to say is that this proposal of building "Cartesian products" of strings is well-defined, in line with the mathematical concept of Cartesian products, and can be *sometimes* useful. I hope we agree on this, but if not we don't n

Re: Loading a Python collection from an text-file

2006-01-24 Thread [EMAIL PROTECTED]
Maybe YAML is what youre looking for... http://yaml.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Using non-ascii symbols

2006-01-24 Thread Steven D'Aprano
On Tue, 24 Jan 2006 10:38:56 -0600, Dave Hansen wrote: > The latter, IMHO. Especially variable names. Consider i vs. ì vs. í > vs. î vs. ï vs. ... Agreed, but that's the programmer's fault for choosing stupid variable names. (One character names are almost always a bad idea. Names which can be

Re: append to the end of a dictionary

2006-01-24 Thread Steven D'Aprano
On Tue, 24 Jan 2006 08:45:27 -0600, Tim Chase wrote: > To get them in a key-order, my understanding is that you have to > use something like > > keys = mydict.keys() > sort(keys) > orderedDict = [(k, mydict[k]) for k in keys] Did you test this before posting? >>> keys = ["a",

Re: Some thougts on cartesian products

2006-01-24 Thread Bryan Olson
Christoph Zwerschke wrote: > Bryan Olson wrote: > >> The claim "everything is a set" falls into the category of >> 'not even wrong'. > > No, it falls into the category of the most fundamental Mathematical > concepts. You actually *define* tuples as sets, or functions as sets or > relations as s

Re: append to the end of a dictionary

2006-01-24 Thread Steven D'Aprano
On Tue, 24 Jan 2006 16:01:48 +0100, Yves Glodt wrote: > that means I can neither have a dictionary with 2 identical keys but > different values...? Yes, that's correct. > I would need e.g. this: > (a list of ports and protocols, to be treated later in a loop) > > > > ports = {'5631': 'udp',

Re: Pulling numbers from ASCII filename not working

2006-01-24 Thread Larry Bates
At lest one of the filenames (or directories) being returned by os.listdir doesn't have integer value where you are looking. Remember that os.listdir returns subdirectories as well as files. You may want to look at using glob.glob() instead and limit it to *.asc. Secondly, filenames = [filename.l

Re: Python code written in 1998, how to improve/change it?

2006-01-24 Thread skip
Wolfgang> So basically if I want to write a long-running program in Wolfgang> Python, it would make sense to code all functions that are Wolfgang> likely to be called more than once as generators... If they need to resume their calculations from where they left off after the last yiel

Re: Oddities of Tkinter

2006-01-24 Thread Tuvas
I thought I mentioned that I'm running in linux, and yes, there are threads involved. I just don't know why on one machine that it would run so differently than another. As to re-writing my whole code, well, I've got around 2500 lines of code, and while re-writing would be faster I'm sure, I still

Re: Converting date to milliseconds since 1-1-70

2006-01-24 Thread gry
NateM wrote: > How do I convert any given date into a milliseconds value that > represents the number of milliseconds that have passed since January 1, > 1970 00:00:00.000 GMT? > Is there an easy way to do this like Date in java? > Thanks, > Nate The main module for dates and times is "datetime";

Weird generator id() behaviour (was Re: Python code written in 1998, how to improve/change it?)

2006-01-24 Thread Carl Cerecke
Wolfgang Keller wrote: > On Fri, 20 Jan 2006 05:16:57 +0100, Peter Hansen wrote > (in article <[EMAIL PROTECTED]>): > > >>I believe the more modern approach to this is to use generators in some >>way, yield each other as the next state. This way you avoid all almost >>all the function call ove

Re: Pulling numbers from ASCII filename not working

2006-01-24 Thread mrmakent
First: http://www.catb.org/~esr/faqs/smart-questions.html You say your program 'crashes' when it gets to 'int(LatString)'. I'm guessing (and it's entirely a guess, since you don't tell us) that you are getting an exception like 'ValueError: invalid literal for int(): whatever'. I'm guessing agai

CTI library interest?

2006-01-24 Thread gregarican
As part of a project I'm trying to port to Python I am planning on moving a CTI library it relies on into Python code. Previously the overall project as well as the associated library were written in Ruby. Specifically the CTI library utilizes TSAPI/CSTA for linking telephone equipment with IP comp

Re: getting a KeyError:'href' any ideas?

2006-01-24 Thread [EMAIL PROTECTED]
ok the syntax for next is this: b = n.findNext LordLaraby wrote: > You wrote: > > i have an > > href which looks like this: > > > > http://www.cnn.com";> > > > > here is my code > > for incident in row('td', {'class':'all'}): > > n = incident.findNextSibling('a', {

Re: Using non-ascii symbols

2006-01-24 Thread Christoph Zwerschke
Fredrik Lundh wrote: > umm. if you have an editor that can convert things back and forth, you > don't really need language support for "digraphs"... It would just be very impractical to convert back and forth every time you want to run a program. Python also supports tabs AND spaces though you

Re: www.mywebsite.py

2006-01-24 Thread Simon Brunning
On 1/24/06, Cyril Bazin <[EMAIL PROTECTED]> wrote: > Does someone ever tried (and succeed) to make an address like > "www.website.py". > I found that the .py extension is given to the paraguay. > > I found this link ( http://www.nic.py/) but I don't speak spanish... > > If someone has more informat

Re: Using non-ascii symbols

2006-01-24 Thread Dave Hansen
On Tue, 24 Jan 2006 19:44:28 +0100 in comp.lang.python, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: >Dave Hansen wrote: >> C uses ! as a unary logical "not" operator, so != for "not equal" just >> seems to follow, um, logically. > >Consequently, C should have used !> for <= and !< for >= ... W

Re: Python code written in 1998, how to improve/change it?

2006-01-24 Thread Wolfgang Keller
On Fri, 20 Jan 2006 05:16:57 +0100, Peter Hansen wrote (in article <[EMAIL PROTECTED]>): > I believe the more modern approach to this is to use generators in some > way, yield each other as the next state. This way you avoid all almost > all the function call overhead (the part that takes signi

Re: getting a KeyError:'href' any ideas?

2006-01-24 Thread [EMAIL PROTECTED]
what is the syntax used to find a child of td? Mike Meyer wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > Please use less whitespace in your posts in the future. There's really > no need to put two blank lines between sections. > > > i have an > > href which looks like this: > > > >

Re: Using non-ascii symbols

2006-01-24 Thread Claudio Grondi
Christoph Zwerschke wrote: > Claudio Grondi wrote: > >> There is no symbol coming to my mind, but I would be glad if it would >> express, that 'a' becomes a reference to a Python object being >> currently referred by the identifier 'b' (maybe some kind of <-> ?). > > > With unicode, you have a

Re: Using non-ascii symbols

2006-01-24 Thread Christoph Zwerschke
Dave Hansen wrote: >> Once you open your mind for using non-ascii symbols, I'm sure one can >> find a bunch of useful applications. Variable names could be allowed to >> be non-ascii, as in XML. Think class names in Arabian... Or you could >> use Greek letters if you run out of one-letter variab

Re: list comprehention

2006-01-24 Thread Paddy
Umm, My answer is not correct, but for a different reason; it seems you need the length of my previous answer, thus: PythonWin 2.4 (#60, Feb 9 2005, 19:03:27) [MSC v.1310 32 bit (Intel)] on win32. Portions Copyright 1994-2004 Mark Hammond ([EMAIL PROTECTED]) - see 'Help/About PythonWin' for furth

Re: socket examples

2006-01-24 Thread Bryan Olson
le dahut wrote: > I have a server that receives data from a client, detect the end of this > data and send other data back to the client (it's to measure bandwidth). > I think the best way is to thread a part of the server's program am I > right ? Others disagree on this, but in most cases, yes:

Converting date to milliseconds since 1-1-70

2006-01-24 Thread NateM
How do I convert any given date into a milliseconds value that represents the number of milliseconds that have passed since January 1, 1970 00:00:00.000 GMT? Is there an easy way to do this like Date in java? Thanks, Nate -- http://mail.python.org/mailman/listinfo/python-list

www.mywebsite.py

2006-01-24 Thread Cyril Bazin
Does someone ever tried (and succeed) to make an address like "www.website.py".I found that the .py extension is given to the paraguay.I found this link ( http://www.nic.py/) but I don't speak spanish... If someone has more informations...Cyril -- http://mail.python.org/mailman/listinfo/python-lis

Pulling numbers from ASCII filename not working

2006-01-24 Thread IamIan
I searched the archives but couldn't find anyone else with this problem. Basically I'm grabbing all ASCII files in a directory and doing geoprocessing on them. I need to calculate a z-factor based on the latitude of the ASCII file being worked on, which is in the filename. If I type in the code man

Re: Using non-ascii symbols

2006-01-24 Thread Christoph Zwerschke
Dave Hansen wrote: > C uses ! as a unary logical "not" operator, so != for "not equal" just > seems to follow, um, logically. Consequently, C should have used !> for <= and !< for >= ... -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: Using non-ascii symbols

2006-01-24 Thread Christoph Zwerschke
Claudio Grondi wrote: > There is no symbol coming to my mind, but I would be glad if > it would express, that 'a' becomes a reference to a Python object being > currently referred by the identifier 'b' (maybe some kind of <-> ?). With unicode, you have a lot of possibilities to express this: a

Re: Using non-ascii symbols

2006-01-24 Thread Christoph Zwerschke
UTF-8 is also the standard encoding of SuSE Linux since I version 9.1. Both VIM and EMACS provide ways to enter unicode. VIM even supports digraph input which would be particularly senseful in this case. -- Christoph -- http://mail.python.org/mailman/listinfo/python-list

Re: "wxPython in Action" book

2006-01-24 Thread SPE - Stani's Python Editor
You won't find a better book about wxPython. Stani -- http://pythonide.stani.be -- http://mail.python.org/mailman/listinfo/python-list

Re: Using non-ascii symbols

2006-01-24 Thread Fredrik Lundh
Christoph Zwerschke wrote: > > My point still stands: _somewere_ along the way the rendering got messed > > up for _some_ people - something that wouldn't have happened with the > > <=, >= and != digraphs. > > Yes, but Python is already a bit handicapped concerning posting code > anyway because of

am i using findNextSibling wrong?

2006-01-24 Thread localpricemaps
i have this html: 3.99 1.05 3 http://www.cnn.com"; target="_blank" onclick="reload()"> i tried to this use this python to scrape out the href cnn.com and failed. for incident in row('td', {'class':'price'}): n = incident.findNextSibling('a')

Re: Using non-ascii symbols

2006-01-24 Thread Christoph Zwerschke
Rocco Moretti schrieb: > My point still stands: _somewere_ along the way the rendering got messed > up for _some_ people - something that wouldn't have happened with the > <=, >= and != digraphs. Yes, but Python is already a bit handicapped concerning posting code anyway because of its signific

Re: Some thougts on cartesian products

2006-01-24 Thread Christoph Zwerschke
Bryan Olson wrote: > The claim "everything is a set" falls into the category of > 'not even wrong'. No, it falls into the category of the most fundamental Mathematical concepts. You actually *define* tuples as sets, or functions as sets or relations as sets, or even all kinds of numbers and ot

Re: Creating a more random int?

2006-01-24 Thread Tim Chase
> I need to retrieve an integer from within a range ... this > works ... below is my out puts ... it just does not seem so > random ... > > Is there perhaps a suggestion out there to create a more > random int ...? I'm not sure how you determine that "it just does not seem so random"...I tried th

Re: list comprehension

2006-01-24 Thread Duncan Booth
Patrick Maupin wrote: > Duncan Booth wrote: > >> I prefer writing an 'if' statement here, Bryan prefers 'get', that's >> just a choice of style. But 'setdefault' here, that has no style. > > Well, I'm often told I have no style, and I _did_ admit that it's an > abuse of setdefault. However, I o

Re: Creating a more random int?

2006-01-24 Thread [EMAIL PROTECTED]
Steven Macintyre wrote: > Hi all, > > I need to retrieve an integer from within a range ... this works ... below > is my out puts ... it just does not seem so random ... What's wrong with it? > > Is there perhaps a suggestion out there to create a more random int ...? What do you think the outp

Re: Some thougts on cartesian products

2006-01-24 Thread Christoph Zwerschke
Bryan Olson wrote: > The claim "everything is a set" falls into the category of > 'not even wrong'. No, it falls into the category of the most fundamental Mathematical concepts. You actually *define* tuples as sets, or functions as sets or relations as sets, or even all kinds of numbers and othe

Re: Creating a more random int?

2006-01-24 Thread Paul Rubin
"Steven Macintyre" <[EMAIL PROTECTED]> writes: > I need to retrieve an integer from within a range ... this works ... below > is my out puts ... it just does not seem so random ... It's pretty normal for random small ints to not look random. Are there some statistical tests that the prng is defi

customized instance dictionaries, anyone?

2006-01-24 Thread wolfgang . lipp
some time after posting my `Linkdict recipe`__ to aspn__ -- basically, a dictionary with run-time delegational lookup, but this is not important here -- i thought gee that would be fun to make such a customized dictionary thingie an instance dictionary, and get some custom namespace behavior out of

Creating a more random int?

2006-01-24 Thread Steven Macintyre
Hi all, I need to retrieve an integer from within a range ... this works ... below is my out puts ... it just does not seem so random ... Is there perhaps a suggestion out there to create a more random int ...? >>> random.randint(3, 8) 7 >>> random.randint(3, 8) 3 >>> random.randint(3, 8) 3 >>>

Re: Problem with running external process

2006-01-24 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "ToMasz" <[EMAIL PROTECTED]> wrote: > No, no, that wasn't my intention (I'm just not conscious enough what's > going on with these fork, exec, spawn.. functions). > My parent process should start the child process and go back to it's > tasks. Before executing it fo

Re: Using non-ascii symbols

2006-01-24 Thread Claudio Grondi
Christoph Zwerschke wrote: > Juho Schultz wrote: > >> Fortran 90 allowed >, >= instead of .GT., .GE. of Fortran 77. But F90 >> uses ! as comment symbol and therefore need /= instead of != for >> inequality. I guess just because they wanted. However, it is one more >> needless detail to remember

Re: Loading a Python collection from an text-file

2006-01-24 Thread Larry Bates
Take a look at ConfigParser module. The format of the file would be something like: [members] peter=16 anton=21 People are accustomed to this format file (windows .ini format). -Larry Ilias Lazaridis wrote: > within a python script, I like to create a collection which I fill with > values fro

Re: a 32 bit number to integer

2006-01-24 Thread Dave Hansen
On Tue, 24 Jan 2006 13:23:05 -0300 in comp.lang.python, Ricardo Quesada <[EMAIL PROTECTED]> wrote: >Hi, > > In python 2.0, this number was an integer: >0x88776655 > > but in python 2.4 it is a long (every number > 0x7fff it is a long) > >in python 2.4, is there a way to convert that numb

Re: a 32 bit number to integer

2006-01-24 Thread Paul Rubin
Ricardo Quesada <[EMAIL PROTECTED]> writes: > 0x88776655 > > but in python 2.4 it is a long (every number > 0x7fff it is a long) > > in python 2.4, is there a way to convert that number to a integer > (notice that it only occupies 32 bits) ? It would be -2005440939 but that's maybe not

Re: Using non-ascii symbols

2006-01-24 Thread Rocco Moretti
Robert Kern wrote: > Rocco Moretti wrote: > > [James Stroud wrote:] > >I can't find "?, ?, or ?" on my keyboard. >> >>Posting code to newsgroups might get harder too. :-) > > > His post made it through fine. Your newsreader messed it up. I'm not exactally sure what happened - I can see the

a 32 bit number to integer

2006-01-24 Thread Ricardo Quesada
Hi, In python 2.0, this number was an integer: 0x88776655 but in python 2.4 it is a long (every number > 0x7fff it is a long) in python 2.4, is there a way to convert that number to a integer (notice that it only occupies 32 bits) ? thanks, riq. -- http://mail.python.org/mailman

Re: Using non-ascii symbols

2006-01-24 Thread Dave Hansen
On Tue, 24 Jan 2006 04:09:00 +0100 in comp.lang.python, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: [...] >Once you open your mind for using non-ascii symbols, I'm sure one can >find a bunch of useful applications. Variable names could be allowed to >be non-ascii, as in XML. Think class names

Re: Using non-ascii symbols

2006-01-24 Thread Dave Hansen
On Tue, 24 Jan 2006 16:33:16 +0200 in comp.lang.python, Juho Schultz <[EMAIL PROTECTED]> wrote: [...] > >Fortran 90 allowed >, >= instead of .GT., .GE. of Fortran 77. But F90 >uses ! as comment symbol and therefore need /= instead of != for >inequality. I guess just because they wanted. However,

Re: Using non-ascii symbols

2006-01-24 Thread Christoph Zwerschke
Juho Schultz wrote: > Fortran 90 allowed >, >= instead of .GT., .GE. of Fortran 77. But F90 > uses ! as comment symbol and therefore need /= instead of != for > inequality. I guess just because they wanted. However, it is one more > needless detail to remember. Same with the suggested operators.

Re: file_name_fixer.py

2006-01-24 Thread eww
thanks for the feedback! I'll work on your suggestions. bruno at modulix wrote: > [EMAIL PROTECTED] wrote: > > i put this together to fix a bunch of files with wierd names, please > > gimme feedback, i am a newbie > > Ok, so let's go... Hope you won't hate me too much !-) > > > > > #!/usr/bin/en

  1   2   >