Re: f*cking re module

2005-07-04 Thread Simon Brunning
On 4 Jul 2005 01:04:47 -0700, jwaixs <[EMAIL PROTECTED]> wrote: > 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! http://www.amk.ca/python/howto/regex/ -- Cheers, Simon B, [EMAIL PROT

Re: Lost in a sea of documentation...can you point me in the right direction?

2005-07-04 Thread Simon Brunning
On 6/30/05, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > There are 2 problems to solve: > 1/ change the 'wallpaper' > 2/ run as a background task (a 'service' on Win32, a 'daemon' on unix-likes) > > The 2nd one is already solved by your os (use Windows' task scheduler or > *n*x's cron). I was

Re: Outlook COM: how to create a MailItem from a .msg file

2005-07-04 Thread Simon Brunning
On 7/4/05, Guy Lateur <[EMAIL PROTECTED]> wrote: > I've been writing some code to move some data into and out of Outlook (2003 > + Exchange 2003). I have some email .msg files on our file server, and I > can't seem to get them back into the Outlook object I need, ie a MailItem. > I've tried to use

Re: what is __init__.py used for?

2005-07-05 Thread Simon Brunning
On 5 Jul 2005 01:31:09 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am a new learner of Python Programming Language. Welcome! >I was wonderring ... what is the __init__.py used for ? >This question may seems to be stupid for an expert. >But, if you can give the answer, it w

Dr. Dobb's Python-URL! - weekly Python news and links (Jul 5)

2005-07-05 Thread Simon Brunning
QOTW: "That's what I love in that news group. Someone comes with a stupid and arrogant question, and someone else answers in a calm and reasonable way." - Gustavo Niemeyer "After 25 years doing this, I've become something of a Luddite as far as fancy IDEs and non-standard features go... and a huge

Re: f*cking re module

2005-07-06 Thread Simon Brunning
On 6 Jul 2005 01:01:34 -0700, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > With * being a greedy operator, your post's subject line matches, > "firetrucking" Nope: >>> print re.match('f*cking', 'firetrucking') None The OP was clearly showing his lack of regex nouce here. Clearly he wanted 'f.*

Dr. Dobb's Python-URL! - weekly Python news and links (Jul 5)

2005-07-06 Thread Simon Brunning
QOTW: "That's what I love in that news group. Someone comes with a stupid and arrogant question, and someone else answers in a calm and reasonable way." - Gustavo Niemeyer "After 25 years doing this, I've become something of a Luddite as far as fancy IDEs and non-standard features go... and a huge

Re: Favorite non-python language trick?

2005-07-06 Thread Simon Brunning
On 7/6/05, Edvard Majakari <[EMAIL PROTECTED]> wrote: > Ability to tag some methods 'deprecated' as in Java (from 1.5 > onwards?). However, Python interpreter doesn't have to do it: pydoc and > similar tools could detect, say, '@deprecated' in method comment string and > warn user about it. http:/

Dr. Dobb's Python-URL! - weekly Python news and links (Jul 13)

2005-07-13 Thread Simon Brunning
QOTW: "The posts do share an erroneous, implied assumption that the investment in learning each language is equal. Python has a strong competitive advantage over Java and C++ in terms of learnability. A person can get up to speed in a few days with Python." - Raymond Hettinger "You know, this is

Re: Python Newbie

2005-07-14 Thread Simon Brunning
On 14 Jul 2005 03:24:29 -0700, linuxfreak <[EMAIL PROTECTED]> wrote: > Hi all, >I came accross this article by Eric Raymond in which he has sung > peans about the python language. Well that has whetted my appetite... > So I decided to get down and dirty. But alas I got down but not dirty.. > i

Dr. Dobb's Python-URL! - weekly Python news and links (Jul 13)

2005-07-14 Thread Simon Brunning
QOTW: "The posts do share an erroneous, implied assumption that the investment in learning each language is equal. Python has a strong competitive advantage over Java and C++ in terms of learnability. A person can get up to speed in a few days with Python." - Raymond Hettinger "You know, this is

Re: goto

2005-07-18 Thread Simon Brunning
On 7/18/05, Hayri ERDENER <[EMAIL PROTECTED]> wrote: > hi, > what is the equivalent of C languages' goto statement in python? > best regards http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/832906c6122dc137 Let's not go through *that* again... -- Cheers, Simon B, [EMAI

Re: re.IGNORECASE and re.VERBOSE

2005-07-18 Thread Simon Brunning
On 7/18/05, Jeremy <[EMAIL PROTECTED]> wrote: > I am using regular expressions and I would like to use both > re.IGNORECASE and re.VERBOSE options. I want to do something like the > following (which doesn't work): > > matsearch = r'''^\ {0,4}([mM]\d+) ''' > MatSearch = re.compile(matsearch, re.VE

Re: is this pythonic?

2005-07-20 Thread Simon Brunning
On 7/20/05, Mage <[EMAIL PROTECTED]> wrote: > Or is there better way? > > for (i, url) in [(i,links[i]) for i in range(len(links))]: for i, url in enumerate(links): -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/pytho

Dr. Dobb's Python-URL! - weekly Python news and links (Jul 20)

2005-07-20 Thread Simon Brunning
QOTW: "Discussing goto statements and Microsoft together is like mixing dynamite and gasoline." - DH '"Spaghetti" doesn't quite describe it. I've settled on "Lovecraftian": reading the code, you can't help but get the impression of writhing tentacles and impossible angles.' - Robert Kern Hig

Re: Web-Forms

2005-07-21 Thread Simon Brunning
On 7/21/05, Mathias Waack <[EMAIL PROTECTED]> wrote: > I need to access some information from a web site which are only accessible > through a form. Thus for each bucket of data you have to fill out the form, > submit it and wait for an answer. Very easy - if you don't have to check > some hundred

Dr. Dobb's Python-URL! - weekly Python news and links (Jul 20)

2005-07-21 Thread Simon Brunning
QOTW: "Discussing goto statements and Microsoft together is like mixing dynamite and gasoline." - DH '"Spaghetti" doesn't quite describe it. I've settled on "Lovecraftian": reading the code, you can't help but get the impression of writhing tentacles and impossible angles.' - Robert Kern Hig

Re: question about deleting records from mysql

2005-07-27 Thread Simon Brunning
On 27 Jul 2005 04:29:33 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hey there, > sorry , second question in as many days. > i am trying to do some stuff with MySQLdb and the thing is, i can > select records and such, but when i try to delete them, they dont > really go away. A fiver says

Re: easy float question just eludes me

2005-07-28 Thread Simon Brunning
On 28 Jul 2005 06:39:32 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > i have a real easy one here that isn't in my book. > i have a int number that i want to divide by 100 and display to two > decimal places. > > like this float(int(Var)/100) > but i need it to display the .00 even if it d

Dr. Dobb's Python-URL! - weekly Python news and links (Jul 29)

2005-07-29 Thread Simon Brunning
QOTW: "Guido has marked the trail; don't ignore the signs unless you really know where you're going." - Raymond Hettinger 'Proverbs 28:14 JPS "Happy is the man that feareth alway; but he that hardeneth his heart shall fall into evil." Obviously an exhortation to not ignore raised exceptions with "

Dr. Dobb's Python-URL! - weekly Python news and links (Jul 29)

2005-07-30 Thread Simon Brunning
QOTW: "Guido has marked the trail; don't ignore the signs unless you really know where you're going." - Raymond Hettinger 'Proverbs 28:14 JPS "Happy is the man that feareth alway; but he that hardeneth his heart shall fall into evil." Obviously an exhortation to not ignore raised exceptions with "

Re: "Ordered" dicts

2005-08-10 Thread Simon Brunning
On 8/10/05, Chris Cioffi <[EMAIL PROTECTED]> wrote: > I have lots of code that looks like: > keys = mydict.keys() > keys.sort() keys = sorted(mydict.keys()) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/pyt

Re: "Ordered" dicts

2005-08-10 Thread Simon Brunning
On 8/10/05, Chris Cioffi <[EMAIL PROTECTED]> wrote: > While the sorted() built in addressed (yet another) community desire, I > don't think this addresses the underlying expectation of getting dictionary > keys in some order. You do get them in *some* order. ;-) > It works, but it feel like a

Re: bug in property?

2005-08-12 Thread Simon Brunning
On 8/12/05, Damir Hakimov <[EMAIL PROTECTED]> wrote: > #!/usr/bin/python2.4 > class test_property: > def __init__(self): > self._x="Zero" > pass > def setx(self,x): > print "set x" #this is not work > self._x=x > def getx(self): return self._x > def

Re: Text/IDE Python Editor?

2005-08-12 Thread Simon Brunning
On 8/12/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Any recommendations on a editior/IDE for programming in python? http://wiki.python.org/moin/PythonEditors -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python

Re: tuple assign variables

2005-08-15 Thread Simon Brunning
On 8/13/05, dimitri pater <[EMAIL PROTECTED]> wrote: > selecting a record from a MySQL database results in a tuple like this: > (('Evelyn', 'Dog', 'No'),) > I want to assign every item of that tuple to a variable using this code > (deep_list is taken from the Python Cookbook): > > def deep_li

Re: Library vs Framework (was Dr. Dobb's Python-URL!)

2005-08-15 Thread Simon Brunning
On 8/15/05, Rocco Moretti <[EMAIL PROTECTED]> wrote: > Which lead me to the question - what's the difference between a library > and a framework? If you call its code, it's a library. If it calls yours, it's a framework. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/

Re: Library vs Framework (was Dr. Dobb's Python-URL!)

2005-08-16 Thread Simon Brunning
On 8/15/05, Terry Hancock <[EMAIL PROTECTED]> wrote: > On Monday 15 August 2005 09:54 am, Simon Brunning wrote: > > If you call its code, it's a library. If it calls yours, it's a framework. > > Such concision deserves applause. ;-) Thank you. ;-) As others have

Re: [Python-Dev] implementation of copy standard lib

2005-08-16 Thread Simon Brunning
On 8/14/05, Martijn Brouwer <[EMAIL PROTECTED]> wrote: > After profiling a small python script I found that approximately 50% of > the runtime of my script was consumed by one line: "import copy". > Another 15% was the startup of the interpreter, but that is OK for an > interpreted language. The co

Re: [Python-Dev] implementation of copy standard lib

2005-08-17 Thread Simon Brunning
On 8/16/05, Martijn Brouwer <[EMAIL PROTECTED]> wrote: > Well, I guess making a deep copy of an object is important in many case. > Just try this: > A=[] > B=A > A.append("foo") > print B > > Guess the output. It is: > ['foo'] I remember thinking that this behavior was odd when I learned Java man

Re: Need better way to unpack a list

2005-08-17 Thread Simon Brunning
On 8/17/05, Nx <[EMAIL PROTECTED]> wrote: > I want to unpack a list into variables > the list is created at runtime and I do not know > how many items there will be , but I know not more than 25. > The list unpacks into variables which are prev. defined as > line1,line2line25 which are actually

Re: Python for Webscripting (like PHP)

2005-08-22 Thread Simon Brunning
On 22 Aug 2005 09:16:41 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "Fredrik Lundh" <[EMAIL PROTECTED]> writes: > > > (Python has even been told to be used by Yahoo! and Google, among others, > > > but nobody was able to demonstrate this, so far) > > hint: > > http://mail.google

Re: Convert float to string ...

2005-08-23 Thread Simon Brunning
On 8/23/05, Konrad Mühler <[EMAIL PROTECTED]> wrote: > How can i convert a float value into a string value? > > string_value1 = string(float_value) + ' abc' string_value1 = str(float_value) + ' abc' -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail

Re: What's the matter with this code section?

2005-08-24 Thread Simon Brunning
On 24 Aug 2005 00:18:00 -0700, Johnny Lee <[EMAIL PROTECTED]> wrote: > AttributeError: WasRun instance has no attribute 'wasSetUp' It means exactly what it says. The last line of your TestCaseTest classes testSetUp method refers to test.wasSetUp. So far as I can see, test is an instance of your Wa

Re: Python Database Scripts

2005-09-14 Thread Simon Brunning
On 13 Sep 2005 11:32:05 -0700, Chuck <[EMAIL PROTECTED]> wrote: > BTW, where is the DB-API docs for python? Google is your friend - , 1st hit. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mail

Re: MySQLdb UPDATE does nothing

2005-09-15 Thread Simon Brunning
On 9/15/05, John Moore <[EMAIL PROTECTED]> wrote: > ... my main concern is that the UPDATE sql doesn't actually > work, and I can't understand why. You probable need to commit your changes. Try a cursor.commit() call. If all the changes make up one logical transaction, do the commit at the end of

Re: MySQLdb UPDATE does nothing

2005-09-15 Thread Simon Brunning
On 9/15/05, John Moore <[EMAIL PROTECTED]> wrote: > I tried that, but got this: > > Traceback (most recent call last): > File "moddb.py", line 31, in ? > cursor.commit() > AttributeError: 'Cursor' object has no attribute 'commit' Oops. I should have said connection.commit(). Posting before

Re: Looking for system/network monitoring tool written in Python

2005-09-22 Thread Simon Brunning
On 9/22/05, Mike Meyer <[EMAIL PROTECTED]> wrote: > I've found a fair number of systems/network monitoring tools (things > like Big Brother, Big Sister, cricket, etc.) written in Perl. I'm > curious if there are any written in Python. There's EDDIE - . I've never used it my

Re: Loop in list.

2005-02-08 Thread Simon Brunning
On Tue, 08 Feb 2005 06:50:31 -0800 (PST), Jim <[EMAIL PROTECTED]> wrote: > Where did this type of structure come from: > > mat = ['a' for i in range(3)]? > > This will produce a list of three elements but > I don't see reference for it in any of the books. It's called a "List Comprehension".

Re: Effbot's SimpleXMLWriter fails when py2exe'd

2005-02-08 Thread Simon Brunning
On Tue, 08 Feb 2005 08:35:51 -0800 (PST), Erik Bethke <[EMAIL PROTECTED]> wrote: > I am getting this strange error log when writing XML files with his XML > writer. It appears to be fouling up on the encoding, ONLY in the exe > version. Runs fine and great as a python script.

Re: [N00B] What's %?

2005-02-10 Thread Simon Brunning
On Thu, 10 Feb 2005 09:41:07 -0800 (PST), administrata <[EMAIL PROTECTED]> wrote: > Hi! it's been about a week learning python! > I've read 'python programming for the absolute begginer' I hope you are enjoying it. ;-_ > I don't understand about % like... > > 107 % 4 = 3 > 7 % 3 = 1 It;'s modul

Re: Python and version control

2005-02-11 Thread Simon Brunning
On Thu, 10 Feb 2005 23:03:43 +, Alan Kennedy <[EMAIL PROTECTED]> wrote: > In my circles, VSS is most often referred to as Visual Source Unsafe. I always find it amusing that VSS's icon is a safe - with the door wide open. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/s

Re: Alternative to raw_input ?

2005-02-11 Thread Simon Brunning
On Fri, 11 Feb 2005 17:26:04 +0100, BOOGIEMAN <[EMAIL PROTECTED]> wrote: > I need something like "Press any key to continue" code for my program. > Currently I use : raw_input("Press Enter to continue ") but it's lame. Err, why? -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.ne

Re: Alternative to raw_input ?

2005-02-14 Thread Simon Brunning
On Fri, 11 Feb 2005 17:37:19 +0100, BOOGIEMAN <[EMAIL PROTECTED]> wrote: > It looks to ugly this way. I want to press > any key without ENTER to continue You'll only got your users complaining that they haven't got an 'any' key... -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-14 Thread Simon Brunning
On Mon, 14 Feb 2005 14:23:08 +0200, Ilias Lazaridis <[EMAIL PROTECTED]> wrote: (snip) > But if those answers above were of official nature, I must seriously > rethink if I can rely on _any_ system which is based on python, as the > foundation and the community do not care about essential needs an

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-14 Thread Simon Brunning
On Mon, 14 Feb 2005 14:12:57 +0100, bruno modulix <[EMAIL PROTECTED]> wrote: > > Why do you hate Perl and Ruby community that much ? Oh, I don't. But fair's fair - we've carried our share of the burden, surely? But-don't-get-me-started-on-those-Groovy-bastards-ly Y'rs, Simon B, [EMAIL PROTECTED]

Re: Variables.

2005-02-15 Thread Simon Brunning
On Tue, 15 Feb 2005 04:30:30 -0800 (PST), administrata <[EMAIL PROTECTED]> wrote: > I wrote this, It's a bit lame though > > I = "Allen" > me = "Allen" > my = "Allen's" > > print \ > """ > %s woke up early in the morning. But, it was unusal by %s. %s pillow > was with %s. %s didn't want to wake u

Re: Test for structure

2005-02-16 Thread Simon Brunning
On Wed, 16 Feb 2005 07:11:08 -0800 (PST), alex <[EMAIL PROTECTED]> wrote: > how can I check if a variable is a structure (i.e. a list)? For my > special problem the variable is either a character string OR a list of > character strings line ['word1', 'word2',...] > > So how can I test if a variabl

Re: gui scripting

2005-02-21 Thread Simon Brunning
On 17 Feb 2005 04:48:19 -0800, Tonino <[EMAIL PROTECTED]> wrote: > thanks - am already involved in a process to modify winguiauto.py - > this is a GREAT start but we need more control and better handleing ;) Can you be more specific? > Thanks for the WATSUP site - will check on this as well ;)

Re: Stuck on Jythonc --all w/ ZipException PyMethod

2005-03-02 Thread Simon Brunning
On Wed, 02 Mar 2005 14:13:48 GMT, Mitch Amiano <[EMAIL PROTECTED]> wrote: > I'm getting started working with Jython (hope this is an ok group for > the question), and ran into a stumbling block using the jythonc tool. Well, I'm sure that no one is going to object to Jython questions here, but you

Re: rearrange text

2005-03-02 Thread Simon Brunning
On 2 Mar 2005 07:36:48 -0800, Daniel Skinner <[EMAIL PROTECTED]> wrote: > If I have the following text > > var = '1,2,3,4' > > and I want to use the comma as a field delimeter That bit's easy: C:\WINNT\system32>python Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32

Re: determine directories with wildcard

2005-03-08 Thread Simon Brunning
On Tue, 8 Mar 2005 14:33:59 +0100, Thomas Rademacher <[EMAIL PROTECTED]> wrote: > Hello, > > I want to collect with the wildcard '*' all existing directories. > For example: /dir/dir/*/dir/*/dir/* or C:\dir\dir\*\dir\*\dir\* How about something like: import fnmatch import os root = 'd:\\' filt

Re: shuffle the lines of a large file

2005-03-08 Thread Simon Brunning
On 7 Mar 2005 06:38:49 -0800, gry@ll.mit.edu wrote: > As far as I can tell, what you ultimately want is to be able to extract > a random ("representative?") subset of sentences. If this is what's wanted, then perhaps some variation on this cookbook recipe might do the trick: http://aspn.activest

Re: shuffle the lines of a large file

2005-03-08 Thread Simon Brunning
On Tue, 8 Mar 2005 14:13:01 +, Simon Brunning <[EMAIL PROTECTED]> wrote: > On 7 Mar 2005 06:38:49 -0800, gry@ll.mit.edu wrote: > > As far as I can tell, what you ultimately want is to be able to extract > > a random ("representative?") subset of sentences. >

Re: shuffle the lines of a large file

2005-03-08 Thread Simon Brunning
On Tue, 8 Mar 2005 15:49:35 +0100, Heiko Wundram <[EMAIL PROTECTED]> wrote: > Problem being: if the file the OP is talking about really is 80GB in size, and > you consider a sentence to have 80 bytes on average (it's likely to have less > than that), that makes 10^9 sentences in the file. Now, mult

Re: quick question

2005-03-08 Thread Simon Brunning
On Mon, 7 Mar 2005 18:58:20 -0500, Leeds, Mark <[EMAIL PROTECTED]> wrote: > > I have a string variable say "8023 " and > > I want to get rid of the beginning > > And ending quotes. Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "cre

Re: shuffle the lines of a large file

2005-03-10 Thread Simon Brunning
On Thu, 10 Mar 2005 14:37:25 +0100, Stefan Behnel <[EMAIL PROTECTED]> > There. Factor 10. That's what I call optimization... The simplest approach is even faster: C:\>python -m timeit -s "from itertools import repeat" "[None for i in range(1)]" 100 loops, best of 3: 2.53 msec per loop C:\>p

Re: shuffle the lines of a large file

2005-03-11 Thread Simon Brunning
On Fri, 11 Mar 2005 06:59:33 +0100, Heiko Wundram <[EMAIL PROTECTED]> wrote: > On Tuesday 08 March 2005 15:55, Simon Brunning wrote: > > Ah, but that's the clever bit; it *doesn't* store the whole list - > > only the selected lines. > > But that means that i

Re: os.walk(entire filesystem)

2005-03-11 Thread Simon Brunning
On Thu, 10 Mar 2005 20:11:10 +0100, Uwe Becher <[EMAIL PROTECTED]> wrote: > You would need a wrapper to retrieve all logical drives using > win32api.GetLogicalDriveStrings(),check the drive type with > win32file.GetDriveType() and then os.walk() those local fixed drives. http://groups-beta.google.

Re: executing non-Python conde

2005-03-11 Thread Simon Brunning
On Fri, 11 Mar 2005 07:36:03 -0700, Earl Eiland <[EMAIL PROTECTED]> wrote: > I need to repeatedly execute an .exe program, changing the command line > arguments, and log the output. http://docs.python.org/lib/module-subprocess.html -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline

Re: python reading excel thru ADO ?

2005-03-15 Thread Simon Brunning
On Mon, 14 Mar 2005 16:20:17 GMT, Chris Curvey <[EMAIL PROTECTED]> wrote: > I've been reading http://www.mayukhbose.com/python/ado/ad-connection.php > , which seems to infer that I can read an Excel file using the ADO > interface with Python on Windows. Unfortunately, the usual problem with > ADO

Re: python version anachronism

2005-03-15 Thread Simon Brunning
On 15 Mar 2005 02:05:24 -0800, Xah Lee <[EMAIL PROTECTED]> wrote: > so, python 2.3.5 is released about 2 months later than 2.4?? Yes. 3.2.5 is a bugfix release of the 2.3 branch, 2.4 is a major release. 2.4.1 is coming soon, BTW. > also, does the "released ..." indicates the doc or the doc and th

Re: please help on installation process

2005-03-18 Thread Simon Brunning
On Fri, 18 Mar 2005 15:05:07 +0530, Arindam <[EMAIL PROTECTED]> wrote: > I had downloaded python-2.4.msi and I have Windows Installer V2.00.2600.2 on > my machine (my OS is Win 2K Professional). But every time I try to run > python-2.4.msi I am getting the error message: "This installation package

Re: Database connection caching

2005-03-18 Thread Simon Brunning
On 18 Mar 2005 04:52:03 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > is there an alternative way of: > > - create a connection object > - open the connection > - close the connection > > every time one has to run a query. It's actually morte like: create connection create cursor execut

Re: Syntax for extracting multiple items from a dictionary

2004-12-01 Thread Simon Brunning
On Wed, 1 Dec 2004 10:23:28 -0500, Dave Merrill <[EMAIL PROTECTED]> wrote: > "anton muhin" wrote: > > Or dict((key, row[key]) for key in cols). > > I'm on Py 2.3.3, and neither of these appear to work. Can someone confirm? I > can't see anything in the 2.4 release notes that point to where this wo

Re: decorators ?

2004-12-03 Thread Simon Brunning
On Fri, 03 Dec 2004 02:43:22 GMT, Jp Calderone <[EMAIL PROTECTED]> wrote: > Bob Ippolito, you mean. And, no offense to Bob, but woopidy freaking doo. > Now the vast hordes of PyObjC developers get to use their editor's name > completion feature a little bit less. What an awesome justificatio

Re: Versioning Libraries

2004-12-03 Thread Simon Brunning
On Fri, 3 Dec 2004 11:03:58 -, Richard Brodie <[EMAIL PROTECTED]> wrote: > I'm just curious: why exceptionally? I like Python for a lot of > reasons but I wouldn't put API stability high on the list. > Not compared with a traditional language like C or Fortran, > anyway. Which languages go aro

Re: Newbie alert !

2004-12-03 Thread Simon Brunning
On Fri, 03 Dec 2004 06:38:54 -0500, Jean Montambeault <[EMAIL PROTECTED]> wrote: > I am not only learning Python but programming itself ; reading your > posts makes me believe that nobody is that much of a beginner here. Is > there a newgroup or list for my type somewhere I can't find it ? The tut

Re: win32 extensions for Python 2.4

2004-12-07 Thread Simon Brunning
On Tue, 7 Dec 2004 21:25:03 +1030, Ishwor <[EMAIL PROTECTED]> wrote: > Hello all, > I was looking through Mark Hammond's website for win32 extensions > for Python 2.4 but couldn't find it. If i am not wrong has anyone any > idea when it will be available or is it being worked on? The > activestat

Re: Wrapper objects

2004-12-09 Thread Simon Brunning
On 9 Dec 2004 06:11:41 -0800, Egil M?ller <[EMAIL PROTECTED]> wrote: > Is there any way to create transparent wrapper objects in Python? This work - ? -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -

Re: results of division

2004-12-09 Thread Simon Brunning
On Thu, 09 Dec 2004 09:38:55 -0500, Brad Tilley <[EMAIL PROTECTED]> wrote: > What is the proper way to limit the results of division to only a few > spaces after the decimal? I don't need rocket-science like precision. > Here's an example: > > 1.775 is as exact as I need to be and normally, 1.70 w

Re: PIL for Windows for Python 2.4

2004-12-09 Thread Simon Brunning
On 9 Dec 2004 06:58:05 -0800, Fuzzyman <[EMAIL PROTECTED]> wrote: > If you're determined enough there are instructions here : > http://www.vrplumber.com/programming/mstoolkit/ > > These will get you the Visual Studio 7 tools (free releases of) and > tell you how to configure distutils to use it.

Re: gather information from various files efficiently

2004-12-14 Thread Simon Brunning
On Tue, 14 Dec 2004 10:40:56 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: > Keith Dart wrote: > > Sigh, this reminds me of a discussion I had at my work once... It seems > > to write optimal Python code one must understand various probabilites of > > your data, and code according to the likely sc

Re: Module question

2004-12-16 Thread Simon Brunning
On Wed, 15 Dec 2004 18:10:40 -0800, Jeff Shannon <[EMAIL PROTECTED]> wrote: > The difference being that when Excel opens up a *.CSV, it goes through > the import wizard. Are you sure that's true? When I open a *.csv file, Excel *appears* to open it without running any kind of wizard. Certainly I

Re: Accessing DB2 with Python

2004-12-17 Thread Simon Brunning
On Thu, 16 Dec 2004 20:20:09 -0500, Grumman <[EMAIL PROTECTED]> wrote: > I'm sure there's a pretty complete python ADO wrapper out there as well. http://adodbapi.sourceforge.net/ -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/l

Re: Email filters in python

2004-12-17 Thread Simon Brunning
On Fri, 17 Dec 2004 15:07:26 GMT, sf <[EMAIL PROTECTED]> wrote: > Would someome like to post their email filters code. Its so common that > probably some standard library > supports it or many would have written it already. If I have basic > structure, I can take from there. http://spambayes.sourc

Re: extract news article from web

2004-12-29 Thread Simon Brunning
On 22 Dec 2004 09:22:15 -0800, Zhang Le <[EMAIL PROTECTED]> wrote: > Hello, > I'm writing a little Tkinter application to retrieve news from > various news websites such as http://news.bbc.co.uk/, and display them > in a TK listbox. All I want are news title and url information. Well, the BBC pub

Re: help - problem installing pywin32

2004-12-30 Thread Simon Brunning
On 27 Dec 2004 10:18:18 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello, > > I was trying to install pywin32 on one computer which has Python 2.4 > installed and it failed. > The error message I got was > > "Can't load Python for pre-install script". I'm not sure what the problem act

Re: (noob alert) why doesn't this work?

2005-03-22 Thread Simon Brunning
On Tue, 22 Mar 2005 12:10:50 +0100, Bouke Woudstra <[EMAIL PROTECTED]> wrote: > Hi, > > I'm a bit stuck with this python script. It's aim is to encode all flac files > to wav and then to mp3. The only problem I have is to preserve the tags. The > code works when there's just one flac file in a dir

Re: Python for a 10-14 years old?

2005-03-24 Thread Simon Brunning
On 23 Mar 2005 21:03:04 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Is there something out there like "Python for kids" which would explain > *basic* programming concepts in a way which is accessible and > entertaining for kids aged 10-14 (that about where her brain is right > now) and wh

Re: Raise Error in a Module and Try/Except in a different Module

2005-04-04 Thread Simon Brunning
On 4 Apr 2005 03:11:23 -0700, Issa-Ahmed SIDIBE <[EMAIL PROTECTED]> wrote: > I Have a function FUNC1 that is define in ModuleA. This function raise > an exception EXCP1 (raise EXCP1), with EXCP1 a global variable in > ModuleA. > > In ModuleB, I have some classes that call FUNC1. I would like to ca

Re: Sending keytrokes to Windows app

2005-04-04 Thread Simon Brunning
On Apr 4, 2005 12:04 PM, Marten Hedman <[EMAIL PROTECTED]> wrote: > I am trying to control a Windows application from a python script with > SendKeys and Python 2.3. WATSUP might be worth a look, instead... http://www.tizmoi.net/watsup/intro.html -- Cheers, Simon B, [EMAIL PROTECTED], http://ww

Re: Testing for EOF ?

2005-04-04 Thread Simon Brunning
On Apr 4, 2005 12:21 PM, Pete Moscatt <[EMAIL PROTECTED]> wrote: > I am reasonably new to python and am trying to read several lines of text > from an open file. my_file = open('whatever.txt', 'r') for line in my_file: print line # Or whatever -- Cheers, Simon B, [EMAIL PROTECTED], http://ww

Re: Testing for EOF ?

2005-04-04 Thread Simon Brunning
On Apr 4, 2005 12:36 PM, Peter Moscatt <[EMAIL PROTECTED]> wrote: > Thanks Simon, > > So the code should look like: > > f=open(myfile,"r") > > for some_var in f: > text=f.readline() > print text > > Do I have this correct ? Nearly - you don't need the text=f.readline() bit. A file object (

Re: (win32) speedfan api control

2005-04-04 Thread Simon Brunning
On Apr 3, 2005 1:52 AM, Claudio Grondi <[EMAIL PROTECTED]> wrote: > May I ask how did you get the > "TJvXPCheckbox" and the other > values necessary to access the program > GUI ? (as I can see, there is no source > code of SpeedFan available) ? Winspector is good for this kind of thing. http://ww

Re: (win32) speedfan api control

2005-04-04 Thread Simon Brunning
On Apr 2, 2005 3:22 AM, tlviewer <[EMAIL PROTECTED]> wrote: (Snip Windows GUI automation stuff.) WATSUP includes a module for Windows GUI automation. It's probably worth a look - it might save you from doing all the research that I had to do! http://www.tizmoi.net/watsup/intro.html -- Cheers, S

Dr. Dobb's Python-URL! - weekly Python news and links (Apr 4)

2005-04-04 Thread Simon Brunning
QOTW: "Paraphrasing Occam, I would say 'don't multiply base classes without necessity'. ;)" - Michele Simionato "The world diversifies, the world congeals." - Raymond Hettinger (commenting on the fact that py.test happily runs unittest test suites) "I can think of no better reason for a programm

Dr. Dobb's Python-URL! - weekly Python news and links (Apr 4)

2005-04-04 Thread Simon Brunning
QOTW: "Paraphrasing Occam, I would say 'don't multiply base classes without necessity'. ;)" - Michele Simionato "The world diversifies, the world congeals." - Raymond Hettinger (commenting on the fact that py.test happily runs unittest test suites) "I can think of no better reason for a programm

Re: StopIteration in the if clause of a generator expression

2005-04-05 Thread Simon Brunning
On Apr 5, 2005 2:04 AM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > [Steven Bethard] > > So do I read this right in preferring > > [ for in ] > > over > > list( for in ) > > Yes! Why? (Serious question. I'm sure that you have a good reason - I just can't figure out what it is.) Th

Re: Does IronPython indicate MS interest in dynamic languages?

2005-04-06 Thread Simon Brunning
On Apr 6, 2005 5:25 AM, Mike Rovner <[EMAIL PROTECTED]> wrote: > Sun abandoned dynamic approach (Tcl) in favor of Java. Sun appear to be very interested in dynamic languages these days: http://www.tbray.org/ongoing/When/200x/2004/12/08/DynamicJava -- Cheers, Simon B, [EMAIL PROTECTED], http://ww

Re: shebang in cross platform scripts

2005-04-06 Thread Simon Brunning
On Apr 6, 2005 2:37 PM, rbt <[EMAIL PROTECTED]> wrote: > Does the line below have any negative impact on Windows machines? I > develop and test mostly on Unix, but my scripts are often used on Win > systems too. > > #!/usr/bin/env python Nope. On Windows it's just a comment. -- Cheers, Simon B

Re: Lambda: the Ultimate Design Flaw

2005-04-06 Thread Simon Brunning
On Apr 6, 2005 4:42 PM, Scott David Daniels <[EMAIL PROTECTED]> wrote: > I've always wondered about this turn of phrase. I seldom > eat a cake at one sitting. Clearly you're just not trying. ;-) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.pyt

Re: PyWin32 COM mailing list / web forum?

2005-04-11 Thread Simon Brunning
On 11 Apr 2005 00:45:08 -0700, Tim N. van der Leeuw <[EMAIL PROTECTED]> wrote: > I have some questions specifically about python win32com extensions, > and I thought it might be more appropriate to ask them on a mailing > list / newsgroup / webforum etc. dedicated to that. But is there such a > thi

Dr. Dobb's Python-URL! - weekly Python news and links (Apr 11)

2005-04-11 Thread Simon Brunning
QOTW: "I think my code is clearer, but I wouldn't go so far as to say I'm violently opposed to your code. I save violent opposition for really important matters like which text editor you use." - Roy Smith "You need to recursively subdivide the cake until you have a piece small enough to fit in y

Dr. Dobb's Python-URL! - weekly Python news and links (Apr 11)

2005-04-11 Thread Simon Brunning
QOTW: "I think my code is clearer, but I wouldn't go so far as to say I'm violently opposed to your code. I save violent opposition for really important matters like which text editor you use." - Roy Smith "You need to recursively subdivide the cake until you have a piece small enough to fit in y

Re: Better access to database search results

2005-04-12 Thread Simon Brunning
On Apr 12, 2005 4:32 PM, Gabriel Cooper <[EMAIL PROTECTED]> wrote: > Usually when I access db search results it's something like this: > > cursor.execute("select A1,A2,A3,A4 from B where C") > for (a1,a2,a3,a4) in cursor.fetchall(): > stuff() > > But sometimes the point at which I use the dat

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Apr 11)

2005-04-14 Thread Simon Brunning
On 4/14/05, Greg Ewing <[EMAIL PROTECTED]> wrote: > Actually it was me who wrote that, not Scott. > > (Darn. I finally say something that gets into Quote of the > Week, and it's attributed to someone else! :-) :-) :-) Ooops. I'm really very sorry about that. Try and think of something else witty

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Apr 11)

2005-04-14 Thread Simon Brunning
On 4/14/05, Peter Hansen <[EMAIL PROTECTED]> wrote: > Greg Ewing wrote: > > (Darn. I finally say something that gets into Quote of the > > Week, and it's attributed to someone else! :-) :-) :-) > > +1 on this for meta-QOTW, solving both problems... Yeah, but to whom do I attribute it? ;-) -- C

Re: MS SQL Server/ODBC package for Python

2005-04-15 Thread Simon Brunning
On 4/15/05, Graham <[EMAIL PROTECTED]> wrote: > I need a SQL Server or ODBC package for Python. Can anyone help please? > Have search the Python packages under Database and there is no reference to > either SQL Server or ODBC. Top of the line is probably mxODBC (

Re: Determine ip address

2005-04-15 Thread Simon Brunning
On 15 Apr 2005 06:03:06 -0700, codecraig <[EMAIL PROTECTED]> wrote: > hi, >how can i use python to figure the ip address of the machine which > the python script is running on? I dont mean like 127.0.0.1but i > want the external IP address (such as ipconfig on windows displays). On Window

<    1   2   3   4   5   6   >