Combinatorics

2008-02-11 Thread Michael Robertson
Where is the python equivalent of: http://search.cpan.org/~fxn/Algorithm-Combinatorics-0.16/Combinatorics.pm combinations (with and without repetition) variations (with and without repetition) permutations partitions derangements etc I'm guessing sage has this, but shouldn't something like this

Re: idiom to ask if you are on 32 or 64 bit linux platform?

2008-02-11 Thread Matt Nordhoff
Jon wrote: > Hello everyone, > > I've got a ctypes wrapper to some code which seems to be different > when compiled on 32 bit linux compared to 64 bit linux. For the > windows version I can use sys.platform == 'win32' versus 'linux2' to > decide whether to get the .dll or .so library to load. Havi

idiom to ask if you are on 32 or 64 bit linux platform?

2008-02-11 Thread Jon
Hello everyone, I've got a ctypes wrapper to some code which seems to be different when compiled on 32 bit linux compared to 64 bit linux. For the windows version I can use sys.platform == 'win32' versus 'linux2' to decide whether to get the .dll or .so library to load. Having narrowed it down to

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread cokofreedom
On Feb 12, 7:16 am, Jeff Schwab <[EMAIL PROTECTED]> wrote: > Erik Max Francis wrote: > > Jeff Schwab wrote: > > >> Erik Max Francis wrote: > >>> Grant Edwards wrote: > > On 2008-02-12, Jeff Schwab <[EMAIL PROTECTED]> wrote: > > Fair enough! > > Dear me, what's Usenet coming to these d

Re: mmap and shared memory

2008-02-11 Thread Tim Roberts
Matias Surdi <[EMAIL PROTECTED]> wrote: >Suppose I've a process P1, which generates itself a lot of data , for >example 2Mb. >Then, I've a process P2 which must access P1 shared memory and, >probably, modify this data. >To accomplish this, I've been digging around python's mmap module, but I >c

Re: Getting a Foothold on the IDLE Debugger

2008-02-11 Thread W. Watson
How about that! Thanks. An odd way to do it, but IDLE is suitably odd with respect to its namesake. BTW, what's with the close and exit options on the File menu? They both dump me out of IDLE. Odd. Any idea of whether I can "glue" the File-?Open to a particular folder? Any other similar progra

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Jeff Schwab
Erik Max Francis wrote: > Jeff Schwab wrote: > >> Erik Max Francis wrote: >>> Grant Edwards wrote: >>> On 2008-02-12, Jeff Schwab <[EMAIL PROTECTED]> wrote: > Fair enough! Dear me, what's Usenet coming to these days... >>> >>> I know, really. Sheesh! Jeff, I won't stand for th

Re: Is there a web visitor counter available in Python ...

2008-02-11 Thread W. Watson
PHP. Well, that's a new one on me. Google gave me some idea of what it's about, and I found some code on how to do it. It requires yet another "programming language", which means finding the editor, etc. Jon "Fluffy" Saul wrote: > On Feb 11, 2008 9:21 PM, W. Watson <[EMAIL PROTECTED]> wrote: >>

Re: Getting a Foothold on the IDLE Debugger

2008-02-11 Thread [EMAIL PROTECTED]
On Feb 11, 11:15�pm, "W. Watson" <[EMAIL PROTECTED]> wrote: > I thought I try to step through some simple Python code I wrote with IDLE > using Debug. I'm at the early stages of learning Python. I used the shell to > Run, then clicked on Debug->Debugger. That brought up a window with Stack > and Lo

Getting a Foothold on the IDLE Debugger

2008-02-11 Thread W. Watson
I thought I try to step through some simple Python code I wrote with IDLE using Debug. I'm at the early stages of learning Python. I used the shell to Run, then clicked on Debug->Debugger. That brought up a window with Stack and Locals checked. The buttons Go, Step, etc. are greyed out. How do I

Possible to tack on random stuff to objects?

2008-02-11 Thread Cruxic
Is it possible to tack on arbitrary attributes to a python object? For example: s = 'nice 2 meet you' s.isFriendly = True In the above example Python complains on the second line with: AttributeError: 'str' object has no attribute 'isFriendly' Is there another way? -- http://mail.python.org/ma

Re: Is there a web visitor counter available in Python ...

2008-02-11 Thread Matt Nordhoff
W. Watson wrote: > ... that is free for use without advertising that I can use on my web pages? > I have no idea is suitable for this. My knowledge of Python is somewhat > minimal at this point. Maybe Java is better choice. You can analyze your web logs. That's more accurate than a hit counter,

Re: How can I kill CGIHTTPServer ?

2008-02-11 Thread eching
On Feb 11, 10:24 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 11 Feb 2008 04:18:04 -0200, eching <[EMAIL PROTECTED]> > escribi�: > > > I'm running CGIHTTPServer with the serve_forever method and I cannot > > get the darn thing to stop unless I kill the command prompt its > > running

Re: Is there a web visitor counter available in Python ...

2008-02-11 Thread Jon "Fluffy" Saul
On Feb 11, 2008 9:21 PM, W. Watson <[EMAIL PROTECTED]> wrote: > ... that is free for use without advertising that I can use on my web pages? > I have no idea is suitable for this. My knowledge of Python is somewhat > minimal at this point. Maybe Java is better choice. > > -- >

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Erik Max Francis
Jeff Schwab wrote: > Erik Max Francis wrote: >> Grant Edwards wrote: >> >>> On 2008-02-12, Jeff Schwab <[EMAIL PROTECTED]> wrote: Fair enough! >>> >>> Dear me, what's Usenet coming to these days... >> >> I know, really. Sheesh! Jeff, I won't stand for that! Argue with >> me! :-) > > OK,

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Jeff Schwab
Erik Max Francis wrote: > Grant Edwards wrote: > >> On 2008-02-12, Jeff Schwab <[EMAIL PROTECTED]> wrote: >>> Fair enough! >> >> Dear me, what's Usenet coming to these days... > > I know, really. Sheesh! Jeff, I won't stand for that! Argue with me! > :-) OK, uh... You're a poopy-head. For

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Erik Max Francis
Grant Edwards wrote: > On 2008-02-12, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Fair enough! > > Dear me, what's Usenet coming to these days... I know, really. Sheesh! Jeff, I won't stand for that! Argue with me! :-) -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/

Is there a web visitor counter available in Python ...

2008-02-11 Thread W. Watson
... that is free for use without advertising that I can use on my web pages? I have no idea is suitable for this. My knowledge of Python is somewhat minimal at this point. Maybe Java is better choice. -- Wayne Watson (Nevada City, CA) Web Page:

Re: OT: Star Wars and parsecs [was Re: Why not a Python compiler?]

2008-02-11 Thread Jeff Schwab
Grant Edwards wrote: > On 2008-02-10, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > ? ? ? A Parsec is a fixed value (which, admittedly, presumes > the culture developed a 360degree circle broken into degrees > => minutes => seconds... or, at least, some units compatible > with t

Re: OT: Star Wars and parsecs [was Re: Why not a Python compiler?]

2008-02-11 Thread Grant Edwards
On 2008-02-10, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: ? ? ? A Parsec is a fixed value (which, admittedly, presumes the culture developed a 360degree circle broken into degrees => minutes => seconds... or, at least, some units compatible with the concept of an "arc second"

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Grant Edwards
On 2008-02-12, Jeff Schwab <[EMAIL PROTECTED]> wrote: > Erik Max Francis wrote: >> Jeff Schwab wrote: >> >>> So what's the "double mistake?" My understanding was (1) the misuse >>> (ok, vernacular use) of the term "free fall," and (2) the association >>> of weight with free-fall velocity ("If I

Re: Turn off ZeroDivisionError?

2008-02-11 Thread Neal Becker
Mark Dickinson wrote: > On Feb 10, 3:10 pm, [EMAIL PROTECTED] wrote: >> What Python run on a CPU that doesn't handle the nan correctly? > > How about platforms that don't even have nans? I don't think either > IBM's hexadecimal floating-point format, or the VAX floating-point > formats > support

Re: Difficulty with "inconsistent use of tabs and spaces in indentation" in file called

2008-02-11 Thread Gabriel Genellina
En Mon, 11 Feb 2008 21:57:00 -0200, ibloom <[EMAIL PROTECTED]> escribió: > My main problem is, I don't know where to find the file: > File "", line 628 > > As in I don't know what code it is refering to by ?? > It isn't code that I wrote, its something from python or pyObjC Mmm, didn't you get

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Jeff Schwab
Erik Max Francis wrote: > Jeff Schwab wrote: > >> So what's the "double mistake?" My understanding was (1) the misuse >> (ok, vernacular use) of the term "free fall," and (2) the association >> of weight with free-fall velocity ("If I tie an elephant's tail to a >> mouse's, and drop them both

Re: Difficulty with "inconsistent use of tabs and spaces in indentation" in file called

2008-02-11 Thread Steve Holden
ibloom wrote: > My main problem is, I don't know where to find the file: > File "", line 628 > > As in I don't know what code it is refering to by ?? > It isn't code that I wrote, its something from python or pyObjC > You'll typically see that in code that's being executed from a dynamically

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Erik Max Francis
Jeff Schwab wrote: > So what's the "double mistake?" My understanding was (1) the misuse > (ok, vernacular use) of the term "free fall," and (2) the association of > weight with free-fall velocity ("If I tie an elephant's tail to a > mouse's, and drop them both into free fall, will the mouse s

Re: How to broad cast ping address.......

2008-02-11 Thread Steve Holden
Gabriel Genellina wrote: > En Mon, 11 Feb 2008 13:31:56 -0200, Manikandan R <[EMAIL PROTECTED]> > escribi�: > >> I am working in Python scripting. I an need to find out all the >> device >> connected in the network. Just I planned to broad cast the ping address >> and >> use the ARP tabl

Re: mmap and shared memory

2008-02-11 Thread Carl Banks
On Feb 11, 6:41 pm, Matias Surdi <[EMAIL PROTECTED]> wrote: > Suppose I've a process P1, which generates itself a lot of data , for > example 2Mb. > Then, I've a process P2 which must access P1 shared memory and, > probably, modify this data. > To accomplish this, I've been digging around python's

Re: AttributeError: 'module' object has no attribute 'letters'

2008-02-11 Thread Gabriel Genellina
En Mon, 11 Feb 2008 21:33:25 -0200, John Machin <[EMAIL PROTECTED]> escribió: > Otherwise run python from the command line with the -v option and find > where it's getting the interloper string module from. interloper: my new word of the day. Thanks! PS: Another way would be to run the script

Re: Sending Python statement over socket in chunks

2008-02-11 Thread Jeffrey Barish
Diez B. Roggisch wrote: > Stop reinventing the wheel, start using pyro. Then either return the > list as whole, or if it really is to big, return subsequent slices of it. I am using Pyro. Great package. The problem is getting the chunks to send. I am trying to avoid executing the statement, so

Re: Difficulty with "inconsistent use of tabs and spaces in indentation" in file called

2008-02-11 Thread ibloom
My main problem is, I don't know where to find the file: File "", line 628 As in I don't know what code it is refering to by ?? It isn't code that I wrote, its something from python or pyObjC Ian Bloom -- http://mail.python.org/mailman/listinfo/python-list

mmap and shared memory

2008-02-11 Thread Matias Surdi
Suppose I've a process P1, which generates itself a lot of data , for example 2Mb. Then, I've a process P2 which must access P1 shared memory and, probably, modify this data. To accomplish this, I've been digging around python's mmap module, but I can't figure how to use it without files. Could

Re: use 'with' to redirect stdout

2008-02-11 Thread Neal Becker
Thanks! I understand this better now. This is really an example of a more general pattern: @contextmanager def rebind_attr(object_, attr, value): orig = getattr(object_, attr) setattr(object_, attr, value) yield setattr(object_, attr_, orig) -- http://mail.python.org/mailman/l

Re: AttributeError: 'module' object has no attribute 'letters'

2008-02-11 Thread John Machin
On Feb 12, 9:24 am, black_13 <[EMAIL PROTECTED]> wrote: > what does this error mean? > i am trying to use mark hammonds win32 package. > > Traceback (most recent call last): > File "aui2.py", line 11, in > import win32com.client > File "C:\Python25\lib\site-packages\win32com\client\__init_

Re: Encrypting a short string?

2008-02-11 Thread Paul Rubin
erikcw <[EMAIL PROTECTED]> writes: > In essence what I'm doing is trying to manage tickets for a helpdesk. > I want the ticket identifier to be short enough to fit in the subject > line along with the normal subject chosen by the user. I think you should use a database to maintain the email addre

Re: OT: Star Wars and parsecs [was Re: Why not a Python compiler?]

2008-02-11 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Feb 8, 2:53?pm, Lou Pecora <[EMAIL PROTECTED]> wrote: > > In article <[EMAIL PROTECTED]>, > > ?Grant Edwards <[EMAIL PROTECTED]> wrote: > > > > > On 2008-02-08, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > > >

Re: Difficulty with "inconsistent use of tabs and spaces in indentation" in file called

2008-02-11 Thread [EMAIL PROTECTED]
On Feb 11, 9:34 am, ibloom <[EMAIL PROTECTED]> wrote: > I've been trying for a couple days to build a program using pyObjC on > a mac, I'm stuck on this error: > > : inconsistent use of tabs and spaces in indentation > Traceback (most recent call last): >   File "setup.py", line 59, in ? >     setu

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Jeff Schwab
Erik Max Francis wrote: > Jeff Schwab wrote: > >> Erik Max Francis wrote: >>> Robert Bossy wrote: I'm pretty sure we can still hear educated people say that free fall speed depends on the weight of the object without realizing it's a double mistake. >>> >>> Well, you have to quali

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Erik Max Francis
Steven D'Aprano wrote: > On Mon, 11 Feb 2008 19:54:30 +1300, greg wrote: > >>> Until DeBroglie formulated >>> its hypothesis of dual nature of matter (and light): wave and particle >>> at the same time. >> Really it's neither waves nor particles, but something else for which >> there isn't a go

Re: AttributeError: 'module' object has no attribute 'letters'

2008-02-11 Thread Ben Finney
black_13 <[EMAIL PROTECTED]> writes: > what does this error mean? > [...] > valid_identifier_chars = string.letters + string.digits + "_" > AttributeError: 'module' object has no attribute 'letters' It means that you're trying to access the attribute 'letters' on a module that doesn't have th

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Erik Max Francis
Grant Edwards wrote: > On 2008-02-09, Thomas Dybdahl Ahle <[EMAIL PROTECTED]> wrote: >> Quantum mechanics are closely related to philosophy. > > I've never understood that claim. You can philosophize about > anything: biology, math, weather, the stars, the moon, and so > on. I don't see how QM

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Erik Max Francis
Jeff Schwab wrote: > Erik Max Francis wrote: >> Robert Bossy wrote: >>> I'm pretty sure we can still hear educated people say that free fall >>> speed depends on the weight of the object without realizing it's a >>> double mistake. >> >> Well, you have to qualify it better than this, because wha

Re: Better way to do this?

2008-02-11 Thread Carl Banks
On Feb 11, 3:57 pm, imho <[EMAIL PROTECTED]> wrote: > PRC ha scritto: > > > > > Hi folks, > > > I have a tuple of tuples, in the form--> ((code1, 'string1'),(code2, > > 'string2'),(code3, 'string3'),) > > > Codes are unique. A dict would probably be the best approach but this > > is beyond my contr

Re: packing greyscale values

2008-02-11 Thread John Machin
On Feb 11, 9:11 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > jimgardener wrote: > > hi > > i am getting value of a pixel of a greyscale image using PIL's > > image.getdata and need to pack it as an int as below > > > ie greyvalues > > 127 , 56 , 135 , 99 , 102 , 101 , 146 , 112 , 155 , 154 , 112 ,

AttributeError: 'module' object has no attribute 'letters'

2008-02-11 Thread black_13
what does this error mean? i am trying to use mark hammonds win32 package. Traceback (most recent call last): File "aui2.py", line 11, in import win32com.client File "C:\Python25\lib\site-packages\win32com\client\__init__.py", line 12, in import dynamic, gencache, pythoncom File "C

Re: which one is more efficient

2008-02-11 Thread Steven D'Aprano
On Mon, 11 Feb 2008 10:41:44 -0500, Steve Holden wrote: > If the "type" variable really is a type, of course, then the real > solution is hardly radical: stop using the names of types and start > using the types: [snip example using "type(obj) in (type1, type2)"] But if you're using actual type

Re: Encrypting a short string?

2008-02-11 Thread Carl Banks
On Feb 11, 4:19 pm, erikcw <[EMAIL PROTECTED]> wrote: > On Feb 11, 4:07 pm, [EMAIL PROTECTED] wrote: > > erikcw napisal(a):> But that can't be reversed, right? I'd like to be able > > to decrypt the > > > data instead of having to store the hash in my database... > > > In such case it seems you ha

Re: Encrypting a short string?

2008-02-11 Thread Gabriel Genellina
En Mon, 11 Feb 2008 19:19:00 -0200, erikcw <[EMAIL PROTECTED]> escribió: > In essence what I'm doing is trying to manage tickets for a helpdesk. > I want the ticket identifier to be short enough to fit in the subject > line along with the normal subject chosen by the user. So > cryptographic se

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Jeff Schwab
Erik Max Francis wrote: > Robert Bossy wrote: >> Grant Edwards wrote: >>> After repeated attempts at the tasks set for them in the >>> experiments, the subjects would learn strategies that would >>> work in a Newtonian world, but the initial intuitive reactions >>> were very non-Newtonian (regardle

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Erik Max Francis
Steve Holden wrote: > Well the history of physics for at least two hundred years has been a > migration away from the intuitive. In strict linguistic terms the word > "subatomic" is a fine oxymoron. I suspect it's really "turtles all the > way down". Well, hard to say that's been a monotonic p

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Erik Max Francis
Robert Bossy wrote: > Grant Edwards wrote: >> After repeated attempts at the tasks set for them in the >> experiments, the subjects would learn strategies that would >> work in a Newtonian world, but the initial intuitive reactions >> were very non-Newtonian (regardless of how educated they were >>

Re: Encrypting a short string?

2008-02-11 Thread Martin Marcher
Hi, On 2/11/08, erikcw <[EMAIL PROTECTED]> wrote: > In essence what I'm doing is trying to manage tickets for a helpdesk. > I want the ticket identifier to be short enough to fit in the subject > line along with the normal subject chosen by the user. So > cryptographic security isn't really impor

Re: Pure Python Salsa20 Stream Cipher Implementation

2008-02-11 Thread Gabriel Genellina
En Mon, 11 Feb 2008 17:29:49 -0200, Aahz <[EMAIL PROTECTED]> escribió: > In article <[EMAIL PROTECTED]>, > Gabriel Genellina <[EMAIL PROTECTED]> wrote: >> En Sat, 09 Feb 2008 20:29:58 -0200, Aahz <[EMAIL PROTECTED]> >> escribió: >>> In article <[EMAIL PROTECTED]>, >>> Gabriel Genellina <[EMAIL P

Re: Encrypting a short string?

2008-02-11 Thread erikcw
On Feb 11, 4:07 pm, [EMAIL PROTECTED] wrote: > erikcw napisal(a):> But that can't be reversed, right? I'd like to be able to > decrypt the > > data instead of having to store the hash in my database... > > In such case it seems you have no choice but to use a symmetric > encryption algorithm - in

Re: Encrypting a short string?

2008-02-11 Thread marek . rocki
erikcw napisal(a): > But that can't be reversed, right? I'd like to be able to decrypt the > data instead of having to store the hash in my database... In such case it seems you have no choice but to use a symmetric encryption algorithm - in other words, your original method. If the strings are ~20

Re: Sending Python statement over socket in chunks

2008-02-11 Thread Diez B. Roggisch
Jeffrey Barish schrieb: > I have a python module that contains an assignment statement binding a long > list of things to a name: > > list_of_things = [thing1, thing2, ...] > > where each thing instantiates class Thing when executed. I send this > statement through a socket to a remote module th

Re: Better way to do this?

2008-02-11 Thread Tim Chase
> I have a tuple of tuples, in the form--> ((code1, 'string1'),(code2, > 'string2'),(code3, 'string3'),) > > Codes are unique. A dict would probably be the best approach but this > is beyond my control. > > Here is an example: pets = ((0,'cat'),(1,'dog'),(2,'mouse')) > > If I am given a val

Re: Better way to do this?

2008-02-11 Thread imho
PRC ha scritto: > Hi folks, > > I have a tuple of tuples, in the form--> ((code1, 'string1'),(code2, > 'string2'),(code3, 'string3'),) > > Codes are unique. A dict would probably be the best approach but this > is beyond my control. > > Here is an example: pets = ((0,'cat'),(1,'dog'),(2,'mo

Python-URL! - weekly Python news and links (Feb 11)

2008-02-11 Thread Gabriel Genellina
QOTW: "And don't EVER make the mistake that you can design something better than what you get from ruthless massively parallel trial-and-error with a feedback cycle. That's giving your intelligence _much_ too much credit." - Linus Torvalds http://groups.google.com/group/fa.linux.kernel/msg/52f

Re: Pure Python Salsa20 Stream Cipher Implementation

2008-02-11 Thread Aahz
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: >[EMAIL PROTECTED] (Aahz) writes: >> >> Is there some reason you're using exaggerated language? My only >> point is that simply saying "C compiler! C compiler!" ignores the fact >> that Python itself is multi-platform

Re: Topographical sorting

2008-02-11 Thread Frank Niessink
Hi John, 2008/2/11, John <[EMAIL PROTECTED]>: > Now, on to my problem. Topographical sorting essentially involves removing > the minimal element in a set (1), and then arbitrarily choosing the next > minimal element and removing it as well. So, after removing 1, one could > remove 5, then 2, then

Sending Python statement over socket in chunks

2008-02-11 Thread Jeffrey Barish
I have a python module that contains an assignment statement binding a long list of things to a name: list_of_things = [thing1, thing2, ...] where each thing instantiates class Thing when executed. I send this statement through a socket to a remote module that executes it. The problem is that i

Re: Better way to do this?

2008-02-11 Thread Diez B. Roggisch
PRC schrieb: > Hi folks, > > I have a tuple of tuples, in the form--> ((code1, 'string1'),(code2, > 'string2'),(code3, 'string3'),) > > Codes are unique. A dict would probably be the best approach but this > is beyond my control. > > Here is an example: pets = ((0,'cat'),(1,'dog'),(2,'mouse

Re: Encrypting a short string?

2008-02-11 Thread Paul Rubin
erikcw <[EMAIL PROTECTED]> writes: > database. I'm using this encrypted string to identify emails from a > user. (the string will be in the subject line of the email). 1. I hope you're not trying to spam anyone. 2. What happens if the user edits the subject line? > I'm trying to figure out which

Better way to do this?

2008-02-11 Thread PRC
Hi folks, I have a tuple of tuples, in the form--> ((code1, 'string1'),(code2, 'string2'),(code3, 'string3'),) Codes are unique. A dict would probably be the best approach but this is beyond my control. Here is an example: >>>pets = ((0,'cat'),(1,'dog'),(2,'mouse')) If I am given a value for th

Re: Encrypting a short string?

2008-02-11 Thread erikcw
On Feb 11, 3:07 pm, [EMAIL PROTECTED] wrote: > erikcw napisal(a): > > > > > Hi, > > > I'm trying to devise a scheme to encrypt/obfuscate a short string that > > basically contains the user's username and record number from the > > database. I'm using this encrypted string to identify emails from a

Re: Encrypting a short string?

2008-02-11 Thread marek . rocki
erikcw napisal(a): > Hi, > > I'm trying to devise a scheme to encrypt/obfuscate a short string that > basically contains the user's username and record number from the > database. I'm using this encrypted string to identify emails from a > user. (the string will be in the subject line of the email

Re: Help with jabber client in wx

2008-02-11 Thread Jarek Zgoda
Astan Chee pisze: > A quick note, the project started as a google talk client, but it seems > that xmpppy is flexible enough to support various other/similar XMPP > servers, but I mainly use with/in google talk > It is open source and I've included the windows executable as an > optional download.

Encrypting a short string?

2008-02-11 Thread erikcw
Hi, I'm trying to devise a scheme to encrypt/obfuscate a short string that basically contains the user's username and record number from the database. I'm using this encrypted string to identify emails from a user. (the string will be in the subject line of the email). I'm trying to figure out w

Re: Tkinter equiv for setPalette

2008-02-11 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, Helmut Jarausch <[EMAIL PROTECTED]> wrote: > Hi, > > I am to convert an old Perl-Tk script to Python. > It starts by > my $MW= new MainWindow; > $MW->setPalette(background => 'AntiqueWhite1', foreground => 'blue'); > > Is there an equivalent for Tkinter? How can

Re: Pure Python Salsa20 Stream Cipher Implementation

2008-02-11 Thread Paul Rubin
[EMAIL PROTECTED] (Aahz) writes: > Is there some reason you're using exaggerated language? My only > point is that simply saying "C compiler! C compiler!" ignores the fact > that Python itself is multi-platform (and makes you look foolish); > whether any given module should be written in pure P

Re: how to find current working user

2008-02-11 Thread Tim Chase
> Can anyone tell me how to find current working user in windows? The below should be fairly cross-platform: >>> import getpass >>> whoami = getpass.getuser() >>> print whoami W: tchase L: tim ("W:" is the result on my windows box, "L:" is the result on my Linux box) which can be us

Re: Pure Python Salsa20 Stream Cipher Implementation

2008-02-11 Thread Aahz
In article <[EMAIL PROTECTED]>, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >En Sat, 09 Feb 2008 20:29:58 -0200, Aahz <[EMAIL PROTECTED]> escribió: >> In article <[EMAIL PROTECTED]>, >> Gabriel Genellina <[EMAIL PROTECTED]> wrote: >>> En Sat, 09 Feb 2008 01:34:30 -0200, <[EMAIL PROTECTED]> >>> e

Re: Python equivt of __FILE__ and __LINE__

2008-02-11 Thread thebjorn
On Feb 11, 4:55 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > Bill Davy wrote: > > Writing a quick and dirty assembler and want to give the user the location > > of an error. The "assembly language" is Python. If the user wants to > > generat some object code they write something like: > > > Labe

Re: how to find current working user

2008-02-11 Thread Chris Mellon
On Feb 11, 2008 12:30 PM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Mon, 11 Feb 2008 15:21:16 -0200, Praveena Boppudi (c) > <[EMAIL PROTECTED]> escribi�: > > > Can anyone tell me how to find current working user in windows? > > If it is just informational, use os.environ['USERNAME'] > Using

Re: wxpython file dialog

2008-02-11 Thread Guilherme Polo
2008/2/11, Mike Driscoll <[EMAIL PROTECTED]>: > On Feb 11, 2008 12:14 PM, Guilherme Polo <[EMAIL PROTECTED]> wrote: > > 2008/2/11, Mike Driscoll <[EMAIL PROTECTED]>: > > > On Feb 10, 6:41 am, Janwillem <[EMAIL PROTECTED]> wrote: > > > > Guilherme Polo wrote: > > > > > 2008/2/10, Janwillem <[EMAIL P

Re: how to find current working user

2008-02-11 Thread Gabriel Genellina
En Mon, 11 Feb 2008 15:21:16 -0200, Praveena Boppudi (c) <[EMAIL PROTECTED]> escribi�: > Can anyone tell me how to find current working user in windows? If it is just informational, use os.environ['USERNAME'] Using win32wnet (from the pywin32 package): py> import win32wnet py> win32wnet.WNetGe

Re: wxpython file dialog

2008-02-11 Thread Mike Driscoll
On Feb 11, 2008 12:14 PM, Guilherme Polo <[EMAIL PROTECTED]> wrote: > 2008/2/11, Mike Driscoll <[EMAIL PROTECTED]>: > > On Feb 10, 6:41 am, Janwillem <[EMAIL PROTECTED]> wrote: > > > Guilherme Polo wrote: > > > > 2008/2/10, Janwillem <[EMAIL PROTECTED]>: > > > >> Guilherme Polo wrote: > > > >> > 2

Re: wxpython file dialog

2008-02-11 Thread Guilherme Polo
2008/2/11, Mike Driscoll <[EMAIL PROTECTED]>: > On Feb 10, 6:41 am, Janwillem <[EMAIL PROTECTED]> wrote: > > Guilherme Polo wrote: > > > 2008/2/10, Janwillem <[EMAIL PROTECTED]>: > > >> Guilherme Polo wrote: > > >> > 2008/2/9, Janwillem <[EMAIL PROTECTED]>: > > > > Is there a way to force the

Re: regarding html source code

2008-02-11 Thread subeen
Another way: import urllib2 usock = urllib2.urlopen('http://abc.com') data = usock.read() usock.close() print data On Feb 12, 12:05 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Hi, > > shashank jain top-posted: > > > > > On Feb 11, 2008 11:15 PM, Stefan Behnel <[EMAIL PROTECTED]> wrote: >

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Gabriel Genellina
En Mon, 11 Feb 2008 14:05:27 -0200, Grant Edwards <[EMAIL PROTECTED]> escribi�: > On 2008-02-11, Steve Holden <[EMAIL PROTECTED]> wrote: > >> Well the history of physics for at least two hundred years has >> been a migration away from the intuitive. > > Starting at least as far back as Newtonian

Re: regarding html source code

2008-02-11 Thread Stefan Behnel
Hi, shashank jain top-posted: > On Feb 11, 2008 11:15 PM, Stefan Behnel <[EMAIL PROTECTED]> wrote: > >> jainshasha wrote: >>> well i have create a program which can read out the html source code >>> files or any other web page source code files through my program so >> Like this? >> >> >>> from

Re: CSV Reader

2008-02-11 Thread Gabriel Genellina
En Mon, 11 Feb 2008 14:41:54 -0200, Mike P <[EMAIL PROTECTED]> escribi�: > CSV_Data = open(working_CSV) > data = CSV_Data.readlines() > flag=False > for record in data: > if record.startswith('"Transaction ID"'): > [...] Files are already iterable by lines. There is no need to use readl

Re: Plotting 3d points

2008-02-11 Thread Rasmus Kjeldsen
Elby skrev: > Matplotlib as some 3D capabilities too. You can have a look at these > examples : http://scipy.org/Cookbook/Matplotlib/mplot3D > I got the cookbook examples to work, but where do I read more into what i can do with mplot3d (set type of marker, set size of marker etc.)? A google sea

Re: regarding html source code

2008-02-11 Thread Stefan Behnel
jainshasha wrote: > well i have create a program which can read out the html source code > files or any other web page source code files through my program so Like this? >>> from lxml import html >>> page = html.parse("http://www.google.com";) >>> print page.find("//title").text Google h

Re: Difficulty with "inconsistent use of tabs and spaces in indentation" in file called

2008-02-11 Thread Gabriel Genellina
En Mon, 11 Feb 2008 13:34:17 -0200, ibloom <[EMAIL PROTECTED]> escribi�: > I've been trying for a couple days to build a program using pyObjC on > a mac, I'm stuck on this error: > > : inconsistent use of tabs and spaces in indentation > Traceback (most recent call last): > File "setup.py", line

regarding html source code

2008-02-11 Thread jainshasha
hello friends well i want to create a program which can read my html based coding or any other web page code so i want to know how python can help me in this regard so anyone have ay idea about this thing please reply soon Thanks In Advance -- http://mail.python.org/mailman/listinfo/python-lis

Re: How to broad cast ping address.......

2008-02-11 Thread Gabriel Genellina
En Mon, 11 Feb 2008 13:31:56 -0200, Manikandan R <[EMAIL PROTECTED]> escribi�: > I am working in Python scripting. I an need to find out all the > device > connected in the network. Just I planned to broad cast the ping address > and > use the ARP table to get the IP address of the syste

how to find current working user

2008-02-11 Thread Praveena Boppudi (c)
Hi, Can anyone tell me how to find current working user in windows? Thanks, Praveena. -- http://mail.python.org/mailman/listinfo/python-list

regarding html source code

2008-02-11 Thread jainshasha
hello friends well i have create a program which can read out the html source code files or any other web page source code files through my program so please guys help me out in this problem that how python can help me in this regard and if there is any other language through which i can easily ma

python25_d.lib?

2008-02-11 Thread Robert Dailey
Hi, Currently I'm embedding Python 2.5 into my C++ Visual Studio project. However, during the link stage it is stating that it cannot find "python25_d.lib". From what I read in my search through Google on this issue is that you actually have to build Python yourself to get a debug version of the l

Re: wxpython file dialog

2008-02-11 Thread Mike Driscoll
On Feb 10, 6:41 am, Janwillem <[EMAIL PROTECTED]> wrote: > Guilherme Polo wrote: > > 2008/2/10, Janwillem <[EMAIL PROTECTED]>: > >> Guilherme Polo wrote: > >> > 2008/2/9, Janwillem <[EMAIL PROTECTED]>: > > Is there a way to force the wx.FileDialog to show as default the > >> >> thumbnails v

RE: CSV Reader

2008-02-11 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Mike P > Sent: Monday, February 11, 2008 11:42 AM > To: python-list@python.org > Subject: Re: CSV Reader > > Cheers for the help, the second way looked to be the best in the end, > and thanks fo

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Dotan Cohen
On 11/02/2008, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-02-11, Steve Holden <[EMAIL PROTECTED]> wrote: > > > Well the history of physics for at least two hundred years has > > been a migration away from the intuitive. > > Starting at least as far back as Newtonian mechanics. I once > rea

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Robert Bossy
Grant Edwards wrote: > On 2008-02-11, Steve Holden <[EMAIL PROTECTED]> wrote: > > >> Well the history of physics for at least two hundred years has >> been a migration away from the intuitive. >> > > Starting at least as far back as Newtonian mechanics. I once > read a very interesting art

Re: CSV Reader

2008-02-11 Thread Mike P
Cheers for the help, the second way looked to be the best in the end, and thanks for the boolean idea Mike working_CSV = "//filer/common/technical/Research/E2C/Template_CSV/ DFAExposureToConversionQueryTool.csv" save_file = open("//filer/common/technical/Research/E2C/Template_CSV/ CSV_Data2.c

RE: CSV Reader

2008-02-11 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Mike P > Sent: Monday, February 11, 2008 11:10 AM > To: python-list@python.org > Subject: Re: CSV Reader > > Hi Larry, > > i'm still getting to grips with python, but rest assured i thinkn it'

Re: How can I kill CGIHTTPServer ?

2008-02-11 Thread Gabriel Genellina
En Mon, 11 Feb 2008 04:18:04 -0200, eching <[EMAIL PROTECTED]> escribi�: > I'm running CGIHTTPServer with the serve_forever method and I cannot > get the darn thing to stop unless I kill the command prompt its > running in. I searched for similar posts here and found this: See this thread from

Re: use 'with' to redirect stdout

2008-02-11 Thread Jean-Paul Calderone
On Mon, 11 Feb 2008 10:37:18 -0500, Neal Becker <[EMAIL PROTECTED]> wrote: >This will work for stdout: > >from __future__ import with_statement >from contextlib import contextmanager >import sys > >@contextmanager >def redirect(newfile): >orig_stdout = sys.stdout >sys.stdout = newfile >

Re: CSV Reader

2008-02-11 Thread Mike P
Hi Larry, i'm still getting to grips with python, but rest assured i thinkn it's better for me to write hte code for learnign purposes My basic file is here, it comes up with a syntax error on the startswith line, is this because it is potentially a list? My idea was to get the lines number where

  1   2   >