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

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] More Pythonic?

2015-09-09 Thread Timo
t's also possible to use multiple with statements on the same line. Can someone with more expert Python knowledge than me comment on whether it's different from using them separate as mentioned by Steven? This is what I had in mind: with open("writefi

Re: [Tutor] Help error 504

2015-08-25 Thread Timo
Op 25-08-15 om 02:08 schreef Gonzalo V: how can simulate or emulate an error 504? I think using a site like http://httpbin.org/ is a bit easier than mock or your own server. Just change your request url to: http://httpbin.org/status/504 Timo i am new in python and its very intuitive

Re: [Tutor] problem with code

2015-08-21 Thread Timo
d. - print is a function. Updated code: time = int(input("How long on average do you spend on the computer per day?")) if time <= 2: print("Message1") else: print("Message2") Also the question is ambiguous. There is no time unit. What is "long&quo

Re: [Tutor] How to extract variables from GUI objects

2015-08-19 Thread Timo
tk API docs: http://lazka.github.io/pgi-docs/index.html#Gtk-3.0 And here the tutorial: http://learngtk.org/tutorials/python_gtk3_tutorial/html/ Timo I realize that the program does not know what part of the object to get, but I am unclear about how to tell it where the text is. I've tried

Re: [Tutor] python and Beautiful soup question

2015-06-22 Thread Timo
ons (with small descriptions) on the sandbox page: https://en.wikipedia.org/wiki/Special:ApiSandbox Timo *Joshua Valdez* *Computational Linguist : Cognitive Scientist * (440)-231-0479 jd...@case.edu | j...@uw.edu | jo...@armsandanchors.com <http://www.linkedin.c

Re: [Tutor] Spongebob Pythonpants

2015-04-24 Thread Timo
yourself some time and use a raw string: print(r""" """) Timo Spongebob Squarepants was, of course, the obvious first choice. The heck with Tkinter. (Bob is coming out a bit thin in my gmail but l

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] 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] 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] 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] 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] 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] 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] 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] 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] 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

[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] 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

Re: [Tutor] Looks like a judgment bug.

2013-04-11 Thread Timo
16) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> l = "http://ff.f/"; >>> l[-1] '/' >>> l[-1] is not '/' True >>> l[-

Re: [Tutor] Socket Programming

2013-04-08 Thread Timo
socket(socket.AF_INET,socket.SOCK_DGRAM) try: s=s.bind(('172.18.2.11',2213)) print 'socket bind is complete' except socket.error,msg: print 'bind failed' sys.exit() You are hiding the error message here. Just print msg and see why it fails. Timo The outp

Re: [Tutor] Use __str__ method for int values

2013-03-10 Thread Timo
def __init__(self, name, hunger = 0, boredom = 0): self.name = name self.hunger = hunger self.boredom = boredom def __pass_time(self): self.hunger += 1 self.boredom += 1 def __str__(self): mood = self.boredom + self.hunger return mood

Re: [Tutor] Which pip for Ubuntu 12.04

2013-02-10 Thread Timo
to use an outdated pip cause me problems? I doubt it will. Have a look at the pip changelog to see what has been changed. Timo But you're right, I also nnoticed that the Canonical repositories are a little outdated sometimes. Would be nice if it's possible to add pypi.org, so upda

Re: [Tutor] If a method has no return type?

2013-02-07 Thread Timo
Op 07-02-13 10:09, Sunil Tech schreef: Thank you Wesley, Kal & tutor In the future, the Python interpreter comes in handy for quick checks. >>> def spam(): ... pass ... >>> s = spam() >>> s, repr(s), type(s) (None, 'None', ) Timo On Thu, Feb 7,

[Tutor] Parsing and evaluating user input

2013-01-09 Thread Timo
get('custom-calc') >>> custom_calc '(%(a)s * %(b)s) / 10' >>> calc_str = custom_calc % {'a': get_value_a(), 'b': get_value_b()} I should parse this, fill in the values which the program has at that point and calculate the outcome. What is

Re: [Tutor] Creating a torrent file & associated tracker through a django web app

2012-11-21 Thread Timo
, you'll just need a way to bencode the data. Timo [1] http://en.wikipedia.org/wiki/Torrent_file#Single_file Any suggestions/pointers/ideas/links will be greatly appreciated Thanks a ton, cheers, ashish 1. http://mktorrent.sourceforge.net/ 2. http://www.robertnit

Re: [Tutor] Adding items from a cursor to a dict?

2012-11-12 Thread Timo
ith almost no memory overhead. It will probably be better than your own custom dictionary-based approach or even a db_row based solution. """ Timo i tried this but to no avail: >>> cur.execute('select * from schedule limit 10') >>> for i in rang

Re: [Tutor] changing name value with function return

2012-10-30 Thread Timo
to now be 42.098734087. What about declaring the return value as x again? x = randDelta(x) Timo regards, Richard -- sic gorgiamus allos subjectatos nunc ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription opt

Re: [Tutor] Why begin a function name with an underscore

2012-08-28 Thread Timo
g out useful code. What the best way to test if something's an integer? a = 4 isinstance(a, int) True isinstance(3., int) False What if I wanted 3., 1234., etc. to be considered ints, as they are by _validate_int() ? >>> isinstance(3., (int,

Re: [Tutor] entering text on web site

2012-06-14 Thread Timo
esults with the mechanize package in the past. Timo Ben On Jun 13, 2012, at 8:27 AM, Walter Prins wrote: Hi, On 13 June 2012 13:35, Benjamin Fishbein <mailto:bfishbei...@gmail.com>> wrote: Hello. I have been teaching myself Python and have been stuck on this problem for a week--I

Re: [Tutor] How to create self contained Windows executables (.exe files) from python scripts

2012-05-18 Thread Timo
application that is written in Python 2.7 and compiled with Py2exe, so it's possible. When looking at the downloads, there are -py2.7 versions available: http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/ Timo Thanks in advance. __

Re: [Tutor] gtk.TreeView displays all right on Windows, but can't see the values on Ubuntu

2012-04-25 Thread Timo
Op 25-04-12 06:41, Lion Chen schreef: Hi, All, Hi, please fix your formatting, the indentation is a big mess and makes it impossible to read. You should also ask your question on the PyGTK mailing list, not here. first thanks the people who gave helps to me, :) now i encountered another que

Re: [Tutor] How to start with Glade.

2012-03-05 Thread Timo
up that will explain these things. Timo -Ganesh Did I learn something today? If not, I wasted it. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/ma

Re: [Tutor] Python Database Scripting

2012-02-08 Thread Timo
Op 08-02-12 20:20, Brad Hudson schreef: Thanks for the responses Alan & Modulok. I will start with SQLAlchemy and see where it takes me. I was looking for something similar a couple of months ago and chose to use SQLObject over SQLAlchemy. In my eyes it was much easier to use.

Re: [Tutor] python logger

2011-12-28 Thread Timo
sing too many arguments for a format string. >>> msg = 'one arg %s and a second %s' >>> msg % ('foo', 'bar', 'baz') # Pass 3 arguments Traceback (most recent call last): File "", line 1, in TypeError: not all arguments converted

Re: [Tutor] how to print the match middle part out

2011-12-15 Thread Timo
reached = True if line == 'model 1': break if first_reached: result.append(line) print result Cheers, Timo above is a very simple example, Thanks for any advice, Best, ___ Tutor maillist - Tutor@python.org To unsu

Re: [Tutor] timedelta, difference calculation

2011-12-13 Thread Timo
explains how to read the output below, but you made a little error here. Let's have a little example: >>> x1 = 1 >>> x2 = x1 + 1 >>> print(x1 - x2) -1 >>> print(x2 - x1) 1 So you should substract mydatetime from mydatetime2, not the other way around. C

Re: [Tutor] pygame blinking text

2011-12-12 Thread Timo
t the works to blink, but I can get them to appear for a short time: from livewires import games, color Looks like you're not using pygame, but livewires. Why not try their mailinglist, I bet their knowledge is better than this *Python beginners* list. Cheers, Timo games.init(screen_w

Re: [Tutor] Dictionary to variable copy

2011-12-08 Thread Timo
Op 08-12-11 10:03, sunil tech schreef: /Can i copy the content if a dictionary in to another variable, with out any link between the dictionary & the variable? / Have a look at the copy module [1], or use the builtin dict.copy() method. Cheers, Timo [1] http://docs.python.org/lib

Re: [Tutor] where python is used in real world

2011-12-04 Thread Timo
ython interpreter to run Python programs? Cheers, Timo 1. Why doesn't python doesn't offer executable file ? 2. If one wants to make a commercial software using python, how can he hide the code? 3. However, if one wants to make an open source software, as python doesn't offer execu

Re: [Tutor] How to handle conjunction operators

2011-11-28 Thread Timo
th respect to the == operator like that, and for good reason. What you want is either this: if name[0] == "m" or name[0] == "f" or name[0] == "b": or, more idiomatically, you can use the in operator like this: if name[0] in ("m", "f", "b&q

Re: [Tutor] IndentationError:

2011-11-16 Thread Timo
other source. Cheers, Timo Thanks again, -- André Engels, andreeng...@gmail.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/

Re: [Tutor] Running windows media player

2011-11-16 Thread Timo
don't have Windows, so can't test, but according to this Microsoft page [1], you can give some comandline parameters to WMP. Cheers, Timo [1] http://support.microsoft.com/kb/241422/en-us from pywinauto import application app = application.Application() try: wmp =

Re: [Tutor] Another question about graphics.

2011-11-10 Thread Timo
questions answered is pretty small here. Cheers, Timo Thanks for the help. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor __

Re: [Tutor] Message: pygobject_register_sinkfunc is deprecated (GtkWindow)

2011-08-17 Thread Timo
et the latest GTK/PyGTK versions from the PyGTK website. There is a really nice all-in-one installer! Cheers, Timo class MainWin: def __init__(self): self.widgets = gtk.glade.XML("ejemplo_glade.glade") signals = { "on_entry1_activate" : sel

[Tutor] Adding index numbers to tuple

2011-08-16 Thread Timo
I tried with zip(), but get a list of tuples, which isn't the desired output. Anyone with a solution or push in the right direction? Cheers, TImo ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Converting from a single module to a package

2011-08-06 Thread Timo
transition import tlib as std in tlib.__init__, include the following: import html htmlButton = html.button And print a deprecation warning when people use it like this. That way you let them know this method could be removed in a next version. See the warnings module. Cheers, Timo

Re: [Tutor] python 2.3.4, how to use os.system and collect it's output to a file.

2011-08-02 Thread Timo
On 02-08-11 17:40, Thirupathaiah Gande (tgande) wrote: Hi, I have Python 2.3.4. Is there some reason for this? You probably should update to 2.7 if possible. Then have a look at the Subprocess module documentation. There are some examples which should get you on the way. Cheers, Timo I

Re: [Tutor] Basic program question

2011-07-25 Thread Timo
er = random.randint(1, 2) if the_number == 1: heads += 1 else: tails += 1 counter += 1 print("\nI flipped the coint 100 times.") print("It came up heads", heads, "times and tails", tails, "times.") print("\n\nPress the

[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

Re: [Tutor] Zipping files and Mysql

2011-06-28 Thread Timo
the user's configuration directory. Which works pretty good. Do have a good look though at the documentation or find some examples through your search engine, because the above line won't work at all. Cheers, Timo ___ Tutor maillist - Tutor@pytho

Re: [Tutor] html files to pdf document

2011-06-20 Thread Timo
Google before asking here? Because the first hit when searching for "python html to pdf" looks like it should do what you want. Cheers, Timo -- Thank you Arun Kumar http://clicknscroll.blogspot.com ___ Tutor maillist - Tutor@pyt

Re: [Tutor] GTALK and PYTHON

2011-06-16 Thread Timo
. You could also look at the program Emesene, they have a feature to login to GTalk. Cheers, Timo Advices too would be of great help.. Thanks. -- Elegbede Muhammed Oladipupo OCA +2348077682428 +2347042171716 www.dudupay.com <http://www.dudupay.com> Mobile Banking Solutions | Transaction

[Tutor] Importing classes when needed

2011-05-30 Thread Timo
et_parsers() everytime the user clicks a button? Because that will initialize the parsers over and over again, right? Cheers, Timo ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Making a script part of the terminal

2011-05-20 Thread Timo
nment. The reason why you can just enter a program name in the terminal, is because these should be in /usr/bin or /usr/local/bin and these are in PATH. Type this in the terminal to see which ones: echo $PATH You can either put your script in one of those directories or add on to PATH. Cheers,

Re: [Tutor] Help with exceptions please

2011-05-14 Thread Timo
t gracefully, you can replace: except: print 'An error occured.' with: except Exception, exc: print 'An error occured:\n' + exc Cheers, Timo If that doesn't help you fix the problem, then remember the three things you need: 1. What did I do? 2. Wh

Re: [Tutor] Gtk - relational data display and edit

2011-04-26 Thread Timo
so the user can change the data. Cheers, Timo Anyone have any suggestions? Thanks, Bodsda Sent from my BlackBerry® wireless device ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman

Re: [Tutor] Trouble executing an if statement with a string from an input

2011-04-18 Thread Timo
statement here to see what 'x' really is: print repr(x) Cheers, Timo if x == "a": print ("a") elif x == "b": print ("b") else: print ('c') ___ Tutor maillist - Tutor@python.org

Re: [Tutor] urgent help required! invalid syntax

2011-02-18 Thread Timo
; > [snip] > > > What is wrong here? What do I need to change? Check the line before the line which throws a syntax error. Have a good look at it and you will see you are missing a character. Cheers, Timo > Thanks! Quick reply will be much appreciated because the deadline is >

Re: [Tutor] noobie question,,,error related

2011-01-31 Thread Timo
hy is this? The error says why this is. The function ctime() isn't in the datetime module. You should have a look at the documentation [1] where you can see that ctime is a method for the date object [2] or the datetime object [3]. Cheers, Timo [1] http://docs.python.org/library/dat

Re: [Tutor] Python on Ubuntu 10.10?

2011-01-15 Thread Timo
Gedit. You can tweak it very nicely so it shows linenumbers and so on. There are also very useful plugins. It is all I ever use and when I need to write some code in Windows, it bugs me how bad IDLE really is. Cheers, Timo Thanks for your time, JC Knoll _

Re: [Tutor] Opening and closing SQLite db

2010-12-28 Thread Timo
s like a perfect place to commit changes. But to be sure, it is perfectly safe and valid to open the database on program startup, commit changes during the process and close it on exit (or unhandled exception)? Cheers, Timo There's no "one fits all feet" rule for such things - as y

[Tutor] Opening and closing SQLite db

2010-12-26 Thread Timo
tion if my application starts, and commit and close when the user quits. Is this save? Can data be selected if I haven't commit anything? Cheers, Timo ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://

Re: [Tutor] Random Number Question

2010-11-25 Thread Timo
easy-peasy way to get a list of names used in the standard library (I am thinking to something like "dir()"? This is the webpage I always use for searching an appropriate module: http://docs.python.org/modindex.html Cheers, Timo Mac. ___

Re: [Tutor] Complete Shutdown

2010-11-02 Thread Timo
("org.freedesktop.Hal", "/org/freedesktop/Hal/devices/computer") bus_object.Shutdown(dbus_interface="org.freedesktop.Hal.Device.SystemPowerManagement") This will shutdown your computer immediatly. You can substitute the "Shutdown" method with "Suspend", "Hibe

[Tutor] Stopping a webservice

2010-10-20 Thread Timo
eat. But how could I remember this class to call "class.shutdown = True" any given time when I press the stop button? Cheers, Timo ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Connecting my users

2010-10-02 Thread Timo
ption to put it on my own. Cheers, Timo On Fri, Oct 1, 2010 at 2:49 PM, Timo <mailto:timomli...@gmail.com>> wrote: Hello, I have the following idea, but no clue how to implement this. I want my users to be able to connect to other users (with the same program) and

[Tutor] Connecting my users

2010-10-01 Thread Timo
know where to start or that I'm even at the right path. So if anyone can point me into the right direction of a framework or protocol I should use for this, it would be appreciated. Cheers, Timo ___ Tutor maillist - Tutor@python.org To unsubscribe

Re: [Tutor] working with empty lists

2010-09-16 Thread Timo
, i in enumerate(l): ... print('%s. %s' %(index, i)) ... 0. 1 1. 2 2. 3 3. 4 etc. Cheers, Timo I tried changing the append to l.append(i+1) which almost worked but the output started with 1. 2 I was curious what happend to the 0. 1 line I know this means that I'm not underst

Re: [Tutor] FW: wierd replace problem

2010-09-14 Thread Timo
quot;,.!";:") You need to escape the quote between the quotes: >>> word.strip(".,!\";:") Timo Roelof ___ Tutor maillist

Re: [Tutor] FW: wierd replace problem

2010-09-14 Thread Timo
7;bar' You need to escape the quotes with a backslash, like: >>> s = 'foo\'bar' >>> print s foo'bar Cheers, Timo So I think I go for the suggestion of Bob en develop a programm which deletes all the ' and " by scanning it character by char

Re: [Tutor] Writing scripts and apps for Internet consumption

2010-08-01 Thread Timo
version for example) or ask your webhost. You can also put this on top of your script, so it shows you a nice Python traceback instead of an error: import cgitb cgitb.enable() Cheers, Timo test-working.py: this works on both laptop & server http://pastebin.com/iLNTrGdW both avail

Re: [Tutor] Problem with input() and unicode string

2010-07-28 Thread Timo
ve prompt: >>> year = input(u'Introduce el año:') Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in position 14: ordinal not in range(128) Cheers, Timo I believe th

Re: [Tutor] Contents of Tutor digest, Help with hangman

2010-07-19 Thread Timo
13:09:56) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import getpass >>> s = getpass.getpass("Enter your word here: ") Enter your word here: >>> print s blah Cheers,

Re: [Tutor] How to add extra Vbox fields dynamically

2010-06-20 Thread Timo
rfect, but it just doesn't seem right for some reason. You also posted this on the PyGTK mailing list, which is the correct place for these problems. Please post your PyGTK questions only there, do not double post. I'll answer you there. Cheers, Timo Lang Hurst wrote: I hope tha

[Tutor] Uploading a file (non-form)

2010-05-30 Thread Timo
t = form['text'].value Now I can use 'text' on the server, for mailing etc. But I really can't manage to do this with a file. Anyone can give me a helping hand here? Cheers, Timo ___ Tutor maillist - Tutor@python.

Re: [Tutor] Recent Documents

2010-05-28 Thread Timo
l with that. See the PyGTK reference manual and see the widgets that start with "Recent*". Cheers, Timo Thanks, John S. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.pyt

Re: [Tutor] Sending mail

2010-03-26 Thread Timo
2010/3/25 Timo > Hello, > > I was wondering what the best way is to send an email through my program? I > want the user to send an email with an attachment. > > I do have a webspace, should I use the smtplib module if my webhost > supports it (I have to ask though), or sho

[Tutor] Sending mail

2010-03-25 Thread Timo
that? Cheers, Timo ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Cannot open SQLite database

2010-02-25 Thread Timo
ces, and it is located in the same folder as where the database should be. So if the folder wasn't writeable, the creation of the logfile would have caused an error too. So I'm a bit stuck about this one. Timo ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Cannot open SQLite database

2010-02-25 Thread Timo
ld be. Hmm that's strange. I thought the application data folder is the correct folder on Windows systems to put your configuration files. And until now, it worked perfectly for every user. What should be the correct folder then? Cheers, Timo

[Tutor] Cannot open SQLite database

2010-02-24 Thread Timo
the error are Russian, so I thought that the Russian characters would cause problems. I tried on my Linux and Windows machines with some Russian names, but thet doesn't seem the problem. Some help is appreciated :-). Cheers, Timo ___ Tutor maillis

Re: [Tutor] Compile py to exe in ubuntu

2010-02-11 Thread Timo
2000 to Windows 7 without installing anything else (like Python). Try GUI2exe for a nice graphical interface. Cheers, Timo Thanks you, Harya Dananjaya ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http

[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

Re: [Tutor] interactive mode questions

2009-12-25 Thread Timo
Op 25-12-09 17:49, rick schreef: I'm working my way through Mr Lutz's "Learning Python", and I come to this snippet (page 271): while True: reply = input('Enter text:') Try this: reply = raw_input('Enter text: ') Cheers, Timo

Re: [Tutor] search the folder for the 2 files and extract out only the version numbers 1.0 and 2.0.

2009-11-16 Thread Timo
I find regular expressions alwys hard to get, so here is my solution: >>> import glob >>> glob.glob('C:\\Users\\blueman\\Desktop\\allFiles\\MyTest[0-9].[0-9].zip') Cheers, Timo MARCUS NG schreef: Hi all, I am really new to python and I am trying to create

Re: [Tutor] nul file in Windows

2009-11-16 Thread Timo
Dave Angel schreef: Timo List wrote: For my program I disable the py2exe log feature by routing output to the nul-file. Code: if win32 and py2exe: sys.stdout = open("nul", "w") sys.stderr = open("nul", "w") This always

[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

Re: [Tutor] Generating unique ID

2009-10-29 Thread Timo
Thanks for all the answers. I'm using SQLite as database and will try the ROWID. Timo Modulok schreef: I'm writing an application which will hold a database of people. Ofcourse, people can have the same name, so I want to stock them with an unique ID. I've searched and fo

[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

Re: [Tutor] creating an exe

2009-08-12 Thread Timo
proportio...@msn.com schreef: hi, thanks to all that helped with my list question yesterday. i have now finished my program the way i want it. is there a way to compile my program so that people without python can see what i have made? Works great with py2exe. Timo

[Tutor] int to bytes and the other way around

2009-07-06 Thread Timo
I have written a program that uses a C++ module as backend. Now I found out that I can use Python to call an underneath C lib. That's nice, so I don't need to Popen() the C++ module. I have a problem though with some info that is returned (always an integer). I'll try to explain a bit, this is

[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

Re: [Tutor] Sorting a list

2009-05-14 Thread Timo
Emile van Sebille schreef: On 5/13/2009 9:25 AM Timo said... Hello, I don't think this should be difficult, so maybe I look over it. But I can't seem to find the solution. I have a list with one word and a couple of numbers. If this is always the case you can use the sort metho

[Tutor] Sorting a list

2009-05-13 Thread Timo
7;, 3, 9] should be: ['word', 3, 4, 6, 9] Timo ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Alternative for Shelve

2009-05-12 Thread Timo
Kent Johnson schreef: On Tue, May 12, 2009 at 4:00 AM, Timo wrote: Kent Johnson schreef: Try the pickle module. I went from Pickle to Shelve because I couldn't store my wanted list of dictionaries in Pickle. What was the problem? You should be able to create a

Re: [Tutor] Alternative for Shelve

2009-05-12 Thread Timo
Kent Johnson schreef: On Tue, May 12, 2009 at 3:59 AM, Timo wrote: Alan Gauld schreef: "Timo" wrote I have an issue with the Shelve module. It works great for my needs, the only problem is that a file made with Shelve isn't interchangable between diff

Re: [Tutor] Alternative for Shelve

2009-05-12 Thread Timo
Kent Johnson schreef: On Mon, May 11, 2009 at 1:39 PM, Timo wrote: Hello all, I have an issue with the Shelve module. It works great for my needs, the only problem is that a file made with Shelve isn't interchangable between different computers. I want my data to be exchanged between

Re: [Tutor] Alternative for Shelve

2009-05-12 Thread Timo
Alan Gauld schreef: "Timo" wrote I have an issue with the Shelve module. It works great for my needs, the only problem is that a file made with Shelve isn't interchangable between different computers. I thought it would be. What kind of computers are you having issues with

  1   2   >