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

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

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

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

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

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

[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] 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] 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] 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] ConfigParser re-read fails

2009-02-12 Thread Timo
Hello all, I use a file for my program that I read with ConfigParser. I append all sections of this file into a treeview (using pyGTK). The user can add, edit or remove sections, options and values. These I write back to the file and then update the treeview. The problem is that it doesn't up

[Tutor] Shelve: remove dictionary from list

2009-03-03 Thread Timo
Hello all, I'm using the Shelve module to store dictionaries in a list as a value of a key. So: key = [{'keyA' : 1, 'keyB' : 2}, {'key1' : 1, 'key2' : 2}] The problem is I can't remove a dictionary from the list. import shelve s = shelve.open('file') try: for index, value in enumerate(s[

Re: [Tutor] Shelve: remove dictionary from list

2009-03-04 Thread Timo
Kent Johnson schreef: On Tue, Mar 3, 2009 at 12:18 PM, Timo wrote: Hello all, I'm using the Shelve module to store dictionaries in a list as a value of a key. So: key = [{'keyA' : 1, 'keyB' : 2}, {'key1' : 1, 'key2' : 2}] The problem is I can&

[Tutor] Shelve doesn't free up memory

2009-03-30 Thread Timo
Hello, I have a PyGTK application where the user is able to click on a button, then a new dialog pops up with a treeview and the program fills this view with data from a shelve. Everything works, the data is being added to the treeview. The only problem is, that when I close the dialog, it doesn

Re: [Tutor] Shelve doesn't free up memory

2009-03-31 Thread Timo
Emile van Sebille schreef: Timo wrote: # Results file import shelve def read_result(person): results = [] s = shelve.open(RESULTFILE) try: results = s[person] Maybe passing this out prevents s from being garbage collected? What do you mean by passing out? I also tried

[Tutor] Alternative for Shelve

2009-05-11 Thread Timo
ate' : '2009-03-12', 'location' : 'Belgium'}, {'date' : '2009-04-23', 'location' : 'Spain'}] And so on... Thanks, Timo ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

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

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

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

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

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

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

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

[Tutor] Copy file as root

2008-06-11 Thread Timo
o copy the file from /boot/grub/ to /home/user/Desktop, but ofcourse need to be root to copy it back. So, how can I use shutil.copyfile() with gksudo to ask the password? Or is the another good way to do this in Python? Greets, Timo ___ Tutor maillist - T

Re: [Tutor] Copy file as root

2008-06-12 Thread Timo
John Fouhy schreef: > On 11/06/2008, Timo <[EMAIL PROTECTED]> wrote: > >> Hello, I'm writing a program in Python/pyGTK and I need to be root 2 >> times. The first time is to open a file, let's say menu.lst. I use >> os.system('gksudo gedit /boot/gr

[Tutor] Checking the desktop environment

2008-06-20 Thread Timo
viron['DESKTOP_SESSION'].startswith('kde'): print "Running KDE" So, does anyone know a water-proof solution for desktop environment checking? Timo ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Checking the desktop environment

2008-06-20 Thread Timo
nt so it could set these things to gedit and gksudo for Gnome and kate and kdesu for KDE. Timo Alan Gauld schreef: > "Timo" <[EMAIL PROTECTED]> wrote > >> Hello all, in my program I need to know what desktop environment the >> user is running. > > A few yea

[Tutor] Check for file in different dirs

2008-07-24 Thread Timo
I want to check for a file in 3 directories. If the file is found in 1 of the dirs then do something, if the file was found in 2 or 3 dirs, then do something else. I know the paths and filename. How can this be done? ___ Tutor maillist - Tutor@python

[Tutor] "Analyzing" music with Python

2008-09-05 Thread Timo
I'm sorry if I don't use correct names etc.. What I want is to analyze a music file that is playing. Not sure if analyze is the good word for it. I just want to get info about the song in realtime when it is playing. Info about the current pitch and so. Let's say like most visualisation plugins

Re: [Tutor] Fwd: "Analyzing" music with Python

2008-09-05 Thread Timo
his. W W schreef: Forgot to reply to all... -- Forwarded message -- From: *W W* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> Date: Fri, Sep 5, 2008 at 11:54 AM Subject: Re: [Tutor] "Analyzing" music with Python To: Timo <[EMAIL PROTECTED] <mailto:[

[Tutor] Downloading Files from the net

2008-09-28 Thread Timo
What is the best/correct way to download files from a webpage? www.example.com/example.mp3 for instance. I know how to open the site (with urllib), but have no idea how to write the file to the harddisk. Cheers ___ Tutor maillist - Tutor@python.or

Re: [Tutor] Downloading Files from the net

2008-09-29 Thread Timo
Mark Tolonen schreef: "Timo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] What is the best/correct way to download files from a webpage? www.example.com/example.mp3 for instance. I know how to open the site (with urllib), but have no idea how to write the file

Re: [Tutor] Downloading Files from the net

2008-09-29 Thread Timo
Kent Johnson schreef: On Sun, Sep 28, 2008 at 12:51 PM, Timo <[EMAIL PROTECTED]> wrote: What is the best/correct way to download files from a webpage? www.example.com/example.mp3 for instance. I know how to open the site (with urllib), but have no idea how to write the file to the ha

[Tutor] Sort of database & "family tree" question

2009-01-26 Thread Timo
side, and mother-side the same. | father | father--< | | mother person2--< | | father | mother--< | mother Greets, Timo __

Re: [Tutor] Sort of database & "family tree" question

2009-02-03 Thread Timo
Alan Gauld schreef: Timo wrote So my entry's look like this (more or less ;)): [person1] firstName = foo lastName = bar father = person2 mother = person3 And I assume you are reading these into a Person class and storing these classes in a persons dictionary? Then to access a father be

Re: [Tutor] Sort of database & "family tree" question

2009-02-04 Thread Timo
If I do it like this, I will have to parse all the data from the file and then send them to this class and then call this class again to retrieve it. Then I like my function better. But again, I would love to hear if I'm wrong. Timo ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

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. ___

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

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

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

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

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

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

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

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

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

  1   2   >