[Tutor] code review request

2006-01-04 Thread Will Harris
Hoping to get some of you guru types to look over the start of a tool I am working on in python. A working version of the script is at https://mikaru.homeunix.org/py-bin/memberlist.py The site only allows https because I got sick of all the hacked windoze boxes trying to execute crap that I didn

Re: [Tutor] glibc error while Python script runs

2006-01-04 Thread Bernard Lebel
Rest assured, Kent, that I fully understand your point. My experience is quite a lot more limited than yours, and yes I experience this frustrating mess that you talk about and I'm aware that I'm not doing myself any favor with such a design. Sorting this is high on my TODO list. but not on top

Re: [Tutor] glibc error while Python script runs

2006-01-04 Thread Kent Johnson
Bernard Lebel wrote: > Here is the script (1550 lines, I know - just wants to get to > functional code before improving the design), if it can help. Hmm, a common attitude but a bad plan and false economy IMO. In my experience if I keep the code and the design clean as I go, development moves fa

Re: [Tutor] XOR, bytes and strings

2006-01-04 Thread to bifu
congratulations, you are good in explaining something easily and in a simple english, too! i was able to get it work, thank you, tobi p.s.: sorry for this wrong 'from' field in the other message >10101010 (0xaa) > > and xor it against: > >01010101 (0x55) > > We know what to exp

Re: [Tutor] Design questions?

2006-01-04 Thread Alan Gauld
Hi Richard, The first thiong is forget the GUI for now it will be much easier to get a command line version working then add a GUI (or web page) later. > (Input Clients name) input text box > age= spinner > Male or Female= radio buttons > Tobacco User yes or no > Health Here I was thinking about

Re: [Tutor] XOR, bytes and strings

2006-01-04 Thread Danny Yoo
On Wed, 4 Jan 2006, to bifu wrote: > thanks for the help, but my problem is how to use that for a string, Hi To, A character can be translated into an ordinal number by using the ord() function. For example: ## >>> ord('a') 97 ## > and those hexadecimals are confusing me, too. Let

[Tutor] Printing in Windows (was: Further help needed!

2006-01-04 Thread Terry Carroll
On Wed, 4 Jan 2006, John Corry wrote: > I am using the following code to send a text file to the printer:- > This code works on windows XP + Windows 2000. However it does not work on > windows 98SE. Here's another alternative, which might be even simpler, if it works for you, invoking the go

Re: [Tutor] Further help needed!

2006-01-04 Thread Alan Gauld
John, On Win 9X try 1) copying the text file to PRN: using os.system() 2) use the DIS PRINT command using os.system() 3) Try opening the file LPT1: and copying your text to that. All of the above should work. But I no onger have a Win9X box to check... HTH, Alan G. - Original Message -

Re: [Tutor] glibc error while Python script runs

2006-01-04 Thread Bernard Lebel
Hi Danny, See [Bernard] below... On 1/4/06, Danny Yoo <[EMAIL PROTECTED]> wrote: > > > rn200.bbfxa.com Wed Jan 4 16:23:36 2006 [jobid: 9]: Get status of all > > local jobs for this job... > > > > *** glibc detected *** double free or corruption: 0x09484d58 *** > > Aborted > > > Hi Bernard, > > Ug

Re: [Tutor] query regarding mysql database backup?? please Help

2006-01-04 Thread Alan Gauld
> > os.system("mysqldump --add-drop-table -c -u root -pmysql > > max_everest_2006 > "+target_dir+"/table.bak.sql") > > root is my user name,mysql is my password You shouldn't use root to adnin a database, it leaves you open to all sorts of security holes. And you shouldn't post your root passwo

Re: [Tutor] XOR, bytes and strings

2006-01-04 Thread Alan Gauld
> now i have the problem that i should encrypt a string (the password) by > XOR with this bytes: f3, 26, 81, c4, 39, 86, db, 92, 71, a3, b9, e6, 53, > 7a, 95, 7c. > > but although i have searched in the documentation for about an hour, Look for bitwise operators, there is a bitwise xor operator.

Re: [Tutor] HD/DVD/CD

2006-01-04 Thread Alan Gauld
>> >>> i = long(-1972144115) & 0x > > Ah, thanks. I've never had a need to to bit manipulation in Python (or in For anyone interested, my new OS topic has a section on bitwise operations in Python - they are needed for checking stat flags... (see the sig for the link) Alan G Author of

[Tutor] Printing in Windows (was: Further help needed!

2006-01-04 Thread Terry Carroll
I've edited the subject line to be a little more clear. On Wed, 4 Jan 2006, John Corry wrote: > I am using the following code to send a text file to the printer:- [ snip ] > This code works on windows XP + Windows 2000. However it does not work on > windows 98SE. Well, at least that narrows

Re: [Tutor] glibc error while Python script runs

2006-01-04 Thread Danny Yoo
> rn200.bbfxa.com Wed Jan 4 16:23:36 2006 [jobid: 9]: Get status of all > local jobs for this job... > > *** glibc detected *** double free or corruption: 0x09484d58 *** > Aborted Hi Bernard, Ugh. I hate memory allocation bugs. Is it reproducable? Can you run this through a debugger like GDB

Re: [Tutor] Further help needed!

2006-01-04 Thread John Fouhy
[resending 'cause I forgot to address to tutor..] On 05/01/06, John Corry <[EMAIL PROTECTED]> wrote: > This code works on windows XP + Windows 2000. However it does not work on > windows 98SE. I have tried this code on 3 seperate machines with windows > 98SE. They all come up with the same erro

[Tutor] Design questions?

2006-01-04 Thread Richard
Hi all! First I want to thank everyone for the help in regards to learning python book and gui's!! Happy New year!! I am just learning Python, and I do have a project in mind but I am not sure where to start on it. I am in the Insurance business so the project is a rate calculator. I have a to

[Tutor] glibc error while Python script runs

2006-01-04 Thread Bernard Lebel
Hello, I'm not sure if it's the appropriate place for this question, but since it happens because of a Python script So I have this Python script that runs on render farm nodes. All seem to work well, but at one point I get this crash: rn200.bbfxa.com Wed Jan 4 16:23:36 2006 [jobid: 9]:

[Tutor] Further help needed!

2006-01-04 Thread John Corry
I am using the following code to send a text file to the printer:- import win32api filename = "testprint.txt" fileobj=open (filename, "w") fileobj.write ("This is a test") fileobj.close() win32api.ShellExecute ( 0, "print", filename, None, ".", 0 ) This code works on windows XP + Wind

[Tutor] Fw: query regarding mysql database backup?? please Help

2006-01-04 Thread deepak.gupta
  - Original Message - From: deepak.gupta To: tutor@python.org Sent: Wednesday, January 04, 2006 5:27 PM Subject: query regarding mysql database backup?? please Help Hi, I did my script like this  for backing my max_everest_2006 mysql database   >>import os > > target_dir = "./b

[Tutor] query regarding mysql database backup?? please Help

2006-01-04 Thread deepak.gupta
Hi, I did my script like this  for backing my max_everest_2006 mysql database   >>import os > > target_dir = "./backup"> > os.system("mysqldump --add-drop-table -c -u root  -pmysql max_everest_2006 > "+target_dir+"/table.bak.sql")      root is my user name,mysql is my password,max_everest_

Re: [Tutor] XOR, bytes and strings

2006-01-04 Thread Danny Yoo
> i'm a totally newbie to python, but i can't resist to try to communicyte > with an ICQ-server via my own tool. > > now i have the problem that i should encrypt a string (the password) by > XOR with this bytes: f3, 26, 81, c4, 39, 86, db, 92, 71, a3, b9, e6, 53, > 7a, 95, 7c. Hello Tobi, Accor

[Tutor] XOR, bytes and strings

2006-01-04 Thread webmeister8f
i'm a totally newbie to python, but i can't resist to try to communicyte with an ICQ-server via my own tool. now i have the problem that i should encrypt a string (the password) by XOR with this bytes: f3, 26, 81, c4, 39, 86, db, 92, 71, a3, b9, e6, 53, 7a, 95, 7c. but although i have searched

Re: [Tutor] HD/DVD/CD

2006-01-04 Thread Terry Carroll
On Wed, 4 Jan 2006, Kent Johnson wrote: > To get the desired representation, you have to find a way to make Python > interpret the number as an unsigned integer. One way to do this is to > convert it to a long integer, then mask off the sign bits: > >>> i = long(-1972144115) & 0x Ah,

Re: [Tutor] HD/DVD/CD

2006-01-04 Thread Kent Johnson
Terry Carroll wrote: > I'm assuming you want the same serial # that shows up when you do a > DIR on the CD, e.g.: > > >dir d: >Volume in drive D is 050512_1752 >Volume Serial Number is 8A73-780D > > Here's some code: > > import win32api CD_Info = win32api.GetVolumeInformation

Re: [Tutor] How to make to exit the loop, while typing Enter

2006-01-04 Thread Alan Gauld
Hi John, The code is looking better, some minor points below: > import sys > maxmark = [] > counter = 0 > > while 1: >try: >mark = int(raw_input("Enter the Values for the Array: ")) >maxmark.append(mark) >print maxmark >except ValueError: >#print "From H

Re: [Tutor] Tutor Digest, Vol 23, Issue 7

2006-01-04 Thread Ron Speerstra
Wouw, this is realy good!! Thanks for all, I can go on now with my DB. you were realy helpful, all. > > >>> import win32api > >>> CD_Info = win32api.GetVolumeInformation("D:/") > >>> serno = CD_Info[1] > >>> if serno < 0: >...serno_str = "%X" % (0x1+

Re: [Tutor] Python code pretty-print?

2006-01-04 Thread Christian Meesters
On Tue, 3 Jan 2006, Lance E Sloan wrote: > A colleague of mine often develops Python code under Mac OS X. He would > like to be able to print the code in an easily readable format. He's > found that kwrite on Linux does a very nice job, but it's inconvenient > to copy his code to a Linux box jus