[Tutor] printing items form list

2017-03-03 Thread Rafael Knuth
I want to print individual items from a list like this: You have a book, towel, shirt, pants in your luggage. This is my code: suitcase = ["book", "towel", "shirt", "pants"] print ("You have a %s in your luggage." % suitcase) Instead of printing out the items on the list, my code appends the li

Re: [Tutor] printing items form list

2017-03-03 Thread Peter Otten
Rafael Knuth wrote: > I want to print individual items from a list like this: > > You have a book, towel, shirt, pants in your luggage. > > This is my code: > > suitcase = ["book", "towel", "shirt", "pants"] > print ("You have a %s in your luggage." % suitcase) > > Instead of printing out the

[Tutor] Tables in Tkinter

2017-03-03 Thread Pooja Bhalode
Hi, I am trying to use tkintertable in Python 2.7 to create a table in GUI using Tkinter. The table that I am trying to get is a table with scrollable rows. I just want to display the data in the table in the Tkinter window. I do not wish to make it interactive, since just want to display the dat

[Tutor] Radiobuttons (two options out of 4)

2017-03-03 Thread Pooja Bhalode
Hi, I am trying to create a GUI with four options out of which the user is supposed to select two. But once the user selected two out of those four options, the others need to get greyed out at that instant. I tried the following thing: *Label(lom, text = "Choose two options from:").grid(row = 9

Re: [Tutor] printing items form list

2017-03-03 Thread Mats Wichmann
On 03/03/2017 05:12 AM, Rafael Knuth wrote: > I want to print individual items from a list like this: > > You have a book, towel, shirt, pants in your luggage. > > This is my code: > > suitcase = ["book", "towel", "shirt", "pants"] > print ("You have a %s in your luggage." % suitcase) > > Inste

Re: [Tutor] printing items form list

2017-03-03 Thread Antonio Zagheni via Tutor
Hello Rafael, I believe you are a beginner... That is another way to do this...- suitcase = ["book, ", "towel, ", "shirt, ", "pants"] st = '' for i in suitcase:         st = st + i     print ("Yo

Re: [Tutor] printing items form list

2017-03-03 Thread Peter Otten
Antonio Zagheni via Tutor wrote: > suitcase = ["book, ", "towel, ", "shirt, ", "pants"] Hm, looks like you opened Rafael's suitcase while he wasn't looking, and sneaked in some commas and spaces ;) That's cheating... ___ Tutor maillist - Tutor@py

Re: [Tutor] printing items form list

2017-03-03 Thread David Rock
> On Mar 3, 2017, at 12:52, Peter Otten <__pete...@web.de> wrote: > > Antonio Zagheni via Tutor wrote: > >> suitcase = ["book, ", "towel, ", "shirt, ", "pants"] > > Hm, looks like you opened Rafael's suitcase while he wasn't looking, and > sneaked in some commas and spaces ;) > > That's cheati

Re: [Tutor] printing items form list

2017-03-03 Thread Alan Gauld via Tutor
On 03/03/17 18:52, Peter Otten wrote: > Antonio Zagheni via Tutor wrote: > >> suitcase = ["book, ", "towel, ", "shirt, ", "pants"] > > Hm, looks like you opened Rafael's suitcase while he wasn't looking, and > sneaked in some commas and spaces ;) > > That's cheating... Its also very difficul

Re: [Tutor] Tables in Tkinter

2017-03-03 Thread Alan Gauld via Tutor
On 03/03/17 16:07, Pooja Bhalode wrote: > The table that I am trying to get is a table with scrollable rows. I just > want to display the data in the table in the Tkinter window. I do not wish > to make it interactive, since just want to display the data. In that case you could just use a scroll

Re: [Tutor] printing items form list

2017-03-03 Thread dirkjso...@gmail.com
On 03/03/2017 12:19 PM, Alan Gauld via Tutor wrote: On 03/03/17 18:52, Peter Otten wrote: Antonio Zagheni via Tutor wrote: suitcase = ["book, ", "towel, ", "shirt, ", "pants"] Hm, looks like you opened Rafael's suitcase while he wasn't looking, and sneaked in some commas and spaces ;) That's

Re: [Tutor] Radiobuttons (two options out of 4)

2017-03-03 Thread Alan Gauld via Tutor
On 03/03/17 16:43, Pooja Bhalode wrote: > I am trying to create a GUI with four options out of which the user is > supposed to select two. But once the user selected two out of those four > options, the others need to get greyed out at that instant. > > I tried the following thing: > > *Label(lo

Re: [Tutor] printing items form list

2017-03-03 Thread David Rock
> On Mar 3, 2017, at 13:42, dirkjso...@gmail.com wrote: > > On 03/03/2017 12:19 PM, Alan Gauld via Tutor wrote: >> >> That's one reason why join() is a better solution, it >> handles all of that for you. It's also faster, although >> in a small application you'd never notice the difference. >>

[Tutor] pdf generation problem

2017-03-03 Thread Jason Snyder
I have the following program where I am trying to generate a pdf: 1 import matplotlib 2 matplotlib.use('AGG') 3 import matplotlib.pyplot as plt 4 import matplotlib.image as image 5 import matplotlib.gridspec as gridspec 6 from matplotlib.backends.backend_pdf imp

Re: [Tutor] Radiobuttons (two options out of 4)

2017-03-03 Thread Pooja Bhalode
Hi Alan, Thank you for letting me know. I tried putting in the event handlers for the checkbuttons as shown below. num = 0 def selfcheck(event): print "Self Check" num = num + 1 if num == 2: check1butt.config(state = 'disabled') check2butt.config(state = 'disabled') check3butt.con

Re: [Tutor] Tables in Tkinter

2017-03-03 Thread Pooja Bhalode
Hi Alan, Can you please guide me to an example related to this problem? I do not know how to use the scrollable frame, set backgrounds etc. Sorry, I am new to tables in Tkinter. I could not find any examples as well Please let me know. Thank you Pooja On Fri, Mar 3, 2017 at 2:35 PM, Alan Gauld

[Tutor] Problems with matplotlib

2017-03-03 Thread Jason Snyder
I installed the python module matplotlib on a computer and when I try to run a program with the commands: import matplotlib.pyplot as plt I get the following errors: Traceback (most recent call last): File "new.py", line 1, in import matplotlib File "/usr/lib64/python2.7/site-packages/ma

Re: [Tutor] Radiobuttons (two options out of 4)

2017-03-03 Thread Alan Gauld via Tutor
On 03/03/17 20:59, Pooja Bhalode wrote: > I tried putting in the event handlers for the checkbuttons as shown below. > > num = 0 > def selfcheck(event): > print "Self Check" > num = num + 1 > if num == 2: You need num to be inside the function since it needs to be reset to zero on

Re: [Tutor] pdf generation problem

2017-03-03 Thread Alan Gauld via Tutor
On 04/03/17 00:28, Jason Snyder wrote: > I have the following program where I am trying to generate a pdf: > 6 from matplotlib.backends.backend_pdf import PdfPages > 7 import numpy as np > 13 with PdfPages('wx_plot.pdf') as pdf: > When I run it I get the following error: > > Tr

Re: [Tutor] Tables in Tkinter

2017-03-03 Thread Alan Gauld via Tutor
On 03/03/17 21:15, Pooja Bhalode wrote: > Hi Alan, > > Can you please guide me to an example related to this problem? I do not > know how to use the scrollable frame, set backgrounds etc. > Sorry, I am new to tables in Tkinter. I could not find any examples as well WE are all new to tables in Tki

Re: [Tutor] Problems with matplotlib

2017-03-03 Thread Alan Gauld via Tutor
On 03/03/17 22:59, Jason Snyder wrote: > I installed the python module matplotlib on a computer and when I try to > run a program with the commands: > > import matplotlib.pyplot as plt I get the following errors: It could be an installation issue, but really this list is for the core language and

Re: [Tutor] Problems with matplotlib

2017-03-03 Thread Peter Otten
Jason Snyder wrote: > I installed the python module matplotlib on a computer and when I try to > run a program with the commands: > > import matplotlib.pyplot as plt I get the following errors: > > Traceback (most recent call last): > File "new.py", line 1, in > import matplotlib > File

Re: [Tutor] pdf generation problem

2017-03-03 Thread Peter Otten
Jason Snyder wrote: > I have the following program where I am trying to generate a pdf: > > 1 import matplotlib > 2 matplotlib.use('AGG') > 3 import matplotlib.pyplot as plt > 4 import matplotlib.image as image > 5 import matplotlib.gridspec as gridspec > 6 fro