Re: Easiest framework to develop simple interactive web site in python?

2011-09-12 Thread Matthias Huening
Am 12.09.2011 16:03, schrieb John Reid: I don't have much experience writing web sites or applications. Can anyone recommend a python framework that will allow me to easily write a few pages? You want a simple framework? Try Bottle: http://bottlepy.org/ Matthias -- http://mail.python.org/mail

Re: difference between 2 arrays

2009-08-19 Thread Matthias Huening
Pierre (19.08.2009 10:48): Hello, I would like to know how to find the difference (set operation) between 2 arrays : a = array([1,2, 3,2,5,2]) b = array([1,2]) I want a - b = [3,5] What about set()? >>> a = set([1,2, 3,2,5,2]) >>> b = set([1,2]) >>> a.difference(b) set([3, 5]) Matthias --

Re: SQLite

2008-10-03 Thread Matthias Huening
Thanks! cursor.rowcount does exactly what I need. Before going any further... make sure that SQLite's count_change is enabled: PRAGMA count_changes PRAGMA count_changes = 0 | 1 "Query or change the count-changes flag. Normally, when the count-changes flag is not set, INSERT, UPDATE and DELET

SQLite

2008-10-03 Thread Matthias Huening
Hi, This is probably trivial, but I cannot find a solution right now. With MySQLdb, I could test the success of a deleting action like this: sql = "DELETE FROM table WHERE name='xxx'" res = cur.execute(sql) if res == 1: print 'Okay' else: print 'nothing deleted' This seems not to wor

tkFileDialog and locale under Linux

2008-09-23 Thread Matthias Huening
Hi, I have problems using tkFileDialog under Linux (Ubuntu 8.04 in my case, but other Linuxes seem to show the same behaviour). The following works fine: import tkFileDialog f = tkFileDialog.askopenfilename() No problem, I can chose a filename. But when switching the locale (in my case to G

Re: PHP's str_replace ?

2008-09-10 Thread Matthias Huening
Matthias Huening (10.09.2008 16:07): Anjanesh Lekshminarayanan (10.09.2008 15:50): In PHP, if I do str_replace(array('a', 'e', 'i', 'o', 'u'), '-', $str) it'll replace all vowels with a hyphen in string $str. Is there some eq

Re: PHP's str_replace ?

2008-09-10 Thread Matthias Huening
Anjanesh Lekshminarayanan (10.09.2008 15:50): In PHP, if I do str_replace(array('a', 'e', 'i', 'o', 'u'), '-', $str) it'll replace all vowels with a hyphen in string $str. Is there some equivalent in Python ? What about something like this: import re new_str = re.sub('([aeiou])-', r'\1', str)

Re: [ANN] pysqlite 2.5.0 released

2008-09-08 Thread Matthias Huening
Gerhard Häring (08.09.2008 10:12): Error is: con.execute("select load_extension('./fts3.so')") pysqlite2._sqlite.OperationalError: Das angegebene Modul wurde nicht gefunden. Where should I look for the module? The sources are in ext/fts3 in the SQLite source tree. I haven't found any Mak

Re: [ANN] pysqlite 2.5.0 released

2008-09-07 Thread Matthias Huening
Hi, - - Connection.enable_load_extension(enabled) to allow/disallow extension loading. Allows you to use fulltext search extension, for example ;-) The following code (from the docs) produces an error: from pysqlite2 import dbapi2 as sqlite3 con = sqlite3.connect(":memory:") # Load the ful

Re: Write a GUI for a python script?

2006-03-03 Thread Matthias Huening
Glurt Wuntal (02.03.2006 15:56): > I am a newbie with Python. It's a great language, but I would like to be > able to present a simple gui menu for some of my scripts; something better > than using 'raw_input' prompts. > If you only need some dialogs, input and/or message boxes, you could start

Re: f*cking re module

2005-07-04 Thread Matthias Huening
jwaixs (04.07.2005 10:04): > arg... I've lost 1.5 hours of my precious time to try letting re work > correcty. There's really not a single good re tutorial or documentation > I could found! Did you try this one? http://www.amk.ca/python/howto/regex/regex.html import re str = "blablaRe mo

Re: turn text lines into a list

2005-06-27 Thread Matthias Huening
Xah Lee (27.06.2005 12:33): > i have a large number of lines i want to turn into a list. > In perl, i can do > > @corenames=qw( > rb_basic_islamic > sq1_pentagonTile > sq_arc501Tile > sq_arc503Tile > ); > > use Data::Dumper; > print Dumper([EMAIL PROTECTED]); > > -- > is there some short

Re: Regexp problem, which pattern to use in split

2004-12-13 Thread Matthias Huening
Hans Almåsbakk (14.12.2004 16:02): Any pointer will be greatly appreciated. Maybe I'm attacking this problem the wrong way already from the start? (Not that I can see another way myself :) Hans, did you try the csv module in the Python library? Matthias -- http://mail.python.org/mailman/listinfo/py