Re: [Tutor] running scripts with windows

2005-09-15 Thread Alan G
> Cygwin (http://www.cygwin.com/) It gives you a bash shell in > Windows. Actually it gives you a whole Unix environment including X Windows and over 500 unix command line tools plus GNU C, sendmail, etc etc... Alan G. ___ Tutor maillist -

Re: [Tutor] Multiple Simultaneous Loops

2005-09-15 Thread Alan G
> for f, x in bunch_of_files, range(z): ... > Or maybe can I access the number of times the > loop has run? I think thats what enumerate does... >>> for x,y in enumerate([1,3,5]): ... print x,y ... 0 1 1 3 2 5 >>> Yep, looks like what you need. Alan G Author

Re: [Tutor] Aschenputtel problem

2005-09-15 Thread Alan G
untion twice if you want to make the intent even more explicit... Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Aschenputtel problem - Shorter is not better?

2005-09-16 Thread Alan G
subtle bugs (like my untested one-liner did!) then better to be slowly correct than rapidly wrong... :-) Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Multiple buttons, One callback

2005-09-16 Thread Alan G
calls the comon function passing the source id as an argument. The source Id is set up as a default parameter value in the lambda definition. HTH, Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Will the following code ever exit?

2005-09-17 Thread Alan G
Then it might start to run although not necessarily correctly. Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why won't it enter the quiz? (off topic)

2005-09-17 Thread Alan G
such lists is fine, using code jointly developed is a legal quagmire. However given the nature of the code Nathan is producing and the prices he's charging I doubt if we are going to be contesting our share of his millions! It seems pretty harmless at this level. Alan G Author of the Le

Re: [Tutor] Getting rid of the newline in file

2005-09-17 Thread Alan G
trip() + "Hi!" HTH, There is more on this topic in the file handling topic of my tutorial. Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How do fix this error?

2005-09-17 Thread Alan G
y help here. See the Simple Sequences topic on my tutor for examples of string formatting. Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why won't it enter the quiz? (off topic)

2005-09-17 Thread Alan G
ers, it's in the individual's own interests to maximise their own input. Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Multiple buttons, One callback (fwd)

2005-09-17 Thread Alan G
the new Win32 API and the older 16 bit Win 3 API. Why 'thunk' I do not know but the term seems to have stuck long after everyone stopped using Win32 thunks... Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld _

Re: [Tutor] Prevent "Coder's Remorse"?

2005-09-28 Thread Alan G
ass will ensure that all the values that should be there are indeed present. > Is there an object structure that will let updates to one instance > affect all instances? A class method is the traditional way of doing that. Get the init method to update a global (or class based)

Re: [Tutor] Alan's responce frustrated beginner

2005-09-29 Thread Alan G
approach is probably best IMHO (whether you parametereise the iterations and condition is optional, it just makes the function as geeric as possible...) HTH, Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Flattening multi-dimentional list

2005-09-29 Thread Alan G
ested lists rather than tuples but it should work for either) Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python equiv to PHP "include" ?

2005-09-29 Thread Alan G
>> can't use import because then Python would try to parse the HTML >> from the >> imported file. > > I thought PHP also parsed any html rendered through an included > file? It does but PHP 'understands' HTML

Re: [Tutor] Python equiv to PHP "include" ?

2005-09-29 Thread Alan G
ython tends to support vanilla CGI and to do PHP style coding you need add-ins like PSP(the first suchj and therefore the most basic) Either move up to a more powerful engine, like Zope, or adapt to CGI style coding. There are many web frameworks for Python but my needs are met by CGI at

Re: [Tutor] call a def/class by reference

2005-09-29 Thread Alan G
resents the names to the user(as strings) in which case a mapping has to exist somewhere already. I'm curious as to how you are addressing those issues? Is this something that only developers will be using? How will the user know what names are possible? Alan G. _

Re: [Tutor] Why super does not work !

2011-01-17 Thread Alan G
shame since MI is where super() should be most useful... But in my experience MI in Python is definitely a place where explicit is better than implicit. Alan G. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] Slack Token Invalid Syntax

2016-04-19 Thread Alan G
Apologies for top posting I blame the tablet! Malcolm, don't make us guess, show us how you put the quotes in and the error messages (in full). Alan g. Sent from my Fonepad Malcolm Boone wrote: So you are saying the right side should be a string, how do I do

Re: [Tutor] Writing decorators?

2016-07-05 Thread Alan G via Tutor
): ** ** def add_string(*args, **kwargs):** # in case f takes arguments ** ** ** ** return "decorated "+ str(f(*args,**kwargs)) ** ** return add_string Now we can apply that to a function @prepend def cube(n): return n*n*n cube(3) I'm biased beca

[Tutor] Fwd: Re: How do I display a picture?

2017-05-17 Thread Alan G via Tutor
n possible ways to "display a picture" depending on what you specifically want. -- Alan G Author of the Learn to Program web site [2]http://www.alan-g.me.uk/ [3]http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: [4]http:

<    1   2   3   4