Re: [Tutor] comparison bug in python (or do I not get it?)

2008-03-01 Thread bob gailer
Ricardo Aráoz wrote: > Just one further question : > > >>> 1 == True > True > >>> 5 == True > False > > and yet > > >>> if 5 : print 'True' > True > > > I thought a non-zero or non-empty was evaluated as True. Now in the 5 == > True line I'm not saying "5 is True", shouldn't it evaluate just li

Re: [Tutor] Need help with encoder & decryption keys

2008-03-01 Thread Chris Fuller
On Friday 29 February 2008 16:30, Trey Keown wrote: > Hey all, > Been away for a while. So, I'm in the process of making a program for > encrypting and decrypting strings of text. And I was wondering how it > would be possible to perhaps keep keys in a .pyc file, and keep them > from being isolat

Re: [Tutor] Need help with encoder & decryption keys

2008-03-01 Thread Kent Johnson
Trey Keown wrote: > mmm... So, what would be an effective way to hide the data's key? > I'm kind of new to the whole encryption scene, although I've had some > experience with it whilst working on homebrew software on gaming > platforms. I don't know, I'm not a crypto expert. I guess it depends p

Re: [Tutor] comparison bug in python (or do I not get it?)

2008-03-01 Thread Kent Johnson
Ricardo Aráoz wrote: > >>> 1 == True > True Yes, True is an integer with value 1. Actually True is a bool but bool is a subclass of int: In [3]: type(True) Out[3]: In [4]: isinstance(True, int) Out[4]: True In [5]: int(True) Out[5]: 1 > >>> 5 == True > False Right, because 5 != 1 > and yet

Re: [Tutor] comparison bug in python (or do I not get it?)

2008-03-01 Thread Ricardo Aráoz
Hans Fangohr wrote: > Hi Kent, > >> Hans Fangohr wrote: >> >>> In [2]: 2 in [1,2,3] == True >>> Out[2]: False >>> >>> Why does [2] return False? Would people agree that this is a bug? >> No, not a bug. Don't be too quick to blame your tools! > > That's good news. I'd be worried if this wasn't the

Re: [Tutor] serial -->file tranfer

2008-03-01 Thread Kent Johnson
govind goyal wrote: > Hello, > > I have a modem connect to my Windows XP PC through a serial cable. > I Want to transfer the file(e.g '.TXT' format) from XP PC to serial > modem and also > from Serial modem to winXP PC. > > Can anybody help me out how to do it in Python and provide some sample