Re: [Tutor] Printing from python

2014-03-14 Thread Russel Winder
re/pycups/ I have not used these yet myself, but I have trying them out on my agenda for later in the spring. -- Russel. ===== Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckma

Re: [Tutor] c++ on python

2014-03-13 Thread Russel Winder
which case apologies. -- Russel. ===== Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder sig

Re: [Tutor] c++ on python

2014-03-13 Thread Russel Winder
…){…} makes f accessible via ctypes if f is in a shared object/dynamic link library. -- Russel. = Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www.ru

Re: [Tutor] Recommendation For A Complete Noob

2014-02-12 Thread Russel Winder
does it do what it should. -- Russel. ===== Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w:

Re: [Tutor] Python as Teaching Language

2014-02-10 Thread Russel Winder
hon that my first book didn't permit. It means that although there > is some overlap in coverage the style and content are quite different. > > Context and target make a big difference in what and how you teach. Definitely. Good luck with the new project. -- Russel. =====

Re: [Tutor] Python as Teaching Language

2014-02-10 Thread Russel Winder
at the time of covering earlier codes to ensure people realize there is a progression and that the current code is initial not final. -- Russel. ===== Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 B

Re: [Tutor] learning recursion

2014-02-10 Thread Russel Winder
sel. = Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Python as Teaching Language

2014-02-09 Thread Russel Winder
as f: for line in f: print(line.upper()) should, I argue, be the canonical idiom in modern Python. -- Russel. ========= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Bu

Re: [Tutor] learning recursion

2014-02-09 Thread Russel Winder
idea that this is a good final solution is, I believe, a disservice. -- Russel. ========= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465 077 xmpp: rus...@winder.

Re: [Tutor] I need a good resource for python Django

2013-08-19 Thread Russel Winder
n Django Tutorial, it emphasizes TDD and tests where the Django site rarely mentions them in the introductory material (a gross oversight). http://www.tdd-django-tutorial.com/ -- Russel. ========= Dr Russel Winder t:

Re: [Tutor] some web and python version questions

2013-03-04 Thread Russel Winder
xcept that it doesn't have a Python 3 presence as far as I know just now. -- Russel. ========= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 46

Re: [Tutor] Need a mentor, Any help would be great

2013-03-03 Thread Russel Winder
On Sun, 2013-03-03 at 13:51 +0100, Kwpolska wrote: > On Sun, Mar 3, 2013 at 10:55 AM, Russel Winder wrote: > > On Sun, 2013-03-03 at 08:29 +, Alan Gauld wrote: > > […] > >> Once comfortable go to SourceForge and find something in Python you can > >> contribu

Re: [Tutor] Need a mentor, Any help would be great

2013-03-03 Thread Russel Winder
Russel. ===== Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder signature.asc Description

Re: [Tutor] Help!

2013-01-26 Thread Russel Winder
Python as it does in mathematics. -- Russel. ===== Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www

Re: [Tutor] Traffic Light

2013-01-20 Thread Russel Winder
n at the same time. -- Russel. ========= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www.ru

Re: [Tutor] Joining all strings in stringList into one string

2012-05-30 Thread Russel Winder
#x27;'.join(['this', 'is', 'it']) print ''.join(['1', '2', '3', '4', '5']) if __name__ == '__main__': main() but, mayhap, I am missing the intention. -- Russel.

Re: [Tutor] table to dictionary and then analysis

2012-05-18 Thread Russel Winder
On Thu, 2012-05-17 at 19:35 +1000, Steven D'Aprano wrote: > On Thu, May 17, 2012 at 08:27:07AM +0100, Russel Winder wrote: > > > Should we be promoting use of the format method in strings rather than > > the % operator? % is deprecated now. > > It most certainly is

Re: [Tutor] table to dictionary and then analysis

2012-05-17 Thread Russel Winder
and contrasting > > these various models. Some of the articles are even reasonable :-) > > Wikipedia is my friend :-) :-) -- Russel. = Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +

Re: [Tutor] table to dictionary and then analysis

2012-05-17 Thread Russel Winder
le: sqlite> select sum(rainfall)/count(*) from rain; > 3.97352768125 > > This statement will give the average rainfall over the complete dataset. > To get the ave rainfall for a given year do this: > sqlite> select sum(rainfall)/count(*) from rain where year = 1983; > > Come

Re: [Tutor] table to dictionary and then analysis

2012-05-16 Thread Russel Winder
On Tue, 2012-05-15 at 19:14 +0100, Alan Gauld wrote: > On 15/05/12 10:36, Russel Winder wrote: > > ...queries passed over it then year a database it the > > right thing -- though I would probably choose a non-SQL database. > > As a matter of interest why? Because there are a

Re: [Tutor] table to dictionary and then analysis

2012-05-15 Thread Russel Winder
gesByYear[year][1] ) for month in months : print ( month , averagesByMonth[month][0] , averagesByMonth[month][1] ) The cost of the repetition in the code here is probably minimal compared to the disc access costs. On the other hand this is a small data set so time is p

Re: [Tutor] extracting lines between patterns.

2012-05-14 Thread Russel Winder
re.DOTALL) -- Russel. ========= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder signature.asc Description: This is a d

Re: [Tutor] extracting lines between patterns.

2012-05-14 Thread Russel Winder
nes lying in > between. Without the source code you already have, it is difficult to provide any constructive suggestions. -- Russel. ===== Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41

Re: [Tutor] threading mind set

2012-05-13 Thread Russel Winder
g option except that there is all the FUD about use of the CLR and having to buy extortion^H^H^H^H^H^H^H^H^H licencing money to Microsoft. Also Microsoft ceasing to fund IronPython (and IronRuby) is a clear indicator that Microsoft have no intention of supporting use of Python on CLR. Thus

Re: [Tutor] hello~

2012-05-13 Thread Russel Winder
some email clients enforce this on sending by amending what the author thought they sent. -- Russel. ===== Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465

Re: [Tutor] threading mind set

2012-05-13 Thread Russel Winder
our program is limited by disk or network I/O, then there is a > possibility > you can speed it up with threads. Or better still use an event based system, cf Twisted. [...] > -- Russel. = Dr Russel Winder

Re: [Tutor] Getting started with PyGTK [Receiving Error]

2012-04-29 Thread Russel Winder
ngine, there are many other far better ones. It is also worth noting that PyGTK is effectively deprecated. PyGTK only works with GTK+2 it is not ported to GTK+3. Instead PyGObject is the way of working with GTK+3 from Python. http://readthedocs.org/docs/python-gtk-3-tutorial/en/latest/index.htm

Re: [Tutor] why gtk.Entry does not give me right answers?

2012-04-23 Thread Russel Winder
sible to understand your code. Indeed. The lack of indentation was a barrier to contemplating looking at the code. Especially since indentation is meaningful in Python! -- Russel. ===== Dr Russel Winder t: +44 20 758

Re: [Tutor] .py vs .pyc

2012-04-19 Thread Russel Winder
-- Russel. ===== Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder signature.asc Description

Re: [Tutor] Readabilty vs 80 characters

2012-04-19 Thread Russel Winder
been. Even C++ is going to a more declarative mode of expression, along with Java. Python's list comprehensions fit into this trend. (*) Which may turn out just to be just the latest fashion ready to be replaced in 2013. -- Russel. =======

Re: [Tutor] .py vs .pyc

2012-04-19 Thread Russel Winder
s deal only with .py files -- or possibly pyx if you are using Cython. -- Russel. ========= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465 077 xmpp: rus...@

Re: [Tutor] New to this list ....

2012-03-30 Thread Russel Winder
what Python can achieve even though I would not use it myself. -- Russel. ========= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk s

Re: [Tutor] New to this list ....

2012-03-30 Thread Russel Winder
h compiler and how many cases. For 3 or more cases compilers will generate a hardware supported jump table: a switch statement is a jump table not a cascade of if statements. -- Russel. ========= Dr Russel Winder t: +44 20 75

Re: [Tutor] New to this list ....

2012-03-30 Thread Russel Winder
ial(setflag, 2), 1: partial(setflag, 1), 2: partial(setflag, 0), }[thisflag]() return results -- Russel. ========= Dr Russel Winder t: +44 20 7585 2200 voip: sip:rus

Re: [Tutor] Error handling

2012-03-25 Thread Russel Winder
uses the except clause to execute if it does. -- Russel. ===== Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w

Re: [Tutor] Any book to study Python

2012-03-19 Thread Russel Winder
Python. Not been translated to Chinese yet as far as I know. The book is Python 2.4/2.5, we are currently trying to work with the publisher to get out a new edition that can be Python 2.7/3.2. -- Russel. ========= Dr Russe

Re: [Tutor] ASCII Conversion

2012-01-31 Thread Russel Winder
isinstance ( y , int ) preferred? Violates EAFP obviously but... -- Russel. ========= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465 077 xmpp: rus...@russel.