Re: Seeking author of script which generated HTML pages from pictures of them

2007-05-29 Thread metaperl
I found him! http://programming.reddit.com/info/k9dx/comments -- http://mail.python.org/mailman/listinfo/python-list

Seeking author of script which generated HTML pages from pictures of them

2007-05-17 Thread metaperl
On reddit.com, many moons ago, I downloaded some code which generated a page using HTML tables from a picture of the page you wanted. However, I dont have any author information in the code and wanted to stay in touch which she/he... does anyone know who wrote this code below? # Box geometry. cla

Re: most complete xml package for Python?

2007-03-14 Thread metaperl
On Mar 14, 5:34 pm, "John Machin" <[EMAIL PROTECTED]> wrote: > > Given keywords like "Amara" and "Elementtree" and past history, it > looked to me like a troll of one kind trying to incite a troll of > another kind to pop out from under the bridge and chew on his > ankle :-) Well, I'm not a trol

most complete xml package for Python?

2007-03-13 Thread metaperl
Without even checking them all out, I'm thinking the Amara XML Toolkit must be the most feature-packed. The developers are readily available on IRC for support and they seem to make regular releases. As a meld3 user, I have been using ElementTree under the hood, but was dismayed to find out that y

Latest approach to controlling non-printable / multi-byte characters

2007-02-08 Thread metaperl
There is no end to the number of frantic pleas for help with characters in the realm beyond ASCII. However, in searching thru them, I do not see a workable approach to changing them into other things. I am dealing with a file and in my Emacs editor, I see "MASSACHUSETTS- AMHERST" ... in other wor

Re: Parsing HTML

2007-02-08 Thread metaperl
On Feb 8, 2:38 pm, "mtuller" <[EMAIL PROTECTED]> wrote: > I am trying to parse a webpage and extract information. BeautifulSoup is a great Python module for this purpose: http://www.crummy.com/software/BeautifulSoup/ Here's an article on screen scraping using it: http://iwiwdsmi.blogsp

Re: "flushing"/demanding generator contents - implications for injection of control

2007-02-06 Thread metaperl
On Feb 5, 3:08 pm, Jussi Salmela <[EMAIL PROTECTED]> wrote: > metaperl kirjoitti: > > > For this program: > > > def reverse(data): > > for index in range(len(data)-1, -1, -1): > > yield data[index] > > > r = reverse("golf") >

"flushing"/demanding generator contents - implications for injection of control

2007-02-05 Thread metaperl
For this program: def reverse(data): for index in range(len(data)-1, -1, -1): yield data[index] r = reverse("golf") for char in r: print char I'm wondering if the line: r = reverse("golf") "demands" the contents of the function reverse() all at once and if I must write for c

Re-thinking my if-thens - a software engineering question

2007-01-24 Thread metaperl
Ok, I have a module called textgen.py. The point of this module is to generate a csv file from an array of dictionaries. As I iterate through each dictionary, I "massage" the dictionary values before writing them out to csv. Now, for one dictionary entry, I have the following code: if

Re: PyMeld for html templates?

2007-01-19 Thread metaperl
Sean Schertell wrote: > > Of course I'm going to try them all but I wonder if anyone has any > thoughts on PyMeld as a template system for churning out general > websites? > meld3 evolved from pymeld. I use meld3 - http://plope.com/software/meld3/ this whole style of templating is known as push

ValueError from dict - some detail would be helpful

2007-01-11 Thread metaperl
File "/sw/lib/python2.5/csv.py", line 120, in _dict_to_list raise ValueError, "dict contains fields not in fieldnames" --- it would be nice if it said what field it was I know that I can do a set difference on the two myself, but since it know what wasn't there.. why not report it and save

Pythonic style involves lots of lightweight classes (for me)

2006-12-13 Thread metaperl
I find it arduous to type dictionary['key'] and also feel that any data I create for a program deserves to have its operations tied to it. As a result, I often create lots of lightweight classes. Here's a small example: vlc = '/Applications/VLC.app/Contents/MacOS/VLC' class song(object): def

Encapsulating conditional execution based on list membership - how do you do it?

2006-12-11 Thread metaperl
I have a series of scripts which retrieve files. None of these scripts should continue if the file to be retrieved already exists in the archive. Here is the code: if f in path(self.storage.archive).files('*'): print f, "exists in archive. Not continuing" sy

shell command needs whitespace characters escaped

2006-12-08 Thread metaperl
I downloaded a file which has a space in the filename. I want to run a shell unzip on it, but it fails in my current code: syscmd = "cd %s ; unzip %s" % (self.storage.input, file.basename()) os.system(syscmd) because no escaping was done. Is there a more principled way to constru

Re: Generating header information using ElementTree

2006-11-27 Thread metaperl
And dont forget that you can use triple quotes to get rid of all the quote-escaping you are using: $ python >>> """ ... ... ho ... ... """ '\n\nho\n\n' >>> Craig wrote: > John Machin wrote: > > > Craig wrote: > > > > > Great. Got that sorted. The problem I have now is that some of the > > >

os x make install dies when compiling zipfile.py on 2.5 and 2.4.4

2006-11-06 Thread metaperl
I've tried both Python 2.4.4 and Python 2.5. I'm trying to build from source and install under a local directory Swarm since OpenSwarm requires builds of Postgres and Python under it's control. Ok, so I did ./configure --prefix=/Users/tbrannon/Documents/Python/Swarm/Python-2.5 but during make in

Re: MemoDepot: build YOUR OWN online notes library - anything, anytime, anywhere

2006-11-06 Thread metaperl
I'll just use Plone, thanks. ompaniess wrote: > Just like everybody else nowadays, you are facing infinite amount of > information everyday. how can you keep those that truly matters to you? > MemoDepot allows you to do just that, and much more! > > - Capture any information, store as notes in you

Re: python GUIs comparison (want)

2006-11-06 Thread metaperl
[EMAIL PROTECTED] wrote: > Paul Boddie wrote: > > """The figures behind the scenes are quite enlightening for that > particular page. If you (or community experiences) don't agree with the > > rankings (wxPython apparently even easier to learn than PythonCard and > Tinder, a bunch of Gtk-based too

Re: HTML Templates (Sitemesh/Tiles concept) in Python

2006-10-24 Thread metaperl
Suren wrote: > It seems error prone as well as bad design to scatter this logic in > each content page. Is there a template logic like Sitemesh or Tiles > concept that can decorate a desired page just before show time? > Suren, you are looking for push-style templating. I list a number of alter

Re: Web Hosting

2006-10-16 Thread metaperl
Sir Psycho wrote: > Hi, > > With web hosting, does the ISP you chose have to support the framework > you work with as well? > > Im looking at making a site in Python, however, Im lost as to what ISPs > actually support. We support any and every thing Python and we are a not-for-profit cooperative

Re: Roundup Issue Tracker release 1.1.3

2006-10-04 Thread metaperl . etc
Richard Jones wrote: > I'm proud to release version 1.1.3 of Roundup. > five database back-ends (anydbm, sqlite, metakit, > mysql and postgresql). That ORM is pretty impressive: http://roundup.sourceforge.net/doc-1.0/design.html#roundup-database I like how easy it is to specify m-to-n relations.

Re: for: else: - any practical uses for the else clause?

2006-09-29 Thread metaperl
Actually right after posting this I came up with a great usage. I use meld3 for my Python based dynamic HTML generation. Whenever I plan to loop over a tree section I use a for loop, but if there is no data to iterate over, then I simply remove that section from the tree or populate it with a "no d

Re: startswith() and endswith() for re's would be more intuitive

2006-09-28 Thread metaperl
Bruno Desthuilliers wrote: > metaperl wrote: > > I just finished answering a question in #python because someone tried > > to match using ... well.. match() > > but did not realize that match() is actually startswith() for regexps. > > Yet someone else that failed

startswith() and endswith() for re's would be more intuitive

2006-09-28 Thread metaperl
I just finished answering a question in #python because someone tried to match using ... well.. match() but did not realize that match() is actually startswith() for regexps. I suggest: re.compile('blah').atstartof(string) re.compile('blah').atendof(string) But it will never happen. -- http://m

for: else: - any practical uses for the else clause?

2006-09-26 Thread metaperl . etc
A very old thread: http://groups.google.com/group/comp.lang.python/browse_frm/thread/2c5022e2b7f05525/1542d2041257c47e?lnk=gst&q=for+else&rnum=9#1542d2041257c47e discusses the optional "else:" clause of the for statement. I'm wondering if anyone has ever found a practical use for the else branch?

Finding the file referred to in a Python traceback

2006-09-26 Thread metaperl . etc
In this traceback, the path to 3 different SQL Alchemy source files is a relative directory. However, no such directory is below my current working directory. This is problematic for two reasons: 1 - I cannot use XEmacs find-file-at-point to find the file in which the error is occurring 2 - I am n

Re: Converting Perl Web Report to Python

2006-09-25 Thread metaperl
[EMAIL PROTECTED] wrote: > Thanks again Dennis, > This should do what I want with additional flexibility... I will > develop the code later this week. During this excersize, I have come > to really appreciate Python over Perl. I love the Python command line > interpreter that allowed me to pre

Re: One program in different GUI Toolkits

2006-09-25 Thread metaperl
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > > Actually due to lack of documentation and feedback from the mailing > > list, I am fallen out of love with Pythoncard and in love with > > Kiwi/Pygtk. Given the large groundswell support for pygtk, i dont think > > I will be disappointed. > > > >

Re: One program in different GUI Toolkits

2006-09-25 Thread metaperl
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > > Actually due to lack of documentation and feedback from the mailing > > list, I am fallen out of love with Pythoncard and in love with > > Kiwi/Pygtk. Given the large groundswell support for pygtk, i dont think > > I will be disappointed. > > > >

Leave the putdowns in the Perl community, the Python world does not need them

2006-09-25 Thread metaperl
I was shocked to see the personal insults hurled in this thread: http://groups.google.com/group/comp.lang.python/browse_thread/thread/d0758cb9545cad4b I have been very pleased with Python developers regardless of skill levels in both the IRC channel as well as here - no hot attitudes. No holier th

Re: One program in different GUI Toolkits

2006-09-24 Thread metaperl . etc
tools gives me an icky feeling. metaperl wrote: > Franz Steinhaeusler wrote: > > Hello NG, > > > > I have a suggestion. > > > > For simplifying learning or switching between different GUI > > Toolkits, I could imagine to have one short clearly presente

Re: One program in different GUI Toolkits

2006-09-24 Thread metaperl . etc
Franz Steinhaeusler wrote: > Hello NG, > > I have a suggestion. > > For simplifying learning or switching between different GUI > Toolkits, I could imagine to have one short clearly presented > program in different GUI Toolkits. > > What about for example wxProject? > > http://wiki.wxpython.org/in

Re: Application logging to screen and file - any favorite modules (no luck on cheeseshop)

2006-09-23 Thread metaperl
Bjoern Schliessmann wrote: > metaperl wrote: > > > Hello, I am looking for a module which has > > * log levels > > * output to stdout and file (either/or based on config) > > * nicely formatted log output (e.g., indentation when appropriate) > > Sorr

Re: One program in different GUI Toolkits

2006-09-23 Thread metaperl
Franz Steinhaeusler wrote: > Hello NG, > > I have a suggestion. > > For simplifying learning or switching between different GUI > Toolkits, I could imagine to have one short clearly presented > program in different GUI Toolkits. > > Anybody is interested in implementing in one other GUI? > We cou

Re: Application logging to screen and file - any favorite modules (no luck on cheeseshop)

2006-09-23 Thread metaperl
Robert Kern wrote: > metaperl wrote: > > Hello, I am looking for a module which has > > You should look in the standard library before hitting the Package Index. > > http://www.python.org/doc/current/lib/module-logging.html > Very nice module. Thanks for the pointer. --

Application logging to screen and file - any favorite modules (no luck on cheeseshop)

2006-09-22 Thread metaperl
Hello, I am looking for a module which has * log levels * output to stdout and file (either/or based on config) * nicely formatted log output (e.g., indentation when appropriate) I tried to use cheeseshop to find such a module, but came up short. I clicked on Browse Tree -> Software Development bu

Re: new string method in 2.5 (partition)

2006-09-19 Thread metaperl
sweet thanks for the heads up. John Salerno wrote: > Forgive my excitement, especially if you are already aware of this, but > this seems like the kind of feature that is easily overlooked (yet could > be very useful): > > > Both 8-bit and Unicode strings have new partition(sep) and > rpartition(s

Re: Converting a varargs tuple to a list - a definite pitfall for new comers to Python

2006-09-15 Thread metaperl
John Machin wrote: > [EMAIL PROTECTED] wrote: > > The following program does not work if you uncomment #lis = > > ["xmms2"] + list(args) > > > > Evidently Python is opting for the nullary constructor list() as > > opposed to the other one which takes a sequence. But no newcomer would know > >

Re: Converting a varargs tuple to a list - a definite pitfall for new comers to Python

2006-09-15 Thread metaperl
Georg Brandl wrote: > [EMAIL PROTECTED] wrote: > > The following program does not work if you uncomment #lis = > > ["xmms2"] + list(args) > > > > Evidently Python is opting for the nullary constructor list() as > > opposed to the other one which takes a sequence. But no newcomer would > > know

Converting a varargs tuple to a list - a definite pitfall for new comers to Python

2006-09-14 Thread metaperl . etc
The following program does not work if you uncomment #lis = ["xmms2"] + list(args) Evidently Python is opting for the nullary constructor list() as opposed to the other one which takes a sequence. But no newcomer would know this. And the Python docs dont give a good example of dealing with tak

Re: best small database?

2006-09-14 Thread metaperl
David Isaac wrote: > Thanks to all for the suggestions and much else > to think about. > > Summarizing: > > Those who were willing to consider a database suggested: > anydbm > Gadfly > SQLite (included with Python 2.5) > Schevo You missed buzhug: http://buzhug.sourceforge.net/ A very thorough pu

Re: Are Python's reserved words reserved in places they dont need to be?

2006-09-13 Thread metaperl
One way to avoid the issue I brought up is for the syntax to be very regular... like Lisp or Tcl: set class "algebra" (setq class "algebra") -- http://mail.python.org/mailman/listinfo/python-list

Re: Are Python's reserved words reserved in places they dont need to be?

2006-09-12 Thread metaperl
Istvan Albert wrote: > metaperl wrote: > > --> python -i > > >>> class = "algebra" > > File "", line 1 > > class = "algebra" > > ^ > > SyntaxError: invalid syntax > > Designing a syntax to avo

Re: Are Python's reserved words reserved in places they dont need to be?

2006-09-12 Thread metaperl
Diez B. Roggisch wrote: > metaperl schrieb: > > --> python -i > >>>> class = "algebra" > > File "", line 1 > > class = "algebra" > > ^ > > SyntaxError: invalid syntax > > > > >

Re: Are Python's reserved words reserved in places they dont need to be?

2006-09-12 Thread metaperl
Istvan Albert wrote: > metaperl wrote: > > --> python -i > > >>> class = "algebra" > > File "", line 1 > > class = "algebra" > > ^ > > SyntaxError: invalid syntax > > Designing a syntax to avo

Are Python's reserved words reserved in places they dont need to be?

2006-09-12 Thread metaperl
--> python -i >>> class = "algebra" File "", line 1 class = "algebra" ^ SyntaxError: invalid syntax >>> Why isn' t the parser smart enough to see that class followed by an identifier is used for class definition but class followed by equals is a simple assignment? Also, I had

Re: How to get the package, file, and line of a method/function invocant?

2006-09-12 Thread metaperl
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, metaperl wrote: > > > # Of course I could cheat and pass it, but I don't want to: > > > > directories = data.storage.logic(__file__) > > Why do you consider a plain and simple solution

Re: How to get the package, file, and line of a method/function invocant?

2006-09-12 Thread metaperl
Miki wrote: > > > I am looking for something like the caller() routine in Perl: > > >http://perldoc.perl.org/functions/caller.html > > > > Look at the inspect module in Python's standard library. > Or is you're feeling lazy, have a look at the "here" function found in > http://www.unixreview.c

Re: How to get the package, file, and line of a method/function invocant?

2006-09-12 Thread metaperl
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, metaperl wrote: > > > # Of course I could cheat and pass it, but I don't want to: > > > > directories = data.storage.logic(__file__) > > Why do you consider a plain and simple solut

A Comparison of Python Class Objects and Init Files for Program Configuration

2006-09-12 Thread metaperl
A Comparison of Python Class Objects and Init Files for Program Configuration = Terrence Brannon [EMAIL PROTECTED] http://www.livingcosmos.org/Members/sundevil/python/articles/a-comparison-of-python-class-objects-and-init-

How to get the package, file, and line of a method/function invocant?

2006-09-11 Thread metaperl
I am looking for something like the caller() routine in Perl: http://perldoc.perl.org/functions/caller.html I am writing a script which needs to be allocated an object containing a set of paths that it will use for reading and writing during it's execution: import os.path class logic: def

the first arg to super() must be a type, not a class obj?

2006-09-07 Thread metaperl
On p.282 of "Python Cookbook" and in the Python docs on calling super: http://www.python.org/download/releases/2.2.3/descrintro/#cooperation it is clear that the first argument to super is a class and not a type. However, for the code below, I am getting an error when attempting to provide a class

should urlparse return user and pass in separate components?

2006-09-07 Thread metaperl
The urlparse with Python 2.4.3 includes the user and pass in the site aspect of its parse: >>> scheme, site, path, parms, query, fid = >>> urlparse.urlparse("http://bill:[EMAIL PROTECTED]/lib/module-urlparse.html") >>> site 'bill:[EMAIL PROTECTED]' I personally would prefer that it be broken d

Re: OS X and Python - wxPython has forced a rehash of my approach

2006-09-04 Thread metaperl . etc
One other thing: the mac os x built at python.org (http://www.python.org/download/) does not state whether it is a Framework build or not. I'm guessing it isn't. -- http://mail.python.org/mailman/listinfo/python-list

OS X and Python - wxPython has forced a rehash of my approach

2006-09-04 Thread metaperl . etc
Earlier I asked about how people installed Python on OS X, given that one can choose from Xcode, Fink, Darwin, ActiveState and source builds: http://groups.google.com/group/comp.lang.python/browse_thread/thread/5c4cde4206d1fbb7/37de06a6bb6b2361?lnk=gst&q=OS+X+and+Python+-+what+is+your+install+stra

inheritance needed in program configuration - config module or python oo?

2006-09-02 Thread metaperl
Inheritance needed in app configuration = I have an ftp server that a number of vendors connect into to upload a file to their directory. In OO terms, we would have class OurFTP: server = "ftpserver.com" class Vendor1(OurFTP) user, pass, directory = ("blah","bla

Re: SQLObject or SQLAlchemy?

2006-08-31 Thread metaperl
John Salerno wrote: > Thanks for the reply. Do you mean in the above quote that SA is a little > more complicated than SO? Don't be afraid to download them and try their respective tutorials. Each one would take about an hour and then you'd have a feel for yourself. I agree with adam that SQLAl

Re: SQLObject or SQLAlchemy?

2006-08-31 Thread metaperl
John Salerno wrote: > Are there any major differences between these two? It seems they can > both be used with TurboGears, and SQLAlchemy with Django. I'm just > wondering what everyone's preference is, and why, and if there are even > more choices for ORM. I just finished surfing both websites l

Any relational database design tool written in Python

2006-08-31 Thread metaperl
Hello, I am wondering if I overlooked such a tool at freshmeat, sf.net, and cheeseshop and google. I prefer Python, so that I can patch and upgrade it. Which also means I prefer opensource over commercial. I am hoping for something that can create database deltas. I am sort of divided over the

Re: Best Practices for Python Script Development?

2006-08-30 Thread metaperl
Ant wrote: > > `Pydoc `_ seems to be > > built around modules and I want to document scripts. > > Any python script *is* a python module. So pydoc is what you are after > here. Yes, but Lundh's PythonDoc looks good too. I'm inclined to go with that.

Best Practices for Python Script Development?

2006-08-24 Thread metaperl
Hello, I am responsible for converting 30 loosey-goosey Perl scripts into 30 well-documented easy to understand and use Python scripts. No one has said anything in particular about how this should be done, but the end product should be "professional" looking. So, I'm looking for some books and su

OS X and Python - what is your install strategy?

2006-08-24 Thread metaperl
I'm about to get a new OS X box on which I will rewrite a bunch of data munging scripts from Perl to Python. I know that there are several port services for OS X (fink, darwin ports, opendarwin). So I am not sure whether to use their port of Python or whether to build from scratch or use the Python

Question on extracting doc strings from .py files

2006-08-16 Thread metaperl
If you type: >>> import os; help(os) Then you see the following (see below). But I don't understand where the line "MODULE DOCS http://www.python.org/doc/current/lib/module-os.html " is encoded in os.py anywhere. If you search for the words 'module-os.html' you find nothing. Ditto for 'MODULE

Re: idea on how to get/set nested python dictionary values

2006-08-16 Thread metaperl
[EMAIL PROTECTED] wrote: > | would use a recursive approach for this - given that you have a sort > of recursive datastructure: > > py> def SetNewDataParam2(Data, NewData): > ... if type(Data[Data.keys()[0]]) == type(dict()): > ... SetNewDataParam2(Data[Data.keys()[0]], NewData) > ...

Re: recommended general-purpose string template packages?

2006-08-16 Thread metaperl
vj wrote: > I use preppy from reportlab: > > http://www.reportlab.org/preppy.html wow. thanks for the link. I second you on pretty. It is ultra-simple and nothing but a gateway to python. also, reportlab makes a number of high-quality open source python wares. -- http://mail.python.org/mailman

trying to reach kevin smith, author of plastex

2006-08-15 Thread metaperl
Email to Kevin Smith regarding his plastex package failed. I hope he read this group. The tarball that he needs to reproduce the error is here: http://arc.livingcosmos.org/wolfram-fruit2/wolfram-fruit.tar.gz Hi, when attempting to type plastex wolfram-fruit.tex on the attached latex document, I go

Re: recommended general-purpose string template packages?

2006-08-14 Thread metaperl
John Machin wrote: > Hi, > > In general, I'm mainly interested in a template engine for dynamic web > pages but would like a general purpose one to avoid learning yet > another package for generating e-mail messages, form letters, source > code, whatever. HTMLTemplate and texttemplate offer a som

The decentralized nature of the Python community is driving me crazy

2006-08-09 Thread metaperl . bzr
hi everyone, I am the first of what may be hundreds of refugees from the Perl community. Not only is Python a more productive language, with many more nice apps, but the people are friendly as well... waaay more friendly than the Perl crowd. But I must say the one thing I miss about Perl is my ab

Looking for an intellisense with good help IDE for Python

2006-08-08 Thread metaperl
Hi, I would like an IDE that shows me all methods and functions I can call on a particular data item. For instance, iter() can be called on any sequence, but it is not a method. Nonetheless, I would like for something to show me every thing that I can call on a particular data item. This include

Re: Windows vs. Linux

2006-07-31 Thread metaperl
Andy Dingley wrote: > > Python is one of the best languages I've found for > platform-independence - significantly better than Perl. The reason I'm going with vmware is because I'm afraid that I will need to compile a C portiion of a Python module and that will not be a pretty picture under Wind