[Tutor] Why does this function execute before being called?

2015-11-07 Thread Chris Roy-Smith
Hi, Environment: Python 2.7 Linux (Ubuntu 15.10) I am experiencing a problem with the code below running the "genF" function on opening the second window. I expected that function to be executed on clicking the 'fill text' button. The text widget gets filled on opening the window. This is my f

[Tutor] Regarding to kivy installation

2015-11-07 Thread shubham sharma
Respected sir/madam, hello to all members of python.org . I had successfully downloaded kivy on window7 64-bit version.but when i try to install it then it show me error like: Traceback (most recent call last): File "C:/Python27/kivyhello.py", line 4, in from kivy.app import App File "

Re: [Tutor] Why does this function execute before being called?

2015-11-07 Thread Alan Gauld
On 07/11/15 04:34, Chris Roy-Smith wrote: def genF(ofield): ... for x in range(10): def second(): main=Toplevel(root) ofield=Text(main, height=15, width=15) ofield.pack() B3=Button(main, text='exit', command=main.destroy) B3.pack() B4=Button(main, text='fill

Re: [Tutor] Regarding to kivy installation

2015-11-07 Thread Alan Gauld
On 07/11/15 03:39, shubham sharma wrote: Respected sir/madam, hello to all members of python.org . I had successfully downloaded kivy on window7 64-bit version.but when i try to install it then it show me error like: Traceback (most recent call last): File "C:/Python27/kivyhello.py", line 4

[Tutor] command line list arguments

2015-11-07 Thread Garry Willgoose
I want to input a python list as a command line argument as for example python weathering-sens.py -daughter ['p0-50-50','p0-0-0-100’] but what I get from sys.argv is [p0-50-50,p0-0-0-100] without the string delimiters on the list elements. I’m probably missing something really simple because sy

Re: [Tutor] command line list arguments

2015-11-07 Thread Chris Warrick
On 7 November 2015 at 02:56, Garry Willgoose wrote: > I want to input a python list as a command line argument as for example > > python weathering-sens.py -daughter ['p0-50-50','p0-0-0-100’] > > but what I get from sys.argv is [p0-50-50,p0-0-0-100] without the string > delimiters on the list ele

Re: [Tutor] command line list arguments

2015-11-07 Thread Peter Otten
Garry Willgoose wrote: > I want to input a python list as a command line argument as for example > > python weathering-sens.py -daughter ['p0-50-50','p0-0-0-100’] > > but what I get from sys.argv is [p0-50-50,p0-0-0-100] without the string > delimiters on the list elements. I’m probably missing

Re: [Tutor] Why does this function execute before being called?

2015-11-07 Thread Chris Roy-Smith
On 07/11/15 20:18, Alan Gauld wrote: On 07/11/15 04:34, Chris Roy-Smith wrote: def genF(ofield): ... for x in range(10): def second(): main=Toplevel(root) ofield=Text(main, height=15, width=15) ofield.pack() B3=Button(main, text='exit', command=main.destroy) B3.

Re: [Tutor] Why does this function execute before being called?

2015-11-07 Thread Alan Gauld
On 07/11/15 09:28, Chris Roy-Smith wrote: B4=Button(main, text='fill text', command=lambda wgt=ofield : genF(wgt)) This certainly wasn't obvious from what I could find on the internet. Now I see an application for Lambda I should point out you can use a def if you prefer: def second():

Re: [Tutor] question about descriptors

2015-11-07 Thread Alan Gauld
On 07/11/15 12:53, Albert-Jan Roskam wrote: Ok, now to my question. > I want to create a class with read-only attribute access to the columns of a .csv file. Can you clarify what you mean by that? The csvreader is by definition read only. So is it the in-memory model that you want read-only?

Re: [Tutor] Regarding to kivy installation

2015-11-07 Thread Laura Creighton
In a message of Sat, 07 Nov 2015 09:09:28 +0530, shubham sharma writes: >Respected sir/madam, >hello to all members of python.org . I had successfully downloaded kivy on >window7 64-bit version.but when i try to install it then it show me error >like: > Traceback (most recent call last): > File "

Re: [Tutor] question about descriptors

2015-11-07 Thread Peter Otten
Albert-Jan Roskam wrote: > > > p, li { white-space: pre-wrap; } > > Hi, > First, before I forget, emails from hotmail/yahoo etc appear to end up in > the spam folder these days, so apologies in advance if I do not appear to > follow up to your replies. Ok, now to my question. I want to create a

Re: [Tutor] question about descriptors

2015-11-07 Thread Steven D'Aprano
On Sat, Nov 07, 2015 at 12:53:11PM +, Albert-Jan Roskam wrote: [...] > Ok, now to my question. I want to create a class with read-only > attribute access to the columns of a .csv file. E.g. when a file has a > column named 'a', that column should be returned as list by using > instance.a. A

[Tutor] relative imports within a package?

2015-11-07 Thread James Hartley
The Python 3 tutorial discusses relative imports at: https://docs.python.org/3/tutorial/modules.html#intra-package-references I have the following directory structure for a package in development: + outer_package/ + __init__.py + inner_package | + __init__.py | + mycl

Re: [Tutor] relative imports within a package?

2015-11-07 Thread Steven D'Aprano
On Sat, Nov 07, 2015 at 04:09:19PM -0600, James Hartley wrote: > The Python 3 tutorial discusses relative imports at: > > https://docs.python.org/3/tutorial/modules.html#intra-package-references > > I have the following directory structure for a package in development: > > + outer_package/ >