Re: [Tutor] Syntax question

2018-08-14 Thread Matthew Polack
Just a quick 'Thank you' for this advice the other day Alan and Abdur-Rahmaan. Greatly appreciated as we work together with our students here. Thank you. Matthew Polack | Teacher [image: Emailbanner3.png] Trinity Drive | PO Box 822 Horsham Victoria 3402 p. 03 5382 2529 m. 0402456854 e.

Re: [Tutor] Syntax question

2018-08-09 Thread Alan Gauld via Tutor
On 09/08/18 05:10, Matthew Polack wrote: > I'm trying to configure a button that prints a variable and calls a > function at the same time...but I can't figure out how to get the syntax > right...or if this is even possible: Of couse its possible just wrap it in a higher level function: def newfu

[Tutor] Syntax question

2018-08-09 Thread Matthew Polack
Hi, I'm trying to configure a button that prints a variable and calls a function at the same time...but I can't figure out how to get the syntax right...or if this is even possible: print("You have selected to convert "), croptype I've tried various combinations of the above...but can't get it t

Re: [Tutor] syntax question

2008-05-21 Thread Carlos Hanson
On Wed, May 21, 2008 at 5:27 AM, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > Hi all, > > This is a syntax that I've seen on occasion in other people's code: > > theme = (VALID_THEMES[0], theme) [ theme in VALID_THEMES ] > > I have no idea how this works, or how to go about looking it up. Can someo

Re: [Tutor] syntax question

2008-05-21 Thread Kent Johnson
On Wed, May 21, 2008 at 8:27 AM, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > Hi all, > > This is a syntax that I've seen on occasion in other people's code: > > theme = (VALID_THEMES[0], theme) [ theme in VALID_THEMES ] > > I have no idea how this works, or how to go about looking it up. This is

[Tutor] syntax question

2008-05-21 Thread Eric Abrahamsen
Hi all, This is a syntax that I've seen on occasion in other people's code: theme = (VALID_THEMES[0], theme) [ theme in VALID_THEMES ] I have no idea how this works, or how to go about looking it up. Can someone enlighten me as to what's happening here? Many thanks, Eric ___

Re: [Tutor] Syntax Question

2006-02-08 Thread Alan Gauld
> There must be something that I'm missing here. Triuple quoted strings :-) Take a look at my Databases topic for examples using SqlLite and triple quotes for the queries. Alan G Author of the learn to program web tutor http://www.freenetpages.co.uk/hp/alan.gauld . __

Re: [Tutor] Syntax Question

2006-02-08 Thread John Fouhy
On 09/02/06, Rich Shepard <[EMAIL PROTECTED]> wrote: > self.cur.execute("CREATE TRIGGER fki_comp_cat BEFORE INSERT ON component > FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'insert on table "category" > violates foreign key constraint "fk_comp_cat"') WHERE NEW.comp_cat IS NOT > NULL AND (SELECT

Re: [Tutor] Syntax Question

2006-02-08 Thread Rich Shepard
On Wed, 8 Feb 2006, Danny Yoo wrote: > Odd. Can you show us that complaint? Show us the error string. There are > several possibilities here, but I hate guessing. *grin* Show us the exact > error message you're getting, and that'll hint at what's really going on. > > Normal string literals can'

Re: [Tutor] Syntax Question

2006-02-08 Thread Danny Yoo
On Wed, 8 Feb 2006, Rich Shepard wrote: >I'm trying to understand how to write SQL statements using pysqlite. > The problem is that if I use newlines to format the SQL statements as I > would with straight SQLite or PostgreSQL, python complains because it > sees the newline before the end of

[Tutor] Syntax Question

2006-02-08 Thread Rich Shepard
I'm trying to understand how to write SQL statements using pysqlite. The problem is that if I use newlines to format the SQL statements as I would with straight SQLite or PostgreSQL, python complains because it sees the newline before the end of the quoted string. So, I make the CREATE TABLE