Re: [Tutor] Linux Python install?

2006-01-23 Thread Victor Bouffier
I highly recommend you have a look into ipython. It is a breeze to work with. I usually have a couple of terminal screens open, one with the ipython interpreter, which helps me a lot when testing code snipplets. You can install it using yumex, or just run 'yum install ipython' from the root comma

Re: [Tutor] processing a text file w/ OO?

2006-01-23 Thread Michael
Thanks, Alan. That's exactly the kind of explanation I was looking for. As this is pretty much a one-off project and the data transformations are pretty different for each field, I'll stick with the functional approach. The rule of thumb you mention is useful, too. I hadn't heard that befor

Re: [Tutor] [webbrowser] some help on an error running mozilla firefox

2006-01-23 Thread Henry Finucane
On 1/22/06, Rinzwind <[EMAIL PROTECTED]> wrote: > Why does this: > > >>> import webbrowser > >>> webbrowser.open('http://www.google.com";) > > give me this: > > run-mozilla.sh: Cannot execute > /opt/firefox/mozilla-firefox-bin. > I would assume it's a permissions error. Can you exec

Re: [Tutor] passwords in scripts

2006-01-23 Thread Danny Yoo
On Mon, 23 Jan 2006, Danny Yoo wrote: > Jon Libes of the National Institute of Standards and Technology (NIST) ^^^ Gaah. I'm sorry, that should be "Don", not "Jon". My muscle memory slipped. *grin* ___ Tutor maillist - Tutor@python.org http://

Re: [Tutor] passwords in scripts

2006-01-23 Thread Danny Yoo
Hi Ben, Jon Libes of the National Institute of Standards and Technology (NIST) has written a guide on how to handle passwords in backgrounded processes: http://expect.nist.gov/doc/bgpasswd.pdf It has more suggestions on how to handle passwords securely. As you might expect, it doesn't have

Re: [Tutor] Searching for email id in MySQL giving wrong results

2006-01-23 Thread Alan Gauld
Hi Ziyad, Don't beat yourself up over this, you were trying to be helpful and that's a good thing. The original syntax looked weird to me too, but mainly because the variable was inside a pair of parens, but because I didn't know MySql I didn't say anything at the time. But your answer seemed rea

Re: [Tutor] passwords in scripts

2006-01-23 Thread Ben Vinger
Hi Danny The Unix servers are ancient HP-UX ones. I doubt if an SSH implementation for them exists, but it is not worth my while trying to find out, because I will not be allowed to install anything on them (or even suggest it). So I access them using telnetlib: host = 'hpserver' user = 'backup

Re: [Tutor] Searching for email id in MySQL giving wrong results

2006-01-23 Thread ZIYAD A. M. AL-BATLY
On Mon, 2006-01-23 at 14:00 -0500, Python wrote: > The wrong_string line was lifted from the following code in the OP. > > entry = db.cursor() > entry.execute("""SELECT * FROM contact WHERE email_id = %s""", > (s_email,)) > > The execute method will handle the string substitution

Re: [Tutor] passwords in scripts

2006-01-23 Thread Ben Vinger
Hi Ivan I'm not sure I understand what you are saying here. Surely if the file is compiled it can just run (and will only need to be RE-compiled when I have to change the code (such as when one of the servers has their password changed). I would never need to de-compile, because I'll just keep a

Re: [Tutor] Starbucks does not use two-phase commit

2006-01-23 Thread Bernard Lebel
Thanks a lot Danny. Bernard On 1/23/06, Danny Yoo <[EMAIL PROTECTED]> wrote: > > > On Mon, 23 Jan 2006, Bernard Lebel wrote: > > > Yes that makes sense, but.. what is a "daemon"? Sorry if this is > > super basic question. > > According to: > > http://docs.python.org/lib/thread-objects.h

Re: [Tutor] Why doesn't this work?

2006-01-23 Thread Christopher Spears
Thanks! Is there a name for the type of myopia that develops after staring at the computer screen too long? -Chris --- Jason Massey <[EMAIL PROTECTED]> wrote: > Christopher, > > I copied and pasted your code and it worked only a > few modifications. The > thing I had to change was the indenti

Re: [Tutor] Totorial announcement

2006-01-23 Thread Terry Carroll
On Mon, 23 Jan 2006, Alan Gauld wrote: > But I don't have any other books published (yet) the stuff about > hypnotism and psychic stuff is another Alan Gauld based in > Chicago USA - I get a lot of email for him! :-) A friend of mine is the author of "Just Java," "Not Just Java," "Expert C Prog

Re: [Tutor] Starbucks does not use two-phase commit

2006-01-23 Thread Danny Yoo
On Mon, 23 Jan 2006, Bernard Lebel wrote: > Yes that makes sense, but.. what is a "daemon"? Sorry if this is > super basic question. According to: http://docs.python.org/lib/thread-objects.html """A thread can be flagged as a ``daemon thread''. The significance of this flag is

Re: [Tutor] Why doesn't this work?

2006-01-23 Thread Jason Massey
Christopher, I copied and pasted your code and it worked only a few modifications.  The thing I had to change was the indention level of the: def __and__(self, other): return self.intersect(other) def __or__(self, other): return self.union(other) def __repr__(self): return 'Set:' + list.__repr__(

[Tutor] Why doesn't this work?

2006-01-23 Thread Christopher Spears
I copied this code from Learning Python while learning about extending types by subclassing: class Set(list): def __init__(self, value=[]): list.__init__([]) self.concat(value) def intersect(self, other): res = []

Re: [Tutor] Searching for email id in MySQL giving wrong results

2006-01-23 Thread Python
On Mon, 2006-01-23 at 19:46 +, Alan Gauld wrote: > >> >> wrong_string = '''SELECT s FROM t WHERE id=%s''' , (email_id) > >> > > >> The OP must replace the comma with a % character for the string > >> substitution to take place. > > > > The wrong_string line was lifted from the following

Re: [Tutor] Starbucks does not use two-phase commit

2006-01-23 Thread Bernard Lebel
Hi Danny, Yes that makes sense, but.. what is a "daemon"? Sorry if this is super basic question. Thanks Bernard On 1/23/06, Danny Yoo <[EMAIL PROTECTED]> wrote: > > > > I noticed that when I do a keyboard interrupt, I get the keyboard > > interrupt exception messages, but after that it

Re: [Tutor] Searching for email id in MySQL giving wrong results

2006-01-23 Thread Alan Gauld
>> >> wrong_string = '''SELECT s FROM t WHERE id=%s''' , (email_id) >> > >> The OP must replace the comma with a % character for the string >> substitution to take place. > > The wrong_string line was lifted from the following code in the OP. > >entry = db.cursor() >entry.ex

Re: [Tutor] Python install on Linux

2006-01-23 Thread ron
A simple way to migrate to Linux and get a recent version of Python by default would be to download a copy of Ubuntu Linux. You can burn it onto a CD, then pop it ino the cd drive and boot it on your Windows machine. It runs in a virtual machine, so you are assured that your Windows installation wi

Re: [Tutor] Searching for email id in MySQL giving wrong results

2006-01-23 Thread Python
On Mon, 2006-01-23 at 18:17 +, Alan Gauld wrote: > > On Sun, 2006-01-22 at 21:23 +0300, ZIYAD A. M. AL-BATLY wrote: > >> wrong_string = '''SELECT s FROM t WHERE id=%s''' , (email_id) > > > > The string is being used in a call to cursor.execute. The email_id is a > > second parameter g

Re: [Tutor] Starbucks does not use two-phase commit

2006-01-23 Thread Danny Yoo
> I noticed that when I do a keyboard interrupt, I get the keyboard > interrupt exception messages, but after that it keeps hangning and never > returns to the command line input mode. I have to close the shell to > really end the program afaics. Hi Bernard, When we're using the high-level 'thr

Re: [Tutor] Searching for email id in MySQL giving wrong results

2006-01-23 Thread Python
On Mon, 2006-01-23 at 18:17 +, Alan Gauld wrote: > > On Sun, 2006-01-22 at 21:23 +0300, ZIYAD A. M. AL-BATLY wrote: > >> wrong_string = '''SELECT s FROM t WHERE id=%s''' , (email_id) > > > > The string is being used in a call to cursor.execute. The email_id is a > > second parameter g

Re: [Tutor] Linux Python install?

2006-01-23 Thread Alan Gauld
> from Windows XP, it's not clear to me how to accomplish a Python install > on Linux. That depends on your distro. Each distribution has its own package management tool. eg. On RedHat its rpm(and there is a GUI tool too), on Debian its getappt or somesuch... Python should already be installe

Re: [Tutor] Searching for email id in MySQL giving wrong results

2006-01-23 Thread Alan Gauld
> On Sun, 2006-01-22 at 21:23 +0300, ZIYAD A. M. AL-BATLY wrote: >> wrong_string = '''SELECT s FROM t WHERE id=%s''' , (email_id) > > The string is being used in a call to cursor.execute. The email_id is a > second parameter getting passed to execute. That is the *correct* > approach to

Re: [Tutor] python-based system programming and admin?

2006-01-23 Thread Mike Hansen
> > > Subject: > [Tutor] python-based system programming and admin? > From: > Neal McBurnett <[EMAIL PROTECTED]> > Date: > Fri, 20 Jan 2006 21:01:03 -0700 (MST) > To: > tutor > > To: > tutor > > > I'm an experienced linu

Re: [Tutor] Starbucks does not use two-phase commit

2006-01-23 Thread Bernard Lebel
Hi Danny, Just to report something regarding the code you have provided. I noticed that when I do a keyboard interrupt, I get the keyboard interrupt exception messages, but after that it keeps hangning and never returns to the command line input mode. I have to close the shell to really end the p

Re: [Tutor] Linux Python install?

2006-01-23 Thread Python
On Mon, 2006-01-23 at 09:28 -0500, CPIM Ronin wrote: > Sorry to bother the list with so simple a question but on moving to Linux > from Windows XP, it's not clear to me how to accomplish a Python install on > Linux. On XP it was mostly point and click on a ".msi" file (with msi > standing for M

Re: [Tutor] PLZ REPLY SOON

2006-01-23 Thread bob
At 10:24 PM 1/22/2006, Shalini R wrote: >Hi sir, > I'm new to python & postgres as I've created a form in html & a >table in postgres. There is a field in form which will take multiple >value My guess is that each checkbox needs its own name, rather than all of them using arrFacility. Give that

[Tutor] Linux Python install?

2006-01-23 Thread CPIM Ronin
Sorry to bother the list with so simple a question but on moving to Linux from Windows XP, it's not clear to me how to accomplish a Python install on Linux. On XP it was mostly point and click on a ".msi" file (with msi standing for Microsoft install). I've loaded the latest Fedora/Redhat rele

Re: [Tutor] Searching for email id in MySQL giving wrong results

2006-01-23 Thread Python
On Sun, 2006-01-22 at 21:23 +0300, ZIYAD A. M. AL-BATLY wrote: > wrong_string = '''SELECT s FROM t WHERE id=%s''' , (email_id) The string is being used in a call to cursor.execute. The email_id is a second parameter getting passed to execute. That is the *correct* approach to use. That

Re: [Tutor] How can I clean the screen

2006-01-23 Thread Edgar Antonio Rodriguez Velazco
You can use the function system() of the os module. os.system('clear') in Unix or in Windows os.system('clear')-- Edgar A. Rodriguez V. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How can I clean the screen

2006-01-23 Thread Alan Gauld
> I tried os.system('cls')...the screen seemed to hang. Did you try hitting Enter after it? cls will just clear the screeen... Alan G. -Original Message- From: Alan Gauld [mailto:[EMAIL PROTECTED] Sent: Monday, January 23, 2006 3:37 PM To: Suri Chitti; tutor@python.org Subject: Re: [T

Re: [Tutor] How can I clean the screen

2006-01-23 Thread Ivan Furone
2006/1/23, Suri Chitti <[EMAIL PROTECTED]>: > > Dear group, >If I am executing a python prog from the command line and > need to clear the screen (like using the cls command at the windows cmd > prompt) midway into the program, how do I do it?? Any inputs will be > greatly appreciated.

[Tutor] Totorial announcement

2006-01-23 Thread Ivan Furone
Sorry to both A.Gauld and Rinzwind for my previous mistake in addressing. Great,Alan,I got pretty much help from your OS tutorial in my past hard times in learning Python. I'm glad you've completed it :) Cheers Ivan ___ Tutor maillist - Tutor@python.or

Re: [Tutor] Totorial announcement

2006-01-23 Thread Rinzwind
LOL! Did you know I actually thought "wtf and a book about coding and a book about hypnotism? WOW". :D :D :D Well I like books cuz it's easier to carry around inside trains and busses ;) Wim On 1/23/06, Alan Gauld <[EMAIL PROTECTED]> wrote: > > Saves me ordering the book :-) > > I saw it on b

Re: [Tutor] Searching for email id in MySQL giving wrong results [ Try out pattern Search ]

2006-01-23 Thread John Joseph
Hi Thanks for the tip now I am trying to do pattern matching for MySQL , but I am not getting the result on MySQL , to select for all email starting with jos we do select * from contact where email_id like "jos%"; but I get confused how to use it , while executing it in python , how to

Re: [Tutor] Totorial announcement

2006-01-23 Thread Alan Gauld
> Saves me ordering the book :-) > I saw it on bol.com together with another of your books. The book is slightly different and has some extra chapters but it is now quite out of date, I recommend the web version (which also has a lot of material not in the book, so swings and roundabouts there.

Re: [Tutor] How can I clean the screen

2006-01-23 Thread Suri Chitti
I tried os.system('cls')...the screen seemed to hang. -Original Message- From: Alan Gauld [mailto:[EMAIL PROTECTED] Sent: Monday, January 23, 2006 3:37 PM To: Suri Chitti; tutor@python.org Subject: Re: [Tutor] How can I clean the screen >If I am executing a python prog from t

Re: [Tutor] Totorial announcement

2006-01-23 Thread Rinzwind
Saves me ordering the book :-) I saw it on bol.com together with another of your books. Those hours is too much for me otherwise you'd have a Dutch version too :-) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] python-based system programming and admin?

2006-01-23 Thread lumbricus
> I just have to tell the user to ssh in and run 'ipython' to > get a familiar and flexible environment. Put a link on his Desktop which points to "ssh -X [EMAIL PROTECTED] ipython" man ssh > The system is a server - doesn't even need X libraries, which are a > significant source of security conc

Re: [Tutor] How can I clean the screen

2006-01-23 Thread Alan Gauld
>If I am executing a python prog from the command line and > need to clear the screen (like using the cls command at the windows cmd Thus should be a FAQ somewhere... Clearing the screen is terminal specific so Python doesn't have a single way to do it. Since you mention Windows I'll

Re: [Tutor] mac users

2006-01-23 Thread Alan Gauld
Hi Shane, > I am a macOSX user and I would like to simultaneously learn how to program > and learn python. Does anyone know of a good book, or online tutorial that > would be helpful? The Python web site lists lots of tutorials and they are all free so try them and see which suits your style.

Re: [Tutor] processing a text file w/ OO?

2006-01-23 Thread Alan Gauld
> I'm processing a tab-delimited text file where I read in a file, > perform a bunch of operations on the items, and then write them out > again to a fixed-width text file. > > I've been doing this with a very functional approach: > > Anyway, this all works fine. Not knowing much about OO, I'

Re: [Tutor] How can I clean the screen

2006-01-23 Thread Pujo Aji
Try :import osos.system('cls')you will able to see the effect when you run in windows console.Cheers,pujoOn 1/23/06, Suri Chitti <[EMAIL PROTECTED]> wrote:Dear group,    If I am executing a python prog from the command line andneed to clear the screen (like using the cls command at the win

[Tutor] How can I clean the screen

2006-01-23 Thread Suri Chitti
Dear group, If I am executing a python prog from the command line and need to clear the screen (like using the cls command at the windows cmd prompt) midway into the program, how do I do it?? Any inputs will be greatly appreciated. Thanks. _

[Tutor] PLZ REPLY SOON

2006-01-23 Thread Shalini R
Hi sir, I'm new to python & postgres as I've created a form in html & a table in postgres. There is a field in form which will take multiple value the problem which i'm facing is i'm getting single value but when i want multiple values to be inserted to postgres table it is not happening the dtml

[Tutor] Senior Project With Python

2006-01-23 Thread derroach
Greetings! My name is Deric Roach, and I am a senior at Sterling High School in Sterling, Kansas. This year, the school is conducting senior projects. For my senior project, I have decided to learn the python programming language and design a simple (yet amusing) role-playing game. For the underta

[Tutor] mac users

2006-01-23 Thread Shane Rymer
Dear Group, I am a macOSX user and I would like to simultaneously learn how to program and learn python. Does anyone know of a good book, or online tutorial that would be helpful? I got the book, "Learning to Program in Python for the absolute beginner". but... its was made for Windows users an