[Tutor] raw input program is still running.

Satheesan Varier satheesan.varier at gmail.com
Sat Nov 23 04:04:13 CET 2013


Re : raw input program is still running.

No Code ?
Mostly, you are in an infinite loop

>>> for n in range(2):
raw_input("name : ")
raw_input("city : ")

name : first name
'first name'
city : first city
'first city'
name : second name
'second name'
city : second city
'second city'
>>>

>>> while True:
raw_input("name : ")
raw_input("city : ")
print
flag=raw_input("continue ..? ( Y ) : ")
if flag != 'Y' :
break

name : a
'a'
city : b
'b'

continue ..? ( Y ) : Y
name : c
'c'
city : d
'd'

continue ..? ( Y ) : y
>>>




On Fri, Nov 22, 2013 at 9:23 PM, <tutor-request at python.org> wrote:

> Send Tutor mailing list submissions to
>         tutor at python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://mail.python.org/mailman/listinfo/tutor
> or, via email, send a message with subject or body 'help' to
>         tutor-request at python.org
>
> You can reach the person managing the list at
>         tutor-owner at python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Tutor digest..."
>
>
> Today's Topics:
>
>    1. raw input program is still running. (Imrose Baga)
>    2. Extarcting data tables from a text file (Ruben Guerrero)
>    3. Re: raw input program is still running. (Amit Saha)
>    4. Re: raw input program is still running. (Steven D'Aprano)
>    5. Re: Extarcting data tables from a text file (Mark Lawrence)
>    6. Using tkinter::ttk::treeview to implement data view.
>       (Davnobezimeni Sasha Balagura)
>    7. numrows returning -1 (Paul Steele)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 22 Nov 2013 13:02:13 -0800
> From: Imrose Baga <imrosebaga at gmail.com>
> To: tutor at python.org
> Subject: [Tutor] raw input program is still running.
> Message-ID:
>         <
> CAPS79oiCwyQ6N3sYa5HSuRApCd3PzND0sVeYXUyyAKDmz9jeRQ at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi I've just started using python. I tried to use raw input for name, city
> and state. But only my name shows up and then when i try to close the
> program, it is showed as still running and asks if I wish to kill the
> program. please any help
> --
> Regards,
>
> Imrose Baga
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mail.python.org/pipermail/tutor/attachments/20131122/937778c1/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Fri, 22 Nov 2013 11:25:06 -0500
> From: Ruben Guerrero <rudaguerman at gmail.com>
> To: tutor at python.org
> Subject: [Tutor] Extarcting data tables from a text file
> Message-ID:
>         <
> CAB44GdocQsHoPjrxb3a4YFziPhAD886Jv7YujdhAgZy1iSEXoQ at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Dear tutor,
>
> I am  a beginner in python and I need  your guidance to  write a python
> script  to extract many nxn data tables of variable nunber of rows from a
> text file as in the following example
>
>       Condensed to atoms (all electrons):
>               1          2          3          4          5          6
>      1  Cl   0.000000   0.304108  -0.101110  -0.108502  -0.108502
> 0.024111
>      2  C    0.304108   0.000000   0.515965   0.332621   0.332621
>  -0.004054
>      3  C   -0.101110   0.515965   0.000000  -0.013334  -0.013334
> 0.352916
>      4  H   -0.108502   0.332621  -0.013334   0.000000  -0.133436
>  -0.028924
>      5  H   -0.108502   0.332621  -0.013334  -0.133436   0.000000
>  -0.028924
>      6  H    0.024111  -0.004054   0.352916  -0.028924  -0.028924
> 0.000000
>      7  H   -0.030910  -0.074027   0.364085  -0.053300   0.048704
>  -0.123402
>      8  H   -0.030910  -0.074027   0.364085   0.048704  -0.053300
>  -0.123402
>               7          8
>      1  Cl  -0.030910  -0.030910
>      2  C   -0.074027  -0.074027
>      3  C    0.364085   0.364085
>      4  H   -0.053300   0.048704
>      5  H    0.048704  -0.053300
>      6  H   -0.123402  -0.123402
>      7  H    0.000000  -0.118520
>      8  H   -0.118520   0.000000
>  Mulliken atomic charges:
>
> to other text  file with the numerical information in the table
>  concatenated by columns. The phrases in red always delimite the tables in
> the original file. In the python generated file I need the following:   a
> text flag (maybe  a line with the "O" charanter) delimiting each table, a
> second line with the total number of rows (atoms) in the table followed by
> a line with the ordered string of chemical symbols separated by a silgle
> space.
>
> My aim is load the numerical data from this file  to a c++ program to
> process this information.
>
> Thanks in advance.
>
> -Ruben.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mail.python.org/pipermail/tutor/attachments/20131122/b4aa577d/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 3
> Date: Sat, 23 Nov 2013 07:57:37 +1000
> From: Amit Saha <amitsaha.in at gmail.com>
> To: Imrose Baga <imrosebaga at gmail.com>
> Cc: "tutor at python.org" <tutor at python.org>
> Subject: Re: [Tutor] raw input program is still running.
> Message-ID:
>         <CANODV3mqizO-5GYFAYK=
> z-LqJqsW_+NaUeM3_NyE+yb3E-VUMg at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Sat, Nov 23, 2013 at 7:02 AM, Imrose Baga <imrosebaga at gmail.com> wrote:
> > Hi I've just started using python. I tried to use raw input for name,
> city
> > and state. But only my name shows up and then when i try to close the
> > program, it is showed as still running and asks if I wish to kill the
> > program. please any help
>
> Please share your program.
>
>
>
> --
> http://echorand.me
>
>
> ------------------------------
>
> Message: 4
> Date: Sat, 23 Nov 2013 10:50:23 +1100
> From: Steven D'Aprano <steve at pearwood.info>
> To: tutor at python.org
> Subject: Re: [Tutor] raw input program is still running.
> Message-ID: <20131122235022.GM2085 at ando>
> Content-Type: text/plain; charset=us-ascii
>
> On Fri, Nov 22, 2013 at 01:02:13PM -0800, Imrose Baga wrote:
> > Hi I've just started using python. I tried to use raw input for name,
> city
> > and state. But only my name shows up and then when i try to close the
> > program, it is showed as still running and asks if I wish to kill the
> > program. please any help
>
> Just a moment, let me get my crystal ball and see what you are doing...
>
> I see... nothing. Perhaps my crystal ball is out of order? Next time,
> please help us to help you by showing the code you are running, since
> crystal balls are often inaccurate, and while inspecting the entrails of
> animals is always correct, it does tend to me smelly and messy.
>
>
> You can interrupt whatever Python is doing this way:
>
> * click on the window that is running Python
>
> * hold down the Control key
>
> * press the C key.
>
> You may need to do that a couple of times.
>
> Or, you can just close the window and kill the program, that will be
> harmless.
>
>
>
> --
> Steven
>
>
> ------------------------------
>
> Message: 5
> Date: Sat, 23 Nov 2013 01:08:28 +0000
> From: Mark Lawrence <breamoreboy at yahoo.co.uk>
> To: tutor at python.org
> Subject: Re: [Tutor] Extarcting data tables from a text file
> Message-ID: <l6ov4l$gpc$1 at ger.gmane.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> On 22/11/2013 16:25, Ruben Guerrero wrote:
> > Dear tutor,
> >
> > I am  a beginner in python and I need  your guidance to  write a python
> > script  to extract many nxn data tables of variable nunber of rows from
> > a text file as in the following example
> >
> > Condensed to atoms (all electrons):
> >                1          2          3          4          5          6
> >       1  Cl   0.000000   0.304108  -0.101110  -0.108502  -0.108502
> > 0.024111
> >       2  C    0.304108   0.000000   0.515965   0.332621   0.332621
> >   -0.004054
> >       3  C   -0.101110   0.515965   0.000000  -0.013334  -0.013334
> > 0.352916
> >       4  H   -0.108502   0.332621  -0.013334   0.000000  -0.133436
> >   -0.028924
> >       5  H   -0.108502   0.332621  -0.013334  -0.133436   0.000000
> >   -0.028924
> >       6  H    0.024111  -0.004054   0.352916  -0.028924  -0.028924
> > 0.000000
> >       7  H   -0.030910  -0.074027   0.364085  -0.053300   0.048704
> >   -0.123402
> >       8  H   -0.030910  -0.074027   0.364085   0.048704  -0.053300
> >   -0.123402
> >                7          8
> >       1  Cl  -0.030910  -0.030910
> >       2  C   -0.074027  -0.074027
> >       3  C    0.364085   0.364085
> >       4  H   -0.053300   0.048704
> >       5  H    0.048704  -0.053300
> >       6  H   -0.123402  -0.123402
> >       7  H    0.000000  -0.118520
> >       8  H   -0.118520   0.000000
> > Mulliken atomic charges:
> >
> > to other text  file with the numerical information in the table
> >   concatenated by columns. The phrases in red always delimite the tables
> > in the original file. In the python generated file I need the following:
> >    a text flag (maybe  a line with the "O" charanter) delimiting each
> > table, a second line with the total number of rows (atoms) in the table
> > followed by a line with the ordered string of chemical symbols separated
> > by a silgle space.
> >
> > My aim is load the numerical data from this file  to a c++ program to
> > process this information.
> >
> > Thanks in advance.
> >
> > -Ruben.
> >
>
> I'm sorry but we don't write code for you here.  I suggest that you
> start out by reading the tutorial here
> http://docs.python.org/3/tutorial/index.html, try writing something and
> when and if you run into problems please feel free to get back to us.
>
> --
> Python is the second best programming language in the world.
> But the best has yet to be invented.  Christian Tismer
>
> Mark Lawrence
>
>
>
> ------------------------------
>
> Message: 6
> Date: Sat, 23 Nov 2013 03:19:46 +0200
> From: Davnobezimeni Sasha Balagura <davnobezimeni at gmail.com>
> To: tutor at python.org
> Subject: [Tutor] Using tkinter::ttk::treeview to implement data view.
> Message-ID:
>         <
> CAA7iXku8_KD9wsn+8xFQRFU9YhDMobgq1kXAsN7fhxPt5iC_AQ at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hello.
> I have to implement parcer for .txt file with special formating. There are
> a lot of data to display, modify, add. I decided to use
> tkinter::ttk:treeviev for this. And it really good one, very fast and good
> looking..but..
> But I cant set borders between cells, like in Excel. Is it real at all for
> this widget? Or i've just overlooked something?
>
> Best regards,
> Alex
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mail.python.org/pipermail/tutor/attachments/20131123/0599771c/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 7
> Date: Fri, 22 Nov 2013 16:08:25 -0600
> From: Paul Steele <paul.steele1 at gmail.com>
> To: tutor at python.org
> Subject: [Tutor] numrows returning -1
> Message-ID:
>         <
> CALD6M00nU1usQD0OdeRb4SQTPWiDiNQRZWwxN15UUdptAx4iqg at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hey all...
>
> I am getting a numrows count of -1 when I print numrows (see line 23 of the
> code).   What does "-1" mean?    I think my connection is working and my
> table has data.
>
> Here's my code...
>
> #!/usr/bin/python
> # -*- coding: utf-8 -*-
>
> import mysql.connector
> from mysql.connector import errorcode
>
> try:
>   con = mysql.connector.connect(user='root', password='pw848596',
>                               host='127.0.0.1',
>                               database='mydb')
> except mysql.connector.Error as err:
>   if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
>     print("Something is wrong with your user name or password")
>   elif err.errno == errorcode.ER_BAD_DB_ERROR:
>     print("Database does not exists")
>   else:
>     print(err)
> else:
>   cur=con.cursor()
>
>   cur.execute("select Name from Rosters")
>   numrows = cur.rowcount
>   print numrows
>   for x in xrange(0,numrows):
>       row = cursor.fetchone()
>       print "Name"
>
> con.close()
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mail.python.org/pipermail/tutor/attachments/20131122/bf7c39de/attachment.html
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> https://mail.python.org/mailman/listinfo/tutor
>
>
> ------------------------------
>
> End of Tutor Digest, Vol 117, Issue 44
> **************************************
>



-- 
Warm regards.

Satheesan Varier
860 (970) 2732
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20131122/81c67c95/attachment-0001.html>


More information about the Tutor mailing list