[Tutor] How to call mysqlcommand in Python , "mysqldump for backup "

2005-12-27 Thread John Joseph
Hi I am trying to execute some MySQL commands using some python scripts I want to do a “mysqldump” of my database “john” to a file backup.date.sql the normal command to take a dump is mysqldump john> backup.sql I tried python , by importing “import os”

Re: [Tutor] How to call mysqlcommand in Python , "mysqldump for backup "

2005-12-28 Thread John Joseph
--- nephish <[EMAIL PROTECTED]> wrote: > ooh ooh, i know this one, i have python do this for > me every day ! > > target_dir = '/path/to/where/you/want/to/dump' > > os.system("mysqldump --add-drop-table -c -u user > -ppassword database > table > "+target_dir+"/table.bak.sql") > > dont forget t

[Tutor] SyntaxError while defining tuple : Guidance requested

2005-12-31 Thread John Joseph
Hi I am trying out learning python , using the book “Python Programming for the absolute beginner “ by Michael Dawson I get File "page114.py", line 12 inventory = ("Sword","Armor","Shield","Healing Potion") ^ SyntaxError: invalid syntax when I run the program

Re: [Tutor] SyntaxError while defining tuple : Guidance requested

2005-12-31 Thread John Joseph
--- Brian van den Broek <[EMAIL PROTECTED]> wrote: > Hi John, > > sometimes the syntax error indicator isn't quite > pointing to the > problem. In your case, the place it points was where > Python worked out > there was a problem, but the difficulty with your > code is several > lines up (I've

[Tutor] TypeError: object doesn't support item assignment [ Trying to learn how to enter value in array ]

2006-01-02 Thread John Joseph
Hi All I am trying to write a program in which I enter the no of students and then for the students I enter the marks and later on Display the marks The script which I wrote is given below , when I run the program I get error “TypeError: object doesn't support item assignment “ , my aim in

[Tutor] Thanks , Now able to do Marks entry and display it using Histogram

2006-01-03 Thread John Joseph
Hi All Thanks to Shantanoo,Brian,Alan,Owen Now I am able to enter the marks for each students , and display the results the frequency of marks in histogram Even though I am able to display the histogram of the marks with students , I would like to modify it further as I learn m

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

2006-01-03 Thread John Joseph
Hi I am trying to write a program in which it ask for entries for the list , But if I press Enter it should exit the while loop without giving errors ,I have problem in making it work , right now if I press enter to exit , the program terminates showing error I am added my script wh

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

2006-01-03 Thread John Joseph
Hi All I was able to exit the while loop , using sys module also I was able to find the maximum no of marks entered , I am adding my code , for comments and suggestions Thanks for the support Joseph John *

[Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-08 Thread John Joseph
Hi All I am trying to find out the duplicates in a list , as for beginning I wanted to compare the adjacent elements in list , for this purpose I wrote a script for checking the adjacent elements in a list, if same , it prints the result that , the adjacent numbers are same , it not it wi

Re: [Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-08 Thread John Joseph
--- Guillermo Fernandez Castellanos <[EMAIL PROTECTED]> wrote: > Hi, > > Look at this: > >>> i=[1,2,3] > >>> i[len(i)] > Traceback (most recent call last): >File "", line 1, in ? > IndexError: list index out of range > > > This means that I have tried to access an element > that is out o

Re: [Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-09 Thread John Joseph
d Hat 3.4.2-6.fc3)] on linux2 THANKS Joseph John --- Brian van den Broek <[EMAIL PROTECTED]> wrote: > John Joseph said unto the world upon 08/01/06 06:36 We no longer need the continue clause, as converting to set ensures we won't ev

Re: [Tutor] Complete programming newbie requires tutorial.

2006-01-14 Thread John Joseph
--- Chris Andrew <[EMAIL PROTECTED]> wrote: > Hi, all. > > I wonder whether you can help. I've just subscribed > to the list, so look > forward to participating. I have been using GNU/ > Linux since about 1999, > but am a complete newbie when it comes to > programming. > > I bought the O'Rei

Re: [Tutor] IndexError: list index out of range [ Program work fine , but gives this message , guidance requested ]

2006-01-14 Thread John Joseph
--- Danny Yoo <[EMAIL PROTECTED]> wrote: > >I get the error for set > > >>> set((1,1,1,2,2,2,2,2,3,4,4,5)) > > Traceback (most recent call last): > > File "", line 1, in ? > > NameError: name 'set' is not defined > > Hi John, > > For Python 2.3.4, you'll need to add the line: >

[Tutor] "while" loop for satisfing two conditions , advice requested

2006-01-15 Thread John Joseph
Hi I am trying to use “while” loop , here I want while loop to check for two conditions , I am not getting an idea how to use “while” loop for checking two conditions I used "&" condition , but it is not giving me the expected results I used in this way

[Tutor] Links for programming using MySQL

2006-01-19 Thread John Joseph
Hi I wanted to try out python with MySQL databases , I would like to get info about the link to sites , which gives you examples on how to do python programming by using MySQL database Please guide Thanks Joseph John

[Tutor] Python + MySQL , my first simple program does not gives results

2006-01-19 Thread John Joseph
Hi I tried out my first Pyhton program with MySQL I was trying to get the some result , eg describe table, select * from table but my program does not give the expected results , nor it gives any error I am adding my code in this mail P

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

2006-01-22 Thread John Joseph
Hi Thanks to Allan,Danny,Pujo I did my simple python script for MySQL , the scripts add the data , and search for the data and display I have problem in searching email id ,ie If search for the [EMAIL PROTECTED] , I will not get any result , Guidance and advice needed

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

2006-01-23 Thread John Joseph
rint s entry.execute('''SELECT * FROM contact WHERE email_id like %s''', (s_email,)) s = entry.fetchall() print s ~ ~ --- "ZIYAD A. M. AL-BATLY" <[EMAIL PROTECTED]> wrote: > On Sun, 2006-01-22 at 12:43 +, John Joseph > wrote: > &

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

2006-01-28 Thread John Joseph
2 Enter the Email to be searched loan () U want to search the contacts by 0 - Quit 1 - Name 2 - email_id 3 - phone 4 - fax Choice :

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

2006-01-29 Thread John Joseph
--- Danny Yoo <[EMAIL PROTECTED]> wrote: > > Hi John, > > Ok; because the question you're asking looks a > little homework-y, we have > to be a little bit more cautious in our answers. > What part are you > getting stuck on? > > > Do you understand how SQL wildcards work? There's a > good n

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

2006-01-29 Thread John Joseph
--- Danny Yoo <[EMAIL PROTECTED]> wrote: > > the email id which starts with “j” is > > select * from contact where email_id like 'j%'; > > Hi John, > > Ok, looks good so far. So in a Python program, we > might try something > like this: > > ##

[Tutor] Cannot run .py file from apache web server , Guidance requested

2006-01-31 Thread John Joseph
Hi I am trying to execute .py scripts from my apache web server , but it is not giving the results as how I run php files , it just displays the contents of the script , I am able to run and get results of PHP from the same loaction my “sample-test.py “file is as follows import cgi reshtm