[Tutor] Re: How to obfuscate a database password. (fwd)

2005-04-19 Thread Andrei
> From: David Driver gmail.com> > I am not necessarily talking about passwords for users but about the > password that is used for connecting to the database. In a compiled > language you would have to look pretty hard in a dll to find where the > password had been encoded. As you point out there

Re: [Tutor] How to obfuscate a database password.

2005-04-19 Thread Danny Yoo
> I am not necessarily talking about passwords for users but about the > password that is used for connecting to the database. Hi David, Ah, ok, I misunderstood the problem then. Hmmm... I agree with the others who have said that this is difficult. *grin* Eventually, you'll need to decrypt wh

Re: [Tutor] How to obfuscate a database password. (fwd)

2005-04-19 Thread Danny Yoo
-- Forwarded message -- Date: Tue, 19 Apr 2005 19:47:20 -0500 From: David Driver <[EMAIL PROTECTED]> To: Danny Yoo <[EMAIL PROTECTED]> Subject: Re: [Tutor] How to obfuscate a database password. I am not necessarily talking about passwords for users but about the password that is

Re: [Tutor] Dynamically composing a module name

2005-04-19 Thread Tim Johnson
Appreciate the replies. Also found this link: http://diveintopython.org/functional_programming/dynamic_import.html See Example 16.15. :-) Very pythonesque! Methinks. thanks tj -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com __

Re: [Tutor] How to obfuscate a database password.

2005-04-19 Thread Max Noel
On Apr 20, 2005, at 01:29, Danny Yoo wrote: Is there a convention for obfuscating database passwords? Hi David, Most people run passwords through some sort of hashing function. That is, databases almost never contain passwords in the clear, but instead store the hashes of those passwords. For

Re: [Tutor] How to obfuscate a database password.

2005-04-19 Thread Danny Yoo
> > Is there a convention for obfuscating database passwords? Hi David, Most people run passwords through some sort of hashing function. That is, databases almost never contain passwords in the clear, but instead store the hashes of those passwords. For example, I am almost positive that Amaz

Re: [Tutor] Dynamically composing a module name

2005-04-19 Thread Tim Johnson
* Alan Gauld <[EMAIL PROTECTED]> [050419 15:08]: > > Is it possible to dynamically compose a module name > > for import? Hi Alan: > Yes, there is a module somewhere that allows you to import a module > programatically by passing the name as a string. Look for an import > or module function

Re: [Tutor] How to obfuscate a database password.

2005-04-19 Thread Alan Gauld
> Is there a convention for obfuscating database passwords? Depends what you mean. Do you mean encryption at the point of use? That depends on the database. Do you mean in your program? That usually means unobfuscating it before use and its still vulnerable to interception. Do you mean whi

Re: [Tutor] Dynamically composing a module name

2005-04-19 Thread Alan Gauld
> Is it possible to dynamically compose a module name > for import? Yes, there is a module somewhere that allows you to import a module programatically by passing the name as a string. Look for an import or module function or module in the docs... > Pointers to documentation or other discussion

[Tutor] crash - switching between text window and graphics/game window (high score)

2005-04-19 Thread D. Hartley
Ok. I got in the working code to have a high score list, and it even saves/loads one now (!!). The only problem is, clicking back from the text window to the game window (only after you entered in your name to go onto the high score list), closes the program. you dont get to say y/n to another gam

[Tutor] How to obfuscate a database password.

2005-04-19 Thread David Driver
Is there a convention for obfuscating database passwords? I think that in the end there will be a script that boot-straps to zipped modules but I don't think that that is secure enough. I was thinking about asking the database lists but I think that this is more of a general question. -- ***

Re: [Tutor] Dynamically composing a module name

2005-04-19 Thread py pan
__import__: http://www.python.org/doc/2.4.1/lib/built-in-funcs.html ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Dynamically composing a module name

2005-04-19 Thread Max Noel
On Apr 19, 2005, at 21:22, Tim Johnson wrote: Hello Pythonmeisters: Is it possible to dynamically compose a module name for import? Pointers to documentation or other discussions would be sufficient at this time. thanks Ah, metaprogramming. I must admit I can't think of a way. Or rather, I did t

Re: [Tutor] Dynamically composing a module name

2005-04-19 Thread Bernard Lebel
Hi, The one thing I would try, if I understand what you're after correctly, would be to run a exec command with the module name. modulename = 'myModule' exec 'import ' + modulename Then you can access the module names as any imported module. Cheers Bernard On 4/19/05, Tim Johnson <[EMAIL PR

[Tutor] Dynamically composing a module name

2005-04-19 Thread Tim Johnson
Hello Pythonmeisters: Is it possible to dynamically compose a module name for import? Pointers to documentation or other discussions would be sufficient at this time. thanks -- Tim Johnson <[EMAIL PROTECTED]> http://www.alaska-internet-solutions.com ___

Re: [Tutor] Contructor Overloading and Function Tooktips

2005-04-19 Thread Alan Gauld
> OK, but that was just your example :-) Here is some ugly quick code > which might show you how to meet you needs: > > class JohnsMultiInitClass: > def __init__(self, first, second): > if type(first) == type(second) == str: > self.string_init(first, second) > i

Re: [Tutor] TKinter and things over Linux

2005-04-19 Thread Alberto Troiano
GOTCHA! I let you know guys how it went Bye for now Alberto From: Max Noel <[EMAIL PROTECTED]> To: "Alberto Troiano" <[EMAIL PROTECTED]> CC: tutor@python.org, [EMAIL PROTECTED] Subject: Re: [Tutor] TKinter and things over Linux Date: Tue, 19 Apr 2005 20:01:31 +0100 On Apr 19, 2005, at 19:57, Al

Re: [Tutor] TKinter and things over Linux

2005-04-19 Thread Max Noel
On Apr 19, 2005, at 19:57, Alberto Troiano wrote: Thanks Danny I will try to do that and let you know how it went But one question thou, does it matter the location where I gunzip the distutil If so where should I put it??? NOTE: It's just to be sure that I'm understanding righ

Re: [Tutor] TKinter and things over Linux

2005-04-19 Thread Alberto Troiano
Thanks Danny I will try to do that and let you know how it went But one question thou, does it matter the location where I gunzip the distutil If so where should I put it??? NOTE: It's just to be sure that I'm understanding right the language (ENGLISH) of the link you attached

Re: [Tutor] inexplicable MySQLdb behavior, INSERT data doesn't appear

2005-04-19 Thread Danny Yoo
On Tue, 19 Apr 2005 [EMAIL PROTECTED] wrote: > hi all, while recently trying to insert some data into the following > table: > > # stores unique course definitions > CREATE TABLE adminCourses ( > ID TINYINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, > Code CHAR(6), > Title VARCHAR(55), > Unit

Re: [Tutor] inexplicable MySQLdb behavior, INSERT data doesn't appear

2005-04-19 Thread Marilyn Davis
On Tue, 19 Apr 2005, Kent Johnson wrote: > Sounds like you need to commit() the initial cursor.execute() Yes. When we upgraded to 2.4, we had to add a commit(), so my own execute looks like: self.cursor.execute(this,args) did = self.connection.affected_rows() self.connection.commit() return di

Re: [Tutor] Contructor Overloading and Function Tooktips

2005-04-19 Thread Brian van den Broek
Gooch, John said unto the world upon 2005-04-19 10:20: Brian, I think in the OO world it is called Polymorphism, where you have a single function name, but multiple definitions that are distinguished from one another by the number of arguments, type of arguments, and sometimes ( Smalltalk ) the r

Re: [Tutor] inexplicable MySQLdb behavior, INSERT data doesn't appear

2005-04-19 Thread Kent Johnson
Sounds like you need to commit() the initial cursor.execute() Kent [EMAIL PROTECTED] wrote: hi all, while recently trying to insert some data into the following table: # stores unique course definitions CREATE TABLE adminCourses ( ID TINYINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, Code CHAR(6

[Tutor] inexplicable MySQLdb behavior, INSERT data doesn't appear

2005-04-19 Thread tpc
hi all, while recently trying to insert some data into the following table: # stores unique course definitions CREATE TABLE adminCourses ( ID TINYINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, Code CHAR(6), Title VARCHAR(55), Units TINYINT UNSIGNED ) TYPE = InnoDB; I got a 1L value when I ran

Re: [Tutor] Contructor Overloading and Function Tooktips

2005-04-19 Thread Alan Gauld
> I think in the OO world it is called Polymorphism, Nope, its called overloading. Polymorphism is where you send the same message to diferent types of object and get different behaviour. > where you have a single function name, but multiple definitions > that are distinguished from one another b

RE: FW: [Tutor] Trying to d0 HTTP GET

2005-04-19 Thread Ertl, John
Kent and Danny, Thanks for the help. The trick was to put the .read() at the end of the urllib2 line. It makes some sense now but man I hate it when it is that simple and I just can't see it. Thanks again for the great help. John Ertl -Original Message- From: Kent Johnson [mailto:[EM

Re: FW: [Tutor] Trying to d0 HTTP GET

2005-04-19 Thread Danny Yoo
On Tue, 19 Apr 2005, Ertl, John wrote: > I have figured out a bit more. I can get the binary values from the > service but I think they come back as a single string. How do I read > that into an array? Hi John, > The code below will read the first number into the array and print it > out bu

Re: FW: [Tutor] Trying to d0 HTTP GET

2005-04-19 Thread Kent Johnson
Ertl, John wrote: All, I have figured out a bit more. I can get the binary values from the service but I think they come back as a single string. How do I read that into an array? The code below will read the first number into the array and print it out but how would I read the whole thing into

Re: [Tutor] TKinter and things over Linux

2005-04-19 Thread Danny Yoo
On Tue, 19 Apr 2005, Alberto Troiano wrote: > Sorry I have Mysql-python 1.20 > that's the one I can not install > I said MySQLdb because I'm still using it for windows > I can't install mysql-python it gives me the error i described > > With mysql-python does the sintax change???What should

FW: [Tutor] Trying to d0 HTTP GET

2005-04-19 Thread Ertl, John
All, I have figured out a bit more. I can get the binary values from the service but I think they come back as a single string. How do I read that into an array? The code below will read the first number into the array and print it out but how would I read the whole thing into an array...I woul

RE: [Tutor] Of fish and foul...(aka the Perl require command)

2005-04-19 Thread Smith, Jeff
Thanks, That does the trick. Rather than make a function, I'm likely to just do: if sys.version_info[:3] < (X,Y,Z): raise RuntimeError Jeff -Original Message- From: Max Noel [mailto:[EMAIL PROTECTED] Sent: Monday, April 18, 2005 3:34 PM To: Smith, Jeff Cc: tutor@python.org Subject

Re: [Tutor] py2exe

2005-04-19 Thread Jeff Peery
Ok, thanks again Greg. Although I didn't see a log file, where would it appear and what would the name be... just in case I missed it. thanks.   JeffGreg Hasseler <[EMAIL PROTECTED]> wrote: I meant to send my first reply the list..oops. If it doesn't leave anylog file then I would suggest maybe sen

RE: [Tutor] Contructor Overloading and Function Tooktips

2005-04-19 Thread Gooch, John
Brian, I think in the OO world it is called Polymorphism, where you have a single function name, but multiple definitions that are distinguished from one another by the number of arguments, type of arguments, and sometimes ( Smalltalk ) the return type of the function. Here are some example func

Re: [Tutor] TKinter and things over Linux

2005-04-19 Thread Alberto Troiano
Sorry I have Mysql-python 1.20 that's the one I can not install I said MySQLdb because I'm still using it for windows I can't install mysql-python it gives me the error i described With mysql-python does the sintax change???What should I import if not MySQLdb Thanks in advanced Albert

Re: [Tutor] TKinter and things over Linux

2005-04-19 Thread Max Noel
On Apr 19, 2005, at 13:49, Alberto Troiano wrote: Hi I have another problem. It seems that I manage to solve a problem and run into another The problem is that now I can't install MySQLdb (MySQL database module for Python 2.3.4) I try to ./configure and it prints a lot of crap and then says mys

Re: [Tutor] TKinter and things over Linux

2005-04-19 Thread Alberto Troiano
Hi I have another problem. It seems that I manage to solve a problem and run into another The problem is that now I can't install MySQLdb (MySQL database module for Python 2.3.4) I try to ./configure and it prints a lot of crap and then says mysql ended on exit 1 What can I do?? Pleas

Re: [Tutor] for loop

2005-04-19 Thread Alan Gauld
> Well I was reading too fast (as usual) - you wanted to print 'yes' > only if 5 is not in a sub list but you want to look in all the sub > lists and yet print 'yes' only once??? Oops, me too, so in that case > So in long hand lets reverse the logic and make sure we print 'yes' > only once >

Re: [Tutor] for loop

2005-04-19 Thread Alan Gauld
> *Ron A* /Wed Jan 7 18:41:15 EST 2004/ > > I'm experimenting and would like 'yes' to be printed only if 5 is not in > the list, but I want to look in each list. This prints out two yeses. > How do I get it to print just one 'yes'? > > x = [[1,2,3],[2,4,6],[8,4,5,6],[9,8,7]] > > for num in x: >

Re: [Tutor] for loop

2005-04-19 Thread Ewald Ertl
Hi, I've slightly modified the for-Loop containing the "else" and not the if: >>> x = [[1,2,3],[2,4,6],[8,4,5,6],[9,8,7]] >>> for num in x: ... if 5 in num: ... break ... else: ... print "YES" ... >>> second test: >>> x = [[1,2,3],[2,4,6],[8,4,6],[9,8,7]] >>> for num in

Re: [Tutor] Newbie question

2005-04-19 Thread Alan Gauld
> def square(y): >return y * y > > for x in range(1, 11): >print square(x), > > print > > Well, I understood the code above. My question is: Is > it really necessary I have the last "print" statment No, it just creates a blank line which makes it easier to separate the output of the pr