Re: [Tutor] Tutor Digest, Vol 110, Issue 74

2013-04-17 Thread Timo
zling. From the 2to3 --help: -w, --write Write back modified files So it's normal nothing happens to your files without the -w argument. It just prints the changes to stdout. Timo Jim ___ Tutor maillist - Tutor@python.org To un

[Tutor] How to find descendants recursively?

2013-06-16 Thread Timo
I have a datafile which is parsed by an external library, I'm having trouble creating a hierarchical structure of the data. This is what I got so far: items = get_items() # returns a generator for item in items: print(item) children = get_children(item) # also returns a generator for

Re: [Tutor] flask/sqlite3 problem - 'OperationalError: no such table'?

2013-09-18 Thread Timo
ur results. Something like; cur = g.db.cursor() cur.execute(.) Not really. sqlite3.connect() returns a sqlite3.Connection object which has a execute method. It will create a cursor object for you. Cheers, Timo HTH ___ Tutor maillist - Tutor@pyt

Re: [Tutor] more html/css question than python

2013-12-21 Thread Timo
Here are the docs: http://getbootstrap.com/ Everything is set up for you already so you can create good looking websites in a flash. Timo ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.or

Re: [Tutor] Printing from python

2014-03-14 Thread Timo
cups, this is a project with Python bindings for cups: https://pypi.python.org/pypi/pycups/1.9.66 Timo Am 14.03.2014 11:40, schrieb Ulrich Goebel: Hallo, is there another way to pritt a PDF form python? My problem is a PDF which is printed well by evince, but not with lp, even not out of p

Re: [Tutor] usage difference between tabs and spaces

2014-09-10 Thread Timo
Shift+tab does that in my editor. I don't know if this is a common keybinding or editor specific. Timo ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to easily recover the current index when using Python-style for loops?

2015-02-05 Thread Timo
Op 05-02-15 om 18:48 schreef Alan Gauld: try: >>> help( enumerate() ) Should be >>> help(enumerate) Timo ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Don't Understand Problem

2015-02-26 Thread Timo
ing list(): unvisited_caves = range(0,20) I think you missed your own solution here, Alan. You probably meant: unvisited_caves = list(range(0, 20)) Timo ... unvisited_caves.remove(0) However remove() may not do what you think. It removes the value zero from your list not the first element. I th

Re: [Tutor] append value to dictionary key

2015-03-06 Thread Timo
raceback (most recent call last): File "", line 1, in AttributeError: 'float' object has no attribute 'append' Exactly the same as yours! So, a float has no 'append' attribute, but what objects do have that? Sounds like you need a list to hold an arbitr

Re: [Tutor] failed filter result

2015-04-06 Thread Timo
g the rstrip function instead of calling it and store the result. A big difference. The fix is very easy, just call rstrip in your list comprehension: k = [word.rstrip() for word in words] A little tip: errors like these are easy to debug by printing your values. If you printed k before continuing it wo

Re: [Tutor] list semantics

2015-04-11 Thread Timo
your example you convert the first one to a list with list(), but not the second, so it prints the range object. >>> range(2) range(0, 2) >>> list(range(2)) [0, 1] Timo ___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] why no chaining?

2015-04-12 Thread Timo
remove(...) L.remove(value) -> None -- remove first occurrence of value. Raises ValueError if the value is not present. The same for help(list.sort) BTW. Timo ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options

Re: [Tutor] why can use a widget assigned to a variable or just use it on it's own?

2018-07-02 Thread Timo
Instance created" Foo()  # print "Instance created" Two instances are created, just that the second one isn't accessible. Timo main.mainloop() === any explanation gratefully recieved Regards, Chris ROy-Smith ___

Re: [Tutor] Question

2018-08-21 Thread Timo
Op 21-08-18 om 13:16 schreef Jacob Braig: I am just starting out coding and decided on python. I am confused with something I go shooting a lot so i wanted to make some stupid easy calculator for ammo and slowly build the program up when I understand python better but the code I have now keeps po

[Tutor] Subclassing object

2010-01-17 Thread Timo Vanwynsberghe
I read that it is advised to subclass object. Is it really necessary? I mean, everything works, why should I add it to my code? Cheers, Timo ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org

[Tutor] Python and SQL recommendation

2009-06-19 Thread Timo List
Hello all, At the moment I'm using 3 files as datastorage for my program. One file using ConfigParser and two use the Pickle module. File one contains for example: [ID] option1 = string1 option2 = string2 option3 = string3 And is connected to one of the Pickle files which is like this: {ID : [{k

[Tutor] Generating unique ID

2009-10-28 Thread Timo List
d(). What should I use the best for this? Maybe examples of other programs that do something alike? Thanks, Timo ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] nul file in Windows

2009-11-15 Thread Timo List
ail from a user with the following error: IOError: [Errno 2] No such file or directory: 'nul' Now, I thought the nul-file always existed, shouldn't it? Is there another way to disable output, if this one fails? Cheers, Timo ___ Tutor

[Tutor] Unstable IDLE

2011-07-20 Thread Timo Smieszek
case of opening an existing file). I already installed Python a second time, but this also does not help. Has anybody an idea how to fix this problem? Thanks and all best Timo ___ Tutor maillist - Tutor@python.org To unsubscribe or change

<    1   2