Re: [Tutor] Order Of Operations Question

2010-07-31 Thread Roel Schroeven
after the mass (which, according to my calculations, is 5.17e19 / 9.81 = 5.27e18; 'only' about 5 times larger than the value in the book). -- The saddest aspect of life right now is that science gathers knowledge faster than society gathers wisdom. -- Isaac Asimov Roel Schroeven __

Re: [Tutor] slicing a string

2010-09-07 Thread Roel Schroeven
e' >>>> "test"[-1:-5:-1] > 'tset' >>>> But remember that you can make it simpler if you simply don't specify the start and end points: >>> 'hello'[::-1] 'olleh' -- The saddest aspect of life right now

Re: [Tutor] Add readline capabilities to a Python build 2.6 on Ubuntu

2009-02-19 Thread Roel Schroeven
th in the history are Alt-P (previous) and Alt-N (next). -- The saddest aspect of life right now is that science gathers knowledge faster than society gathers wisdom. -- Isaac Asimov Roel Schroeven ___ Tutor maillist - Tutor@python.org http://ma

[Tutor] Re: O.T.

2004-12-27 Thread Roel Schroeven
for "age of python programmers" on Google groups). The main focus there was on the age; I summarized the age distribution on http://www.roelschroeven.net/pythonages/. I'm 30 years old, live in Belgium, single. My job is C++ development.

[Tutor] Re: O.T.

2004-12-27 Thread Roel Schroeven
Roel Schroeven wrote: A similar thread ran a while ago on comp.lang.python (search for "age of python programmers" on Google groups). The main focus there was on the age; I summarized the age distribution on http://www.roelschroeven.net/pythonages/. For those interested, you can find

[Tutor] Re: O.T.

2004-12-27 Thread Roel Schroeven
ess restrictive link. http://pythonology.org/success&story=esr -- "Codito ergo sum" Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Re: Soem list operation questions?

2004-12-28 Thread Roel Schroeven
for digit in digits: result *= 10 result += digit return result -- "Codito ergo sum" Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Re: Soem list operation questions?

2004-12-28 Thread Roel Schroeven
Orri Ganel wrote: Yes, but your way only works when the numbers in the list are single digit: True, but I think (I could be wrong of course) that is what kilovh intended: "...and combine them into digits of one number". -- "Codito ergo sum&

[Tutor] Re: Soem list operation questions?

2004-12-28 Thread Roel Schroeven
return result That's much more robust indeed. I was trying to make it as simple as possible; perhaps I made it a bit too simple. -- "Codito ergo sum" Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Re: Soem list operation questions?

2004-12-28 Thread Roel Schroeven
s. I think different approaches are possible, and which one is best depends on the circumstances. Karl Pflästerer wrote: > Please do *not* send copies of replies to me. > I read the list I agree, but I got a copy of your reply in my inbox. Either gmane.org screwed up or you inadvertentl

[Tutor] Re: Soem list operation questions?

2004-12-28 Thread Roel Schroeven
odito ergo sum" Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Re: Are you allowed to shoot camels? [kinda OT]

2005-02-04 Thread Roel Schroeven
en/else operator is a wart in the otherwise very clean design of Python. The lack of a switch statement too, but to a much lesser degree. -- "Codito ergo sum" Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Re: Are you allowed to shoot camels? [kinda OT]

2005-02-04 Thread Roel Schroeven
years later I still find it ugly and, more importantly, much harder to understand the structure. Do you have a link to these studies? I'm always skeptical about the methodology in those studies, but I'm willing to be proven wrong. -- "Codito ergo

[Tutor] Re: Are you allowed to shoot camels? [kinda OT]

2005-02-04 Thread Roel Schroeven
BTW, Steve McConnell recommends your favorite too in Code Complete. But he also didn't manage to convince me. -- "Codito ergo sum" Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Re: Are you allowed to shoot camels? [kinda OT]

2005-02-04 Thread Roel Schroeven
cumentation, so I don't even need to read an interpret the body of the function to know what it does. Assuming that the name correctly describes the behavior of course, but I need to check that only once. From then on, sort(sortByLength) instantly explains what it does, while sort(lambda x,y: cm

[Tutor] Re: Are you allowed to shoot camels? [kinda OT]

2005-02-04 Thread Roel Schroeven
e IOCCC entries), but can absolutely be useful when judisciously used. Many such lists seem to assume that developers can't judge such things for themselves. I think that if you have developers that can't do that, you have worse problems than a ternary operator here and there. -- "Codit

[Tutor] Re: Are you allowed to shoot camels? [kinda OT]

2005-02-04 Thread Roel Schroeven
read that part of the book again. But I don't have my hopes up since three years of using it at work didn't change my feelings about it (and not for a lack of trying). -- "Codito ergo sum" Roel Schroeven ___ Tutor mail

[Tutor] Re: Basic terminology

2005-02-16 Thread Roel Schroeven
10 + (6 % 12) = 10 + 6 = 16 which is not correct (unless dealing with 24-hour systems of course, but that's not the case here) Correct is: (10 + 6) % 12 = 16 % 12 = 4 (In 24-hour systems, just replace 12 with 24) -- "Codito ergo sum" Roel Schroeven

[Tutor] Re: Create list of IPs

2005-02-20 Thread Roel Schroeven
1.5'): .print ip 1.0.0.250 1.0.0.251 1.0.0.252 1.0.0.253 1.0.0.254 1.0.0.255 1.0.1.0 1.0.1.1 1.0.1.2 1.0.1.3 1.0.1.4 1.0.1.5 -- "Codito ergo sum" Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Re: Fwd: Create list of IPs

2005-02-20 Thread Roel Schroeven
t the > address as a single large decimal number :^) And you can use it in URLs too (at least in Mozilla): python.org's IP address is 194.109.137.226, which is 3261958626 when represented as an integer. Typing http://3261958626/ in the browsers address bar t

[Tutor] Re: Calendar question

2005-04-05 Thread Roel Schroeven
nary with the names of the months as keys and the corresponding numbers as values and use that dictionary to convert the names in the numbers. Try to play a bit with dictionaries in IDLE (or your Python shell of choice). If anything's not clear, just give a ye

[Tutor] Re: Major Newbie Here

2005-04-05 Thread Roel Schroeven
27;t type two enters after the line with 'different techniques' since IDLE stops the definition of the class if you do that; you should use only one enter in this case. That's a limitation of IDLE, not of Python: if you put that definition in a file

Re: [Tutor] Python Challenge - Riddle 2

2005-05-09 Thread Roel Schroeven
was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Fwd: Fwd: Python riddles

2005-05-09 Thread Roel Schroeven
> Is it like number 4?the one with urllib??? Yes, the general principle is the same. -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist -

Re: [Tutor] Python Challenge - Riddle 2

2005-05-10 Thread Roel Schroeven
I used something like (sadly I threw my code for levels 1 and 2 away): '[^A-Z][A-Z]{3}[a-z]{1}[A-Z]{3}[^A-Z]' -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tuto

Re: [Tutor] Any easy way to invoke the default browser on a specified URL?

2005-05-10 Thread Roel Schroeven
e that too, but somehow that module escaped my attention. Thanks! -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python Challenge - Riddle 2

2005-05-10 Thread Roel Schroeven
ith the {} notation that meant you had to provide a > terminating > character too? If you want to prevent e.g. 'ABCDE' from matching as opposed to only 'BCD', yes, you need some kind of terminator. -- If I have been able to see further, it was only because I

Re: [Tutor] following the chain

2005-05-10 Thread Roel Schroeven
lib.urlopen(name).read() That will load the whole page into memory as a string. -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python Challenge - Riddle 2

2005-05-10 Thread Roel Schroeven
on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python Challenge Level 6

2005-05-11 Thread Roel Schroeven
y that module, but not to the jpeg. Find the zip first!! -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python Challenge Level 6

2005-05-11 Thread Roel Schroeven
___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] *nix-specific Python Scripting

2005-05-12 Thread Roel Schroeven
e shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help with Challenge number 5

2005-05-12 Thread Roel Schroeven
ok at the module index in the python docs. > By the way, this means I solved challenge 4. Congratulations! -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor ma

Re: [Tutor] main()

2005-05-21 Thread Roel Schroeven
.py than the above code > should never get to run because __name__ is equal to "Hope" so why even > write it. Did you try that? The code should really be executed. -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] xml

2005-05-25 Thread Roel Schroeven
And the 'Example of Client Usage' in the library reference, of course. -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] What's going on with this code? Error message supplied.

2005-07-11 Thread Roel Schroeven
nt indentation, I think you call cal_menu() one time too many. I'm quite sure that you need only need something like this: if option == 1: cal_opt = cal_menu() -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Sch

Re: [Tutor] scope/namespaces

2007-04-24 Thread Roel Schroeven
ee further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] using re

2007-06-04 Thread Roel Schroeven
ers without integer part. You just need to change that 0 to a 1, as follows: ^([0-9]{&,%s})(\.[0-9]{0,%s})?$ -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] im.getdata()

2007-07-01 Thread Roel Schroeven
with the pixel values. I think you would do everyone (including yourself) a favor by just telling us what you're going to do with the pixel values. -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven

Re: [Tutor] im.getdata()

2007-07-01 Thread Roel Schroeven
le: image = ImageGrab.grab ((rect.left, rect.top, rect.right, rect.bottom)) for pixel in image.getdata(): print pixel Anyway, you're printing a lot of pixels (786432 actually)... is that really what you want? -- If I have been able to see further, it was only because I stood on the

Re: [Tutor] SQLite database creation bafflement

2007-08-20 Thread Roel Schroeven
uot;pear.db" do It is also consistent with each name (that is, > if I am successful and then remove the .db file from the desktop, that name > will always work again to create a new .db file). It will become clear if you look at the table mentioned above: \b and \a have a special m

Re: [Tutor] Use functions re avoid Re: Can the following algorithm be improved?

2005-08-09 Thread Roel Schroeven
. To choose a sample from a range of integers, use xrange as an argument. This is especially fast and space efficient for sampling from a large population: sample(xrange(1000), 60). -- If I have been able to see further, it was only because I stood on the shoulde

Re: [Tutor] Aschenputtel problem

2005-09-15 Thread Roel Schroeven
;>> False and list1.append(2) or list2.append(2) >>> list1, list2 ([], [2]) >>> True and list1.append(4) or list2.append(4) >>> list1, list2 ([4], [2, 4]) -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaa

Re: [Tutor] Console output

2005-10-05 Thread Roel Schroeven
n also put the carriage return at the end of the line; the difference is that the cursor will be left at the beginning of the line instead of at the end. It's also possible to back up using backspaces ('\b'), but then you need to count how many characters you wrote and use the equal

Re: [Tutor] code improvement for beginner ?

2005-10-09 Thread Roel Schroeven
#x27; instead to open the file in binary mode instead, which will not do any translation. I'm not sure which one of the two is the default. -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] code improvement for beginner ?

2005-10-11 Thread Roel Schroeven
Kent Johnson wrote: > Roel Schroeven wrote: > >> Danny Yoo wrote: >> >> >>> Looking at pageimgs(): I'm not sure what 't' means in the open >>> statement: >>> >>> f = open(filename, "rt") >> >> It

Re: [Tutor] Newbie Anxiety

2005-11-10 Thread Roel Schroeven
rint x HTH -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] problem calling a function

2005-11-13 Thread Roel Schroeven
--+ | |--+ 4 --+ >>> printDendrogram("((1, 2), (3, 4))") ((1, 2), (3, 4)) -- You'll have to modify your code so that it creates a tuple instead of a string. I made it work by changing printDendrogram(tree) to printDendrogram(eval(tree)) at the end of your code, but that's just a quick hack, not the recommended way of doing things. -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] problem calling a function

2005-11-13 Thread Roel Schroeven
Roel Schroeven wrote: > > You'll have to modify your code so that it creates a tuple instead of a > string. It seems that doing it without using a string complicates matters, or at least increases the line count. I tried it with a list, since you can't build a tuple on the

Re: [Tutor] problems with the shebang line and linux

2006-02-17 Thread Roel Schroeven
now if such an option even exists). Strange thing is that the problem persists after retyping the file, but I guess that's because the editor was still in CR/LF mode. Did you create a new file before starting to retype, or did you just clear everything? -- If I have been able to

Re: [Tutor] how to write a string into a specific line in a file

2006-03-09 Thread Roel Schroeven
sh!) Yep, it's Dutch. -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Explanation of Lists data Type

2006-04-13 Thread Roel Schroeven
print i, range(i)[-3:3] 0 [] 1 [0] 2 [0, 1] 3 [0, 1, 2] 4 [1, 2] 5 [2] 6 [] 7 [] 8 [] 9 [] -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist

Re: [Tutor] Nested list comprehensions

2006-05-07 Thread Roel Schroeven
ted list comprehensions all that often, and when I do use them or encounter them I just remember that the for's should be in the same order as in the non-LC solution. -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroe

Re: [Tutor] _next

2006-05-25 Thread Roel Schroeven
.next() b >>> print a.next() Traceback (most recent call last): File "", line 1, in -toplevel- print a.next() StopIteration -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] _next

2006-05-25 Thread Roel Schroeven
rn self._next() The _next() method is a generator function as I described above, which creates an iterator object when called. The __iter__() method just calls that generator function and returns the result to its caller. HTH -- If I have been able to see further, it was only because I stood

Re: [Tutor] help requested: port not free, under Windows XP

2006-05-25 Thread Roel Schroeven
been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] _next

2006-05-31 Thread Roel Schroeven
Dave Kuhlman schreef: > Roel Schroeven fastmail.fm> writes: > Kent Johnson alerted me to this discussion. > > And, thanks, Roel, for the comments and improvements on my example. > > I agree that my example class being discussed is confused. I've reworked the > ex

Re: [Tutor] Unit testing

2006-06-28 Thread Roel Schroeven
e you don't even need the semaphore at all: have a look at Queue.Queue, it might do exactly what you need. -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Logical Sorting [Off-Topic]

2006-07-08 Thread Roel Schroeven
it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] about random seed

2006-09-03 Thread Roel Schroeven
urrent time as the seed. Since the current time always changes, the program will generate different output each time it runs. -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven __

Re: [Tutor] exception not raised XP file ?

2006-11-18 Thread Roel Schroeven
the directory instead of trying to open a file in that directory: Windows cannot rename the directory when some program has a file open in that directory. At least that's my experience. -- If I have been able to see further, it was only because I stood on the shoulders of giants. -

Re: [Tutor] exception not raised XP file ?

2006-11-18 Thread Roel Schroeven
epts behind for instance processes and the file system. It's very hard, in my experience, to find a clear explanation on those concepts and the reasonings behind them in Windows. -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton

Re: [Tutor] Rotating an array?

2006-11-19 Thread Roel Schroeven
tion. You can access the values using the same syntax as Java: >>> print twisted [[0, 0, 0, 1], [0, 0, 0, 0], [1, 1, 0, 0], [0, 0, 1, 0]] >>> print twisted[0][3] 1 >>> print twisted[2][2] 0 -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Angles

2006-11-29 Thread Roel Schroeven
which takes two parameters. Therefore it can use the signs of both x_azm and y_azm to work out the correct quadrant. So I'd try: Azimuth = degrees(atan2(x_azm, y_azm)) -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac

Re: [Tutor] Best method for filtering lists in lists...

2006-12-16 Thread Roel Schroeven
e of them. > > In that case put the inner lists in a Set. That will eliminate > duplicates. That won't work: list objects are unhashable so you can't put them in a set. You'll have to convert them to tuples first. -- If I have been able to see further, it was

Re: [Tutor] 'elp!!!!!!!1Totally Clueless Newbie In Distress

2007-01-20 Thread Roel Schroeven
on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How does this work?

2007-02-07 Thread Roel Schroeven
doesn't it send its output to stderr? Maybe you just have to capture stderr instead of stdout to get the output. -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___

Re: [Tutor] Replying to the tutor-list

2007-02-16 Thread Roel Schroeven
and https://bugzilla.mozilla.org/show_bug.cgi?id=233417). Meanwhile I work around the issue by subscribing to mailing lists indirectly via gmane. I like the interface offered by newsgroups better anyway for this kind of stuff. -- If I have been able to see further, it was only

Re: [Tutor] Picking Nits in "Learning to Program"

2007-02-16 Thread Roel Schroeven
the best approximation for real numbers computers have to offer. -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Picking Nits in "Learning to Program"

2007-02-16 Thread Roel Schroeven
e, and mention 'real numbers' as an alternative name. The opposite of the current situation more or less actually. -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] getopts question

2007-03-31 Thread Roel Schroeven
and the wildcards. -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Table like array in Python

2008-03-26 Thread Roel Schroeven
pect of life right now is that science gathers knowledge faster than society gathers wisdom. -- Isaac Asimov Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to skip to next line in for loop

2008-05-02 Thread Roel Schroeven
ledge faster than society gathers wisdom. -- Isaac Asimov Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] urllib2 and php authentication

2008-07-27 Thread Roel Schroeven
information to do the same thing from your program. -- The saddest aspect of life right now is that science gathers knowledge faster than society gathers wisdom. -- Isaac Asimov Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] how to read over serial port

2008-11-02 Thread Roel Schroeven
that science gathers knowledge faster than society gathers wisdom. -- Isaac Asimov Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] faulty code (maths)

2008-11-24 Thread Roel Schroeven
code multiplies by a instead while it should instead divide by a. -- The saddest aspect of life right now is that science gathers knowledge faster than society gathers wisdom. -- Isaac Asimov Roel Schroeven ___ Tutor maillist - Tutor@

Re: [Tutor] Distinction between tuples and lists

2009-01-02 Thread Roel Schroeven
ype, but that's not the point. The point is that the meaning of the two elements is different. It makes, for example, no sense to sort such a tuple. -- The saddest aspect of life right now is that science gathers knowledge faster than society gathers wisdom. -- Isaac Asimov Roel Schroeven

Re: [Tutor] project euler

2009-01-04 Thread Roel Schroeven
gathers knowledge faster than society gathers wisdom. -- Isaac Asimov Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] df type function in python

2009-01-07 Thread Roel Schroeven
ets too full. -- The saddest aspect of life right now is that science gathers knowledge faster than society gathers wisdom. -- Isaac Asimov Roel Schroeven ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Writing to the terminal?

2010-12-13 Thread Roel Schroeven
x27;\r%s ' % t) time.sleep(1) sys.stdout.write('\n') sys.stdout.write('Done!') -- The saddest aspect of life right now is that science gathers knowledge faster than society gathers wisdom. -- Isaac Asimov Roel Schroeven ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Through a glass, darkly: the datetime module

2012-10-07 Thread Roel Schroeven
Sander Sweers schreef: Op 7 okt. 2012 04:29 schreef > het volgende: > I'm also not sure but I seem to remember that it is > ("SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", > "SATURDAY", "SUNDAY") > which I think is extremely clever because it ge

Re: [Tutor] Through a glass, darkly: the datetime module

2012-10-08 Thread Roel Schroeven
Sander Sweers schreef: Roel Schroeven schreef op zo 07-10-2012 om 21:19 [+0200]: Sander Sweers schreef: Op 7 okt. 2012 04:29 schreef <mailto:aklei...@sonic.net>> het volgende: > I'm also not sure but I seem to remember that it is > ("SUNDAY", "MONDAY&

Re: [Tutor] Good Taste Question: Using SQLite3 in Python

2015-04-29 Thread Roel Schroeven
nitive load because they tell me I don't have to remember anything about them, since they're not going to be used later. Read and forget. Best regards, Roel -- The saddest aspect of life right now is that science gathers knowledge faster than society gathers wisdom. --

Re: [Tutor] Good Taste Question: Using SQLite3 in Python

2015-04-30 Thread Roel Schroeven
ding discipline. I still feel __ to be valuable, but I can see now where your dislike for it is coming from. Thank you for your insights! Best regards, Roel -- The saddest aspect of life right now is that science gathers knowledge faster than society gathers wisdom. -- Isaac Asimov Roel Sch

Re: [Tutor] Good Taste Question: Using SQLite3 in Python

2015-04-30 Thread Roel Schroeven
ed-variable -- The saddest aspect of life right now is that science gathers knowledge faster than society gathers wisdom. -- Isaac Asimov Roel Schroeven ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: htt

Re: [Tutor] Complications Take Two (Long) Frustrations.

2015-08-21 Thread Roel Schroeven
dge faster than society gathers wisdom. -- Isaac Asimov Roel Schroeven ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Complications Take Two (Long) Frustrations.

2015-08-21 Thread Roel Schroeven
s wisdom. -- Isaac Asimov Roel Schroeven ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Complications Take Two (Long) Frustrations.

2015-08-25 Thread Roel Schroeven
Steven D'Aprano schreef op 2015-08-22 09:00: On Fri, Aug 21, 2015 at 11:29:52PM +0200, Roel Schroeven wrote: Joel Goldstick schreef op 2015-08-21 23:22: so: print -max(-A, -B) That's what I mean, yes. I haven't tried it, but I don't see why it wouldn't work. It

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread Roel Schroeven
life right now is that science gathers knowledge faster than society gathers wisdom. -- Isaac Asimov Roel Schroeven ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Value Error

2013-06-12 Thread Roel Schroeven
Jim Mooney schreef: Although I'm not sure why int('blah') wouldn't be a type error rather than a value error. Because passing a string to int() is perfectly okay, as long as the string has an appropriate value: int('42') works, int('forty two') raises ValueError. -- "People almost invariabl

Re: [Tutor] Is there a programmatic use for keys() and values()

2013-06-16 Thread Roel Schroeven
Jim Mooney schreef: On 15 June 2013 14:55, Alan Gauld wrote: I think your making it harder than it is. Just use the result as you would expect and it will work. I just meant that since I'm learning I'll create a dictionary on the fly to try something out. All goes well except my IDE will typ

Re: [Tutor] Converting integers into digit sum (Python 3.3.0)

2013-12-09 Thread Roel Schroeven
Alan Gauld schreef: On 09/12/13 13:48, spir wrote: On 12/09/2013 02:29 PM, Wolfgang Maier wrote: spir gmail.com> writes: Tu sum it up (aha!): you algorithm is the right and only one No, it's not the only one. ... also the pure numbers approach pointed out by me and Alan. You are right in

Re: [Tutor] Python Idioms?

2015-04-01 Thread Roel Schroeven
;>>> list(zip(*[iter(s)]*2)) >>>>>>>> [(1, 2), (3, 4), (5, 6), (7, 8)] Pairwise: >>> take(4, pairwise(count())) [(0, 1), (1, 2), (2, 3), (3, 4)] Greetings, Roel -- The saddest aspect of life right now is that scie

Re: [Tutor] Help with putting numbers from highest to lowest.

2017-09-27 Thread Roel Schroeven
7.9, 5.8, 4.7, 2.7] See https://docs.python.org/3/library/stdtypes.html?highlight=sort#list.sort -- The saddest aspect of life right now is that science gathers knowledge faster than society gathers wisdom. -- Isaac Asimov Roel Schroeven ___ Tutor maill

Re: [Tutor] os.walk() with multiple paths

2018-05-23 Thread Roel Schroeven
name + ',' + os.path.join(root, name)) return sorted(files) Last point: I didn't know endswith can take a tuple of suffixes instead of one single suffix. Cool, I learned something new! -- The saddest aspect of life right now is that science gathers knowledge faster than s

Re: [Tutor] Inserting long URL's into comments & docstrings?

2019-07-29 Thread Roel Schroeven
criticism is hard to take, particularly from a relative, a friend, an acquaintance, or a stranger." -- Franklin P. Jones Roel Schroeven ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Name for this type of class?

2019-08-06 Thread Roel Schroeven
lection to graps the meaning. Every time again. If you use plural to indicate counts, what do you use for collections of items? -- "Honest criticism is hard to take, particularly from a relative, a friend, an acquaintance, or a stranger." -- Franklin P. Jones Roel Schroev