Re: [Tutor] Notes on namespaces, scopes, etc

2006-08-02 Thread Dave Kuhlman
ough. The document itself is still here: http://www.rexx.com/~dkuhlman/python_comments.html#namespaces And, thanks again for all the help. Off topic -- For those of you who need the quote: "Badges? We ain't got no badges. We don't need no badges. I don&#

[Tutor] creating a method name on the fly

2006-08-07 Thread dave s
print button, self.button.isChecked() where self.button.isChecked() becomes self.error_button.isChecked() ... self.print_button.isChecked() etc etc Can anyone tell me how to do this ? I have looked at apply but with no luck Thanks Dave __

Re: [Tutor] creating a method name on the fly

2006-08-07 Thread dave s
Thanks for all your input - the discussion wandered off list a bit ! This solution works a treat ... button= getattr(self, 'error_button') print button, button.isChecked() Cheers Dave ___ Tutor maillist - Tutor@python.org http://mail.

[Tutor] rstrip() failure ?

2006-08-09 Thread dave s
no go :( len(app) is still 8. OK ... I am stuck ... Is there a way to show the ascii values of the string - kind of hexedit for a string I am sure the padding blanks are just spaces rstrip() appears to disagree Any help greatly appreciated Dave ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] [Doh!] rstrip() failure ?

2006-08-09 Thread dave s
On Wednesday 09 August 2006 20:45, dave s wrote: > I have a string problem. The following code skips the loop if the string > 'app' is on the banned list ... > > self.ban_app_list = > [' ', 'live_dat', 'exact_sl', 'html_str

Re: [Tutor] rstrip() failure ?

2006-08-09 Thread dave s
read. For > example: > > ## > > >>> msg = 'hello\000world' > >>> print repr(msg) > > 'hello\x00world' > ## Thanks for that :) Have just found my solution without resort

[Tutor] Style query

2006-08-13 Thread dave s
#x27;myobject' or 'my_object' etc Can any of you more experienced programmers outline your style or critique my way of doing this ? Tell me if you have a different system - I am trying to get myself into good habits :) Is there a Python style guide anywhere ? Cheers Dave PS

Re: [Tutor] Style query

2006-08-13 Thread dave s
On Sunday 13 August 2006 12:02, you wrote: > I believe you can find it here: > > http://www.python.org/doc/essays/styleguide.html > > Authored by Guido Van Rossum himself. > Thanks :) Dave > > Cheers, > > Richard > > On 8/13/06, dave s <[EMAIL PROTECTED]

Re: [Tutor] Build a simple ftp server in python

2006-08-16 Thread Dave Kuhlman
er-threads.com/lists/python/python/379675 Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] (no subject)

2006-08-17 Thread Dave Kuhlman
t menu. Highlight a block of code, and try those operations. Indent and Unindent operations will enable you to easily convert top level code into a function: specifically, Indent block and add a "def" statement at the top. I apologize if the above is overly simple-minded and if you a

[Tutor] A list in list problem

2006-08-21 Thread dave s
## split_string ['"temp1"', '"wow a variable"', '', '', ''] clean_line ['temp1', 'wow a variable'] clean_csv ['temp1', 'wow a variable', [...]] ###

Re: [Tutor] A list in list problem

2006-08-21 Thread Dave S
On Monday 21 August 2006 10:59, dave s wrote: Several hours +1 Sometimes it is usefull spelling out my problem in an email - seems to clarify it - maybe when I get to the 'im stuck' I should send an email to myself :) clean_csv.append(clean_line) ... should by clean_csv.append(

Re: [Tutor] A list in list problem

2006-08-21 Thread Dave S
y bad programming style ?. I keep trying to get my code more compact using list comprehension etc - in this case compact got me into trouble. I have tried looking at some open source projects eg kdissert,sbackup to get into good codeing habits but they are a bit above me. So I am learning by tr

Re: [Tutor] A list in list problem

2006-08-21 Thread Dave S
On Monday 21 August 2006 13:58, János Juhász wrote: > Hi Dave, > > > From: dave s <[EMAIL PROTECTED]> > > Subject: [Tutor] A list in list problem > > To: python tutor > > Message-ID: <[EMAIL PROTECTED]> > > Content-Type: text/plain; charset="

Re: [Tutor] A list in list problem

2006-08-21 Thread Dave S
On Monday 21 August 2006 17:41, Alan Gauld wrote: > a=b=[] > a > > > > [] > > > b > > > > [] > > These are the same list. > > a=[1,2,3] > > But here you create a new list and assign it to a. > > a > > > > [1, 2, 3] > > > b > > > > [] > > So a points to the new list and

[Tutor] Larger GUI design ?

2006-08-22 Thread Dave S
. The only way i can see to do this is to either (1) make my backend a class & inherit dlg_app.py so I can access the QT widget directly or (2) pass info from the backend via a socket (yep know about them now!) to a QT script running in timerEvent() Which is the best

Re: [Tutor] Larger GUI design ?

2006-08-22 Thread Dave S
ike a job for a thread... > > > (2) pass info from the backend via a socket (yep know about them > > now!) to a QT > > script running in timerEvent() > > You can do this but threads are less resource greedy. I had not thought of a thread - thats a cool solution Thanks for yo

[Tutor] Package problem

2006-08-27 Thread Dave S
t should not cause a problem. I have tried a = main.scanDBFs.getDbfData(dbf) but keep hitting the same problem. Any ideas ? Dave ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] SAX and Python

2006-08-30 Thread Dave Kuhlman
ader.html http://docs.python.org/lib/module-xml.sax.handler.html Etc. Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman import sys, string import xml.sax.handler as handler import xml.sax class MySaxDocumentHandler(handler.ContentHandler): def __init__(self, outfile):# [2] self.o

Re: [Tutor] SUPER NEWB: basic search and replace

2006-09-01 Thread Dave Kuhlman
e item > chunk = allLines[0] > splitChunk = chunk.split('xVAR1x') > newChunk = 'my shoes fell off'.join(splitChunk) Instead, consider the following: for line in allLines: line = line.replace('xVAR1x', 'my shoes fell off'

Re: [Tutor] pretty_printing

2006-09-03 Thread Dave Kuhlman
ript printer, you could generate your own postscript, > maybe.. > The SciTE text editor, which runs on both Linux and MS Windows, will export a Python source code file to HTML, PDF, RTF, LaTeX, and XML. See: http://www.scintilla.org/SciTE.html The export feature is under th

Re: [Tutor] xml dom

2006-09-06 Thread Dave Kuhlman
t;lxml also offers a SAX compliant API, that works with the SAX support in the standard library." Lxml is at: http://codespeak.net/lxml/ Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org h

Re: [Tutor] Injecting Data into XML Files

2006-09-11 Thread Dave Kuhlman
Scroll down and look at the example in the section titled "Usage", which seems to do something very similar to what you ask about: http://effbot.org/zone/element-index.htm And, lxml -- same API as ElementTree plus additional capabilities, but requires installation of libxml: h

Re: [Tutor] Excluding branches while walking directory tree

2006-09-13 Thread Dave Kuhlman
ether the file is to be ignored. A trivial example: def good_file(filename, skips): if filename in skips: return False else: return True skips = ['ignore1.txt', 'ignore2.txt'] if good_file(filename, skips): # process g

Re: [Tutor] Using my own installed python version in my directory tree.

2006-09-13 Thread Dave Kuhlman
tells you where python looks for modules to be imported. And, by the way, when you install a python package/module by using: $ python setup.py install python will install the package in the correct location depending on which python executable you use to do the install. So, the following two l

Re: [Tutor] <> and chomp

2006-09-14 Thread Dave Kuhlman
r more on string operations and rstrip() in particular. - rstrip() with no arguments strips all whitespace on the right. - A file object (returned by the open() function) is an iterator; it obeys the iterator protocol. That's why you can use it in

Re: [Tutor] tuples versus lists

2006-09-15 Thread Dave Kuhlman
ough you cannot change a tupble itself, you can change the objects that the tuple references, *if* they are mutable. For example (in the ipython prompt): In [1]: d1 = {} In [2]: d2 = {} In [3]: t1 = (d1, d2) In [4]: In [4]: t1 Out[4]: ({}, {}) In [5]: t1[0]['name'

Re: [Tutor] Problems with Python Modules

2006-09-16 Thread Dave Kuhlman
Are you sure that you want to import syslog from twisted.python? syslog is a module in the python standard library. Is there also a module named syslog in twisted.python? Dave [snip] -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] exit app withour raise ?

2006-09-17 Thread Dave S
In the middle of an application, if someone presses the quit button I want to exit. At the moment i raise 'Quit button pressed' which works but spews a stack trace leading to the raise statement. Is there a neat way to just exit without a stack tra

Re: [Tutor] exit app withour raise ?

2006-09-17 Thread Dave S
trace leading to the raise statement. > > Is there a > > neat way to just exit without a stack trace ? > > raise SystemExit > > or more commonly > > import sys > > sys.exit() > > You can add an argument to exit and that will be

[Tutor] module file copy ?

2006-09-21 Thread Dave S
OK have I missed it - but which module is file copy in ? I looked all around OS but no luck - I can find rename(src, dst) but that's about it. Cheers Dave ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] module file copy ?

2006-09-22 Thread Dave S
On Thursday 21 September 2006 21:48, Mike Hansen wrote: > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Dave S > > Sent: Thursday, September 21, 2006 2:41 PM > > To: Python Tutor > > Subject: [Tutor] module

[Tutor] file open (take 2)

2006-09-27 Thread Dave S
appending a second modified copy to the original ... as per the python ref. Am I right in thinking that the only way is to open with a 'r', close them open with a 'w' ? Cheers Dave ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] file open (take 2)

2006-09-28 Thread Dave S
On Wednesday 27 September 2006 21:59, Dave S wrote: > Hi, > > I am trying to read in an ascii text file, do some alterations and write it > back. > > file = open(self.config.get('pdf','cert') + '/cert.pdf' , 'r+') > lines = file.re

[Tutor] getting 'pwd' for XP ?

2006-09-28 Thread Dave S
I currently running XP (like a fish out of water :) and I need to know the dir that the python script is executed from. a linux 'pwd' How can I achieve this - I have looked in sys & os & os.path but found nothing suitable Dave

Re: [Tutor] getting 'pwd' for XP ?

2006-09-28 Thread Dave S
On Thursday 28 September 2006 16:42, Shantanoo Mahajan wrote: > +++ Dave S [28-09-06 16:10 +0100]: > | I currently running XP (like a fish out of water :) and I need to know > | the dir that the python script is executed from. a linux 'pwd' How can I > | achieve this - I h

Re: [Tutor] [Fwd: Re: database web app, what tool?]

2006-10-04 Thread Dave Kuhlman
ind here: http://seankelly.tv/videos It compares Zope/Plone, TurboGears, Django, and others. Warning: It's done by someone who is very positive about Python, and is, therefore, quite biased. And, if you have not already found it, you may want to look at the following page in the Py

Re: [Tutor] OT: Book(s) about linux

2006-10-05 Thread Dave Kuhlman
ww.ubuntu.com/ is helpful. For lots of documentation, start here: http://www.linux.org/books/index.html http://www.linux.org/docs/ http://tldp.org/ Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Isolation of code

2006-10-08 Thread Dave Kuhlman
omecode in globalDict where globalDict is a dictionary. globalDict will be the namespace used by somecode, and, for example, variables created (perhaps using assignment) in somecode will be created in globalDict rather than in the current namespace. See: http://docs.python.org/ref/exec.html. Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Tkinter and python

2006-10-08 Thread Dave Kuhlman
y 3. Put mymodule.py on your path, that is, in a directory that is in your PATH environment variable. Alternatively, add the path to the directory containing mymodule.py to your PATH environment variable. Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman

Re: [Tutor] How to read content in a tar file with tarfile module

2006-10-10 Thread Dave Kuhlman
otocol is slightly non-standard. next() returns None when exhausted, whereas the iterator protocol specifies that it should throw a StopIteration exception. See: http://docs.python.org/lib/typeiter.html Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Sharing data between modules

2006-10-19 Thread Dave Kuhlman
taining variables that hold these values, and each module that needed access to these values could do "import config". Although, I suppose that a singleton class (a class intended to have only one instance) might be just as good, and would be more pleasing to the "object-orienta

Re: [Tutor] I need a time object from the future

2006-10-20 Thread Dave Kuhlman
: http://www.egenix.com/files/python/mxDateTime.html It provides arithmetic and comparison operations. Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] free IDE for Python?

2006-11-16 Thread Dave S
On Monday 13 November 2006 23:03, Vadhri, Srinivas wrote: > Hi > > > > A newbie to Python. What is the free IDE for Python development > activities? ActiveState's Komodo IDE needs a license and a fee. > > > > Any recommendations? Eric3/4 works for me :) http://www.die-offenbachs.de/detlev/eric3-s

[Tutor] .sort(key = ???)

2006-11-16 Thread Dave S
e key attribute a.sort(key= ?? ) I cant get a handle on how key works or how to code it for my needs. Can anyone help ? Thanks in advance Dave ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] .sort(key = ???)

2006-11-16 Thread Dave S
On Thursday 16 November 2006 22:35, John Fouhy wrote: > On 17/11/06, Dave S <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I have a bunch of lists within lists that I need to sort ref item [4], I > > can't access my code at the moment but I basically ... > >

[Tutor] exception not raised XP file ?

2006-11-18 Thread Dave S
ecting it to raise an exception when it hits SIZES.DBF because I am opening the file to write - no exception is raised. I know it is scanning SIZES.DBF because my if statement picks it up. Any ideas ? Dave ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] exception not raised XP file ?

2006-11-18 Thread Dave S
On Saturday 18 November 2006 16:08, Roel Schroeven wrote: > Dave S schreef: > > Due to some sloppy programming on a commercial app :) I have a problem. > > > > I have some directories on an XP machine, I need to know which of these > > directories (*.cab_tmp) contain

Re: [Tutor] Python Linux Distro Anyone

2006-11-28 Thread Dave Kuhlman
than Python, but Python is an important part of it. Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] finding AcroRd32.exe - a better way ?

2006-11-30 Thread Dave S
27;, 'user.pdf')) Does what I need and works great but I manualy searched around to find the path to AcroRd32.exe. Short of writting some code to scan any adobe dirs for this exe is there a more elegant way for me to ensure my app will work on any windows machine ? An

Re: [Tutor] finding AcroRd32.exe - a better way ?

2006-11-30 Thread Dave S
On Thursday 30 November 2006 20:50, Terry Carroll wrote: > On Thu, 30 Nov 2006, Dave S wrote: > > My app generates an on the fly PDF manual by using reportlab, once > > generated I would like it to be automatically opened and displayed by XP > > adobe reader. > > &

Re: [Tutor] How To structure a program for cmd line mode & gui mode

2006-12-01 Thread Dave Kuhlman
e http://docs.python.org/lib/module-cmd.html) 2. In your code, separate functionality from interface (GUI). Your goal should be to be able to use the functions (or classes) that implement function in both the command line code and the GUI code. Dave [snip] -- Dave Ku

[Tutor] XP & catching execl o/p ?

2006-12-05 Thread Dave S
o the executable (a bit of a trial) and os.startfile('...') it throws the output to a different window, but no exact path needed Any ideas how I can catch the output ? Cheers Dave ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] XP & catching execl o/p ?

2006-12-05 Thread Dave S
On Tuesday 05 December 2006 20:58, Luke Paireepinart wrote: > Dave S wrote: > > Hi all, > > > > Struggling with python & XP again. My app needs to know if a certain > > program is running on my XP box > > > > Ideal world - I can get the output of 't

Re: [Tutor] XP & catching execl o/p ?

2006-12-05 Thread Dave S
On Tuesday 05 December 2006 22:42, Luke Paireepinart wrote: > Dave S wrote: > > On Tuesday 05 December 2006 20:58, Luke Paireepinart wrote: > >> Dave S wrote: > >>> Hi all, > >>> > >>> Struggling with python & XP again. My app needs

Re: [Tutor] XP & catching execl o/p ?

2006-12-05 Thread Dave S
On Tuesday 05 December 2006 23:32, Alan Gauld wrote: > "Dave S" <[EMAIL PROTECTED]> wrote > > > Struggling with python & XP again. My app needs to know if a certain > > program > > is running on my XP box > > > > os.execl('') &

Re: [Tutor] XP & catching execl o/p ?

2006-12-06 Thread Dave S
On Tuesday 05 December 2006 23:32, Alan Gauld wrote: > "Dave S" <[EMAIL PROTECTED]> wrote > > > Struggling with python & XP again. My app needs to know if a certain > > program > > is running on my XP box > > > > os.execl('') &

Re: [Tutor] XP & catching execl o/p ?

2006-12-06 Thread Dave S
t know it existed ! Am going down the subprocess route first as its 'built in'. If that does not work - hello WMI Cheers Dave > > > This e-mail has been scanned for all viruses by Star. The > serv

Re: [Tutor] XP & catching execl o/p ?

2006-12-06 Thread Dave S
On Wednesday 06 December 2006 11:04, Kent Johnson wrote: > Dave S wrote: > > Hi all, > > > > Struggling with python & XP again. My app needs to know if a certain > > program is running on my XP box > > > > Ideal world - I can get the output of 't

Re: [Tutor] XP & catching execl o/p ?

2006-12-06 Thread Dave S
On Wednesday 06 December 2006 11:43, Dave S wrote: > On Tuesday 05 December 2006 23:32, Alan Gauld wrote: > > "Dave S" <[EMAIL PROTECTED]> wrote > > > > > Struggling with python & XP again. My app needs to know if a certain > > > progr

[Tutor] subprocess & pyw conflict ?

2006-12-06 Thread Dave S
ings\All Users\Desktop\gsr_running', 'w') f.close() Still zip, and because there is no terminal, I cannot view any errors ! Any suggestions welcome :) Dave ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Is there any good turtorial about numeric python for beginners?

2006-12-06 Thread Dave Kuhlman
On Wed, Dec 06, 2006 at 05:49:22PM -0800, linda.s wrote: > Is there any good tutorial about numeric python for beginners? > I have googled around and many of them are either too old or aims at > experienced users... Look here: http://new.scipy.org/Wiki/Documentation Dave -- Dav

Re: [Tutor] subprocess & pyw conflict ?

2006-12-07 Thread Dave S
On Thursday 07 December 2006 00:31, Luke Paireepinart wrote: > Dave S wrote: > > Hi all, > > > > I thought I had my solution with subprocess ... my test code ... > > > > > > > > #!/usr/bin/env python > > # -*- coding: iso8859_1 -*- >

Re: [Tutor] subprocess & pyw conflict ?

2006-12-07 Thread Dave S
On Thursday 07 December 2006 10:25, Dave S wrote: > On Thursday 07 December 2006 00:31, Luke Paireepinart wrote: > > Dave S wrote: > > > Hi all, > > > > > > I thought I had my solution with subprocess ... my test code ... > > > > > > > >

[Tutor] OT GPL project finished, presentation looming

2006-12-07 Thread Dave S
ion and I know one of the questions will be. "Its what we want but you are not a company, what if you leave ?" I need an answer,.. What am I asking ... If need be are any of you for hire ? Dave PS it looks great, would love to post some pngs b

Re: [Tutor] OT GPL project finished, presentation looming

2006-12-07 Thread Dave S
On Thursday 07 December 2006 17:54, Luke Paireepinart wrote: > Dave S wrote: > > [snip explanation of program] > > Sounds really cool! Its a bit niche - but cool > > > Sometime in January I have to give a presentation and I know one of the > > questions will be. &qu

Re: [Tutor] OT GPL project finished, presentation looming

2006-12-08 Thread Dave S
On Thursday 07 December 2006 22:35, Alan Gauld wrote: > "Dave S" <[EMAIL PROTECTED]> wrote > > > They will be concerned about using my app because I am one person. > > What if I > > get hit by a bus ! what if I leave ? > > This is a common problem

Re: [Tutor] Opening a pdf on a certain page

2006-12-12 Thread Dave Kuhlman
use evince (on Linux) to read PDF docs. When I open a document the second time, evince automatically shows the last page I was viewing when I previously closed evince. And, the following command: $ evince -p 12 somedocument.pdf will open that document to page 12.

Re: [Tutor] Question about ConfigParser

2007-01-06 Thread Dave Kuhlman
note the restriction to string values in the docs on the set method: set(section, option, value) If the given section exists, set the given option to the specified value; otherwise raise NoSectionError. While it is possible to use RawConfigParser (or ConfigParser with raw parameters set to true) for internal storage of non-string values, full functionality (including interpolation and output to files) can only be achieved using string values. New in version 1.6. Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] 'root' dir of a package from within the package ?

2007-01-08 Thread Dave S
and its in XP. Any suggestions ? Dave ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] 'root' dir of a package from within the package ?

2007-01-12 Thread Dave S
On Tuesday 09 January 2007 10:55, Michael Lange wrote: > On Mon, 8 Jan 2007 19:24:37 + > > Dave S <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > I have written a python package, which works fine, the 'root' directory > > is 'my_ap

Re: [Tutor] Array indexing

2007-01-16 Thread Dave Kuhlman
are more than one statement on a line. And writing more than one statement on a line is usually discouraged anyway. > The "fix" I'm currently using is to write the index I want: > > (directoryTable[0], directoryTable[1]) Or, if you need an index variable: directoryTable[i], directoryTable[i+1]) Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] possible import locations

2007-01-17 Thread Dave Kuhlman
in your current directory, where it would only affect programs run from that directory. Which is recommended and when? Also, the .pth file thing seems to be a way to give a package, when it is installed, to hijack the import path by stuffing paths abov

Re: [Tutor] Perfect Python web stack?

2007-01-17 Thread Dave Kuhlman
seInterfaces http://www.python.org/doc/topics/database/ http://www.python.org/doc/topics/database/modules/ http://www.sqlalchemy.org/ http://www.sqlobject.org/ Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] pyw bug ?

2007-01-21 Thread Dave S
able. ... mmm ... windows mutter mutter Dave ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Best IDE for Python

2007-01-25 Thread Dave Kuhlman
rg/)? There is a plug-in for Python. But, on my machine, the last time I looked, it was buggy and incredibly slow. Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Best IDE for Python

2007-01-26 Thread Dave S
On Thursday 25 January 2007 03:12, Shadab Sayani wrote: > Hi, > I am using vim editor to code my project in python.Is there a good IDE > where in I type the name of the class object and then dot then all the > attributes of the object are displayed so on.I tried to install IDLE but I > have n

Re: [Tutor] site-packages and permissions to byte-compile

2007-01-29 Thread Dave Kuhlman
dules in a directory in which you *do* have write access and then add that directory to your PYTHONPATH. Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to make ftplib show progress while uploading a large file

2007-02-04 Thread Dave Kuhlman
it for wxPython. But, at least it gives you some scaffolding to start with. Note the "fancy" flag and variable, which is probably what you want, not too sure. Hope this helps. Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman #!/usr/bin/env python import sys, os import ftplib import getopt

Re: [Tutor] CRC calculation with python

2007-02-06 Thread Dave Kuhlman
ause at least a compilation warning. > > This looks like a snippet, not a complete CCITT CRC calculation. Also, see the crcmod module: http://crcmod.sourceforge.net/ But, the README that comes with crcmod recommends the md5 module in the Python standard library. Dave -- Dave Kuhlma

Re: [Tutor] Python for Sysadmins

2007-02-13 Thread Dave Kuhlman
o look at the table of contents. Also, it might be of help just to review the table of contents and the first paragraph of each chapter of a beginner's Python book. Alan's book, "Learn to program using Python" or "Learning Python" by Lutz would give you the topics you n

Re: [Tutor] Replying to the tutor-list

2007-02-14 Thread Dave Kuhlman
e on. I just checked. It looks like when I use the reply-to-list operation in mutt, the only recipient is [EMAIL PROTECTED] Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Accessing class attributes: use methods only?

2007-02-14 Thread Dave Kuhlman
ious; ...). I mean we are programmers, after all." OK. OK. Maybe I had too much coffee this morning. Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Replying to the tutor-list

2007-02-18 Thread Dave Kuhlman
procmail filter doesn't seem to pick up the list when it's cced. > But that's for me to sort out it :) Maybe a procmail rule something like this: :0: * ^(To|Cc):[EMAIL PROTECTED] tutor-python-folder Note the Cc. Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Main program confusion

2007-02-19 Thread Dave Kuhlman
in order to execute that sample code. Once you have found the run module, ... Step 2 -- Read the source in the run module. In particular, you are looking for a function named main. Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Embedding Python

2007-02-25 Thread Dave Kuhlman
or popen.popenx (x = 2,3, 4). See http://docs.python.org/lib/module-popen2.html. I'l let others on the list comment on whether this is dangerous. I suppose if all the code (that is compiled by SWIG) is under your control or if you trust your users, it might not be too dangerous. Dave --

Re: [Tutor] Embedding Python

2007-02-26 Thread Dave Kuhlman
On Sun, Feb 25, 2007 at 01:35:52PM -0800, Dj Gilcrease wrote: > On 2/25/07, Dave Kuhlman <[EMAIL PROTECTED]> wrote: > > If you have not already, you will want to look at SWIG > > (http://www.swig.org/). SWIG will generate C or C++ code from a > > header file contain

Re: [Tutor] how to send command line args to py script

2007-03-11 Thread Dave Kuhlman
standard library. optparse is newer and more powerful than getopt, but also seems a bit more complex. Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] skipping ahead within a loop

2007-03-15 Thread Dave Kuhlman
, but sometimes it helps to understand what is going on underneath, because the for statement and iterators are very general, powerful, and elegant features of Python. Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Making table

2007-03-19 Thread Dave Kuhlman
advance. Try ljust and rjust. They are string functions/methods and are described here: http://docs.python.org/lib/string-methods.html Something like the following might work for you: In [1]: value = 3.45678 In [2]: ("%0.3f" % value).rjust(10) Out[2]: ' 3.457'

[Tutor] My Python project - an update

2007-03-23 Thread Dave S
dit/commissioning function (still running my Python code as a back end) and apparently I am due some kind of company reward ... My thoughts on my first Python QT project ... would have been nice if I could have given it to the community ... wonder what they will pay me ? ... D

Re: [Tutor] My Python project - an update

2007-03-31 Thread Dave S
Very valid points, I was not aware that MD5 had been cracked :) Dave ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Talking between C++ & Python ?

2007-04-05 Thread Dave S
work and generates return CSV, Python exits back to C++. This would work but seems a bit messy. Any comments of suggestions on a better solution ? The data to & from the C++, Python code consists of fairly large tables of up to 80,000 items. Many thanks for your help in

Re: [Tutor] Talking between C++ & Python ?

2007-04-05 Thread Dave S
On Thursday 05 April 2007 18:54, Alan Gauld wrote: > "Dave S" <[EMAIL PROTECTED]> wrote > > > At the moment they are proposing using CSV files to communicate > > between the > > Python & C++, ie C++ GUI generates a CSV, calls Python back end, > > b

Re: [Tutor] Talking between C++ & Python ?

2007-04-06 Thread Dave S
so much out there but it does seem to be for remote apps. SQLite ? - just Googled it and it looks interesting. Licence seems OK too - these guys are allergic to the GPL - reportlab is BSD. That's another reason that they want their own GUI - QT4 on windows Thanks onc

[Tutor] Problems with ConfigParser set method

2008-03-08 Thread dave selby
on_start.py 1 99 [EMAIL PROTECTED]:/var/lib/kmotion/daemons$ ./daemon_start.py 1 99 [EMAIL PROTECTED]:/var/lib/kmotion/daemons$ The first call returns as expected, the second should return 99, 99 not 1, 99. On opening daemons.rc the 'number' option is not changed. Any ideas ? Cheers Da

[Tutor] signal trapping in a class instance

2008-03-15 Thread dave selby
e it ? Cheers Dave def signal_kill(self, signum, frame): """ On SIGKILL update journal_snap with a special #$86400 'no snapshot' string """ now_secs = time.strftime('%H') * 60 * 60 now_secs = time.strftime(&

Re: [Tutor] CSV file processing...

2008-03-20 Thread Dave Kuhlman
27;, 'Rating', 'Lemon', 'Bright yellow and tart', '5', 'Eggplant', 'Purple and shiny', '6', 'Tangerine', 'Succulent', '8'] Then process *that* list.

Re: [Tutor] append string

2008-03-22 Thread Dave Kuhlman
then follow Andreas's suggestion to use list append followed by string join. - Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Using split with a backslash

2008-04-02 Thread Dave Kuhlman
27;) See http://docs.python.org/ref/strings.html Another example: In [1]: a = 'abc\\def\\ghi' In [2]: len(a) Out[2]: 11 In [3]: a.split('\') File "", line 1 a.split(

<    2   3   4   5   6   7   8   9   10   11   >