Re: Updating XML using XPath

2006-10-31 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Is there a way that I can update the attributes of an XML node and MAKE > IT PERSISTENT in the XML file through the Python XPath API? I tried the > setContent method of the Node but i am only able to update the node > variable not the file content itself. how about sav

Re: .pyc's

2006-10-31 Thread Chris
thanks [EMAIL PROTECTED] wrote: > You can try decompyle > > http://packages.debian.org/unstable/python/decompyle > > It works only until python version 2.3 though -- http://mail.python.org/mailman/listinfo/python-list

Re: 3d programming without opengl

2006-10-31 Thread Fredrik Lundh
Richard Jones wrote: >> Pure Python doesn't necessarily imply "no graphics drawing code written >> in some other language", though. You can get pretty far by using a 2D >> library for simple 3D rendering. > > Someone wrote a 3D demo for the pygame.draw challenge*. It worked but > unfortunately h

High level csv reader

2006-10-31 Thread George Sakkis
It occured to me that most times I read a csv file, I'm often doing from scratch things like assigning labels to columns, mapping fields to the appropriate type, ignoring some fields, changing their order, etc. Before I go on and reinvent the wheel, is there a generic high level wrapper around csv.

Re: Integrating Python with Fortran

2006-10-31 Thread Robert Kern
unexpected wrote: > Hi all, > > I'm currently working on a large, legacy Fortran application. I would > like to start new development in Python (as it is mainly I/O related). > In order to do so, however, the whole project needs to be able to > compile in Fortran. > > I'm aware of resources like

Re: Python and SSL enabled

2006-10-31 Thread Heikki Toivonen
matey wrote: > However, when I use the following command: python setup.py install > I get the following error: > > creating /usr/local/lib/python2.3/site-packages/M2Crypto > error: could not create > '/usr/local/lib/python2.3/site-packages/M2Crypto': Permission denied Ok, it looks like you M2Cryp

Re: Integrating Python with Fortran

2006-10-31 Thread MC
Hi! in afternoon: http://calcul.math.cnrs.fr/article.php3?id_article=150 -- @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Unescape HTML entities

2006-10-31 Thread Klaus Alexander Seistrup
Rares Vernica wrote: > How does your code deal with ' like entities? It doesn't, it deals with named entities only. But take a look at Fredrik's example. Cheers, -- Klaus Alexander Seistrup København, Danmark, EU http://klaus.seistrup.dk/ -- http://mail.python.org/mailman/listinfo/python-l

Re: best way to check if a file exists?

2006-10-31 Thread jim-on-linux
On Tuesday 31 October 2006 16:01, John Salerno wrote: > What is the best way to check if a file already > exists in the current directory? I saw > os.path.isfile(), but I'm not sure if that does > more than what I need. > > I just want to check if a file of a certain > name exists before the user

Re: unescape HTML entities

2006-10-31 Thread Rares Vernica
Hi, How does your code deal with ' like entities? Thanks, Ray Klaus Alexander Seistrup wrote: > Rares Vernica wrote: > >> How can I unescape HTML entities like " "? >> >> I know about xml.sax.saxutils.unescape() but it only deals with >> "&", "<", and ">". >> >> Also, I know about htmlentitydef

Updating XML using XPath

2006-10-31 Thread [EMAIL PROTECTED]
Hi All, Is there a way that I can update the attributes of an XML node and MAKE IT PERSISTENT in the XML file through the Python XPath API? I tried the setContent method of the Node but i am only able to update the node variable not the file content itself. Thanks, Sundar -- http://mail.python

Re: .pyc's

2006-10-31 Thread [EMAIL PROTECTED]
You can try decompyle http://packages.debian.org/unstable/python/decompyle It works only until python version 2.3 though -- http://mail.python.org/mailman/listinfo/python-list

.pyc's

2006-10-31 Thread Chris
I had some code that I wrote that I guess I deleted. But for whatever reason I still have the bytecode .pyc file for it. Is there a way to get the code I wrote back from this? -- http://mail.python.org/mailman/listinfo/python-list

.pycs

2006-10-31 Thread Chris
I had some code that I wrote that I guess I deleted. But for whatever reason I still have the bytecode .pyc file for it. Is there a way to get the code I wrote back from this? -- http://mail.python.org/mailman/listinfo/python-list

Re: Overriding traceback print_exc()?

2006-10-31 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > I usually have a function like this: > > def get_excinfo_str(): > """return exception stack trace as a string""" > (exc_type, exc_value, exc_traceback) = sys.exc_info() The parens here can be skipped: exc_type, exc_value, exc_traceback = sys.exc_info() >

Re: best way to check if a file exists?

2006-10-31 Thread Ben Finney
[EMAIL PROTECTED] writes: > On Oct 31, 4:01 pm, John Salerno <[EMAIL PROTECTED]> wrote: > > What is the best way to check if a file already exists in the > > current directory? I saw os.path.isfile(), but I'm not sure if > > that does more than what I need. I see that 'os.path.exists' has already

Re: report progress from C function

2006-10-31 Thread Michael S
> BTW, why did you rewrite in C rarher than using > Pyrex? I was not aware of pyrex. I didn't really mind doing some C, it made me remember the syntax. Thanks a lot. I did think that I could pack a function address as a parameter. --- John Machin <[EMAIL PROTECTED]> wrote: > Michael S wrote: > >

[ANN] serpia.org needs more tutorials

2006-10-31 Thread dimitri pater
Hi,for almost a year now I have been running my serpia.org website. This website is dedicated to Python stuff. I figured that it would be a good idea to share some experiences while learning the language and that is why I started this website. Maybe some of you share this idea and would like to con

Re: import in threads: crashes & strange exceptions on dual core machines

2006-10-31 Thread Steve Holden
Klaas wrote: > robert wrote: > >>Klaas wrote: >> >>>It seems clear that the import lock does not include fully-executing >>>the module contents. To fix this, just import cookielib before the >> >>What is the exact meaning of "not include fully-executing" - regarding the >>examples "import cookie

Re: best way to check if a file exists?

2006-10-31 Thread georgeryoung
On Oct 31, 4:01 pm, John Salerno <[EMAIL PROTECTED]> wrote: > What is the best way to check if a file already exists in the current > directory? I saw os.path.isfile(), but I'm not sure if that does more > than what I need. > > I just want to check if a file of a certain name exists before the user

Re: "best" rational number library for Python?

2006-10-31 Thread Gabriel G
At Tuesday 31/10/2006 21:16, [EMAIL PROTECTED] wrote: casevh> You must use "gmake". "make" fails during "make check" Very weird: piggy:% make -v GNU Make 3.80 piggy:% gmake -v GNU Make 3.80 Nevertheless, using "gmake" instead of "make" did indeed work. Thanks for the hint

Re: "best" rational number library for Python?

2006-10-31 Thread skip
>> I just compiled GMP 4.2.1 on a P4 using >> >> $ CFLAGS="" CC=gcc ./configure >> $ gmake; gmake check >> casevh> You must use "gmake". "make" fails during "make check" Very weird: piggy:% make -v GNU Make 3.80 Copyright (C) 2002 Free Software Foundation,

Re: wxPython TextCtrl - weird scrolling behavior

2006-10-31 Thread Ed Leafe
On Oct 31, 2006, at 3:22 PM, John Salerno wrote: > After I watched the screencasts for how Dabo uses sizers, I really > understood them a lot better. I've never used Dabo itself for GUI > design, but the screencast, though it shows them in terms of that > program, still gives a great visual presen

Re: What is the cleanest way to for a module to access objects from the script that imports it?

2006-10-31 Thread Fuzzyman
[EMAIL PROTECTED] wrote: > Hi, > > I am new to python and am currently writing my first application. One > of the problems I quickly ran into, however, is that python's imports > are very different from php/C++ includes in the sense that they > completely wrap the imported script in a module objec

Re: import in threads: crashes & strange exceptions on dual core machines

2006-10-31 Thread Klaas
robert wrote: > Klaas wrote: > > It seems clear that the import lock does not include fully-executing > > the module contents. To fix this, just import cookielib before the > > What is the exact meaning of "not include fully-executing" - regarding the > examples "import cookielib" ? > Do you real

Re: report progress from C function

2006-10-31 Thread John Machin
Michael S wrote: > Good day all. > > I rewrote part of my program in C, it's a usually a > long task. I wanted to be able to report the progress > back to my python program. In my module (in addition > to the function that performs the above-mentioned > task) there is a function that returns the v

Re: scared about refrences...

2006-10-31 Thread Bruno Desthuilliers
Nick Vatamaniuc a écrit : (snip) > In Python all the primitives are copied and all other entities are > references. Plain wrong. There's no "primitives" (ie : primitive data types) in Python, only objects. And they all get passed the same way. -- http://mail.python.org/mailman/listinfo/python-l

Re: "best" rational number library for Python?

2006-10-31 Thread casevh
Oops, on the double-post. [EMAIL PROTECTED] wrote: > > A guy at work asked for functionality commonly found with rational numbers, > > so I said I'd find and install something. I figured gmpy would be suitable, > > alas I'm having trouble successfully building the underlying GMP 4.2.1 > > library

Re: Python 123 introduction

2006-10-31 Thread Bruno Desthuilliers
Jeremy Sanders a écrit : > Here is a brief simple introduction to Python I wrote for a computing course > for graduate astronomers. It assumes some programming experience. Although > it is not a complete guide, I believe this could be a useful document for > other groups to learn Python, so I'm mak

Re: 3d programming without opengl

2006-10-31 Thread Richard Jones
Fredrik Lundh wrote: > Grant Edwards wrote: > >> Oy. A pure Python solution would probably be _really_ slow. > > Pure Python doesn't necessarily imply "no graphics drawing code written > in some other language", though. You can get pretty far by using a 2D > library for simple 3D rendering. So

Re: "best" rational number library for Python?

2006-10-31 Thread casevh
> A guy at work asked for functionality commonly found with rational numbers, > so I said I'd find and install something. I figured gmpy would be suitable, > alas I'm having trouble successfully building the underlying GMP 4.2.1 > library on a PC running Solaris 10 (won't compile with the default

Re: "best" rational number library for Python?

2006-10-31 Thread casevh
> A guy at work asked for functionality commonly found with rational numbers, > so I said I'd find and install something. I figured gmpy would be suitable, > alas I'm having trouble successfully building the underlying GMP 4.2.1 > library on a PC running Solaris 10 (won't compile with the default

report progress from C function

2006-10-31 Thread Michael S
Good day all. I rewrote part of my program in C, it's a usually a long task. I wanted to be able to report the progress back to my python program. In my module (in addition to the function that performs the above-mentioned task) there is a function that returns the variable, indicating the progre

Re: Python tools for managing static websites?

2006-10-31 Thread Carl Banks
Chris Pearl wrote: > Are there Python tools to help webmasters manage static websites? > > I'm talking about regenerating an entire static website - all the HTML > files in their appropriate directories and sub-directories. Each page > has some fixed parts (navigation menu, header, footer) and some

Re: best way to check if a file exists?

2006-10-31 Thread Michael S
If you want to open the file for writing just open it with append mode. open(¨filename", "a"). If it doesn't exist - it'll create it, and if it does it'll start appending to the file For reading - os.path.exists("filename"). Or (doesn't make much sense, but still) try to open it for reading and p

Re: Ctypes Error: Why can't it find the DLL.

2006-10-31 Thread Bruno Desthuilliers
Mudcat a écrit : > That was it. Once I added the other DLLs then it was able to find and > make the call. > > Thanks for all the help, I just googled for "WindowsError: [Errno 126]" and followed the links, you know... -- http://mail.python.org/mailman/listinfo/python-list

Re: Integrating Python with Fortran

2006-10-31 Thread Martin v. Löwis
unexpected schrieb: > I'm aware of resources like the F2Py Interface generator, but this only > lets me access the Fortran modules I need in Python. I'm wondering if > there's a way to generate the .o files from Python (maybe using > py2exe?) and then link the .o file with the rest of the Fortran p

Re: best way to check if a file exists?

2006-10-31 Thread Gabriel Genellina
At Tuesday 31/10/2006 18:01, John Salerno wrote: What is the best way to check if a file already exists in the current directory? I saw os.path.isfile(), but I'm not sure if that does more than what I need. os.access(full_filename, os.F_OK) http://docs.python.org/lib/os-file-dir.html I just

Integrating Python with Fortran

2006-10-31 Thread unexpected
Hi all, I'm currently working on a large, legacy Fortran application. I would like to start new development in Python (as it is mainly I/O related). In order to do so, however, the whole project needs to be able to compile in Fortran. I'm aware of resources like the F2Py Interface generator, but

Re: best way to check if a file exists?

2006-10-31 Thread utabintarbo
John Salerno wrote: > What is the best way to check if a file already exists in the current > directory? I saw os.path.isfile(), but I'm not sure if that does more > than what I need. > > I just want to check if a file of a certain name exists before the user > creates a new file of that name. >

best way to check if a file exists?

2006-10-31 Thread John Salerno
What is the best way to check if a file already exists in the current directory? I saw os.path.isfile(), but I'm not sure if that does more than what I need. I just want to check if a file of a certain name exists before the user creates a new file of that name. Thanks. -- http://mail.python.

Re: Python and SSL enabled

2006-10-31 Thread matey
Problem: I want to be able to access an HTTPS website read/write commands to this website. >From reading this group it appears I need M2Crypto and OpenSSL Current version of Python 2.3.4 I downloaded: M2Crypto 0.16 OpenSSL 0.9.7k SWIG 1.3.29 Compiled OpenSSL libraries are located in /home/mmed

Re: Overriding traceback print_exc()?

2006-10-31 Thread [EMAIL PROTECTED]
I usually have a function like this: def get_excinfo_str(): """return exception stack trace as a string""" (exc_type, exc_value, exc_traceback) = sys.exc_info() formatted_excinfo = traceback.format_exception(exc_type, exc_value, exc_traceback) excinfo_str = "".join(formatted_excin

Re: Overriding traceback print_exc()?

2006-10-31 Thread Ziga Seilnacht
Bob Greschke wrote: > I want to cause any traceback output from my applications to show up in one > of my dialog boxes, instead of in the command or terminal window (between > running on Solaris, Linux, OSX and Windows systems there might not be any > command window or terminal window to show the t

Re: Why can't you assign to a list in a loop without enumerate?

2006-10-31 Thread Bruno Desthuilliers
Danny Colligan wrote: > In the following code snippet, I attempt to assign 10 to every index in > the list a and fail because when I try to assign number to 10, number > is a deep copy of the ith index (is this statement correct?). It's quite easy to find out: class Foo(object): def __init__(

Re: Why can't you assign to a list in a loop without enumerate?

2006-10-31 Thread Danny Colligan
I see. Thanks for the helpful response. Danny Duncan Booth wrote: > "Danny Colligan" <[EMAIL PROTECTED]> wrote: > > > In the following code snippet, I attempt to assign 10 to every index in > > the list a and fail because when I try to assign number to 10, number > > is a deep copy of the ith in

Re: Why can't you assign to a list in a loop without enumerate?

2006-10-31 Thread Tim Chase
> In the following code snippet, I attempt to assign 10 to every index in > the list a and fail because when I try to assign number to 10, number > is a deep copy of the ith index (is this statement correct?). Sorta...just like with function parameters, there are mutables and immutables. a

Re: scared about refrences...

2006-10-31 Thread Steve Holden
SpreadTooThin wrote: [...] > I don't understand why python would insist that everything must be a > refrence... We can tell that :) > It is of course helpful sometime but other times its not... and now > I'm sorta out > of luck... There are very good reasons for Python's namespace model. Sure i

Re: Missing _init_types in MS VisualStudio 2005 (PCBuild8)

2006-10-31 Thread Martin v. Löwis
Donovan Kolbly schrieb: > I was trying to build Python using MS VisualStudio 2005 (VC++ 8.0) > according to the instructions in PCBuild8/ and got a link error > in config.obj referencing _init_types. That's a known bug, and has been fixed in the subversion repository since. > I (barely) know enou

Re: "best" rational number library for Python?

2006-10-31 Thread skip
Gabriel> Try clnum included in: Gabriel> http://sourceforge.net/projects/calcrpnpy I tried that as well before trying GMP. It (the base clnum library) complained about the absence of GMP during configure and failed to compile. Skip -- http://mail.python.org/mailman/listinfo/python-lis

Re: 3d programming without opengl

2006-10-31 Thread Fredrik Lundh
Grant Edwards wrote: > Oy. A pure Python solution would probably be _really_ slow. Pure Python doesn't necessarily imply "no graphics drawing code written in some other language", though. You can get pretty far by using a 2D library for simple 3D rendering. -- http://mail.python.org/mailm

Re: Overriding traceback print_exc()?

2006-10-31 Thread [EMAIL PROTECTED]
You could always override sys.stderr with a instance of your own with a write() method. Though you will still have to catch the exceptions. Bob Greschke wrote: > I want to cause any traceback output from my applications to show up in one > of my dialog boxes, instead of in the command or terminal

Re: Why can't you assign to a list in a loop without enumerate?

2006-10-31 Thread [EMAIL PROTECTED]
I'm not quite sure what your asking, but I'll give it a shot. You do not have to use enumerate, you can use other methods just as range(len(sequence)), but the reason you cannot asign a value is because a for loop iterates a sequence meaning when you do for a in [1, 2, 3, 4, 5]: ... a is just

Re: Overriding traceback print_exc()?

2006-10-31 Thread Fredrik Lundh
Bob Greschke wrote: > I want to cause any traceback output from my applications to show up in one > of my dialog boxes, instead of in the command or terminal window (between > running on Solaris, Linux, OSX and Windows systems there might not be any > command window or terminal window to show t

Re: Why can't you assign to a list in a loop without enumerate?

2006-10-31 Thread Duncan Booth
"Danny Colligan" <[EMAIL PROTECTED]> wrote: > In the following code snippet, I attempt to assign 10 to every index in > the list a and fail because when I try to assign number to 10, number > is a deep copy of the ith index (is this statement correct?). No. There is no copying involved. Before t

Re: 3d programming without opengl

2006-10-31 Thread Grant Edwards
On 2006-10-31, nelson - <[EMAIL PROTECTED]> wrote: >i want to build up a simple 3d interactive geometry application in > python. Since i want to run it without 3D acceleration (a scene will > be quite simple) If you just want slow, it's probably easier to use OpenGL and just put calls to time

Re: "best" rational number library for Python?

2006-10-31 Thread Gabriel Genellina
At Tuesday 31/10/2006 14:53, [EMAIL PROTECTED] wrote: A guy at work asked for functionality commonly found with rational numbers, so I said I'd find and install something. I figured gmpy would be suitable, alas I'm having trouble successfully building the underlying GMP 4.2.1 library on a PC ru

Re: Why can't you assign to a list in a loop without enumerate?

2006-10-31 Thread Fredrik Lundh
Danny Colligan wrote: > My question is, what was the motivation for returning a deep copy of > the value at the ith index inside a for loop instead of the value > itself? I'm not sure the words "deep copy" and "value" really means what you think they do. maybe you should spend a little time wi

Re: FreeImagePy creating thumbnails from TIFF

2006-10-31 Thread Michele Petrazzo
[EMAIL PROTECTED] wrote: > I a trying to create a series of thumbnail images from a multpage > TIFF file. The sample code is below. When it executes, we get the > following error; FreeImagePy.constants.FreeImagePy_ColorWrong: 'Wrong > color 1 in function: FreeImage_MakeThumbnail. I can use: (8

Re: scared about refrences...

2006-10-31 Thread Fredrik Lundh
SpreadTooThin wrote: > Every time I pass a variable now I will worry that it will be changed > by the function... why? who's writing those scary functions that you cannot trust? and what makes you think they won't abuse any immutable data you give them? -- http://mail.python.org/mailman/li

Why can't you assign to a list in a loop without enumerate?

2006-10-31 Thread Danny Colligan
In the following code snippet, I attempt to assign 10 to every index in the list a and fail because when I try to assign number to 10, number is a deep copy of the ith index (is this statement correct?). >>> a = [1,2,3,4,5] >>> for number in a: ... number = 10 ... >>> a [1, 2, 3, 4, 5] So, I

Re: scared about refrences...

2006-10-31 Thread Gabriel Genellina
At Tuesday 31/10/2006 14:16, SpreadTooThin wrote: I don't understand why python would insist that everything must be a refrence... It is of course helpful sometime but other times its not... and now I'm sorta out of luck... I don't know how to make this structure immutable... Pickle it? Seems

Overriding traceback print_exc()?

2006-10-31 Thread Bob Greschke
I want to cause any traceback output from my applications to show up in one of my dialog boxes, instead of in the command or terminal window (between running on Solaris, Linux, OSX and Windows systems there might not be any command window or terminal window to show the traceback messages in). D

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-31 Thread Bjoern Schliessmann
Fredrik Lundh wrote: > by running the database queries in one or more separate threads, > you can still serve requests that don't hit the database (either > because they're entirely self-contained, or because they only rely > on cached data). Nothing that couldn't also be solved without threads.

Re: "best" rational number library for Python?

2006-10-31 Thread skip
Paul> There are certainly some of those around, but I'm surprised Paul> there's a problem with GMP and Solaris. That was my thought as well. Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: "best" rational number library for Python?

2006-10-31 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Performance is, for now, certainly not an issue. Even a pure Python > rational number class would probably suffice. There are certainly some of those around, but I'm surprised there's a problem with GMP and Solaris. -- http://mail.python.org/mailman/listinfo/python-li

Missing _init_types in MS VisualStudio 2005 (PCBuild8)

2006-10-31 Thread Donovan Kolbly
Hi folks, I was trying to build Python using MS VisualStudio 2005 (VC++ 8.0) according to the instructions in PCBuild8/ and got a link error in config.obj referencing _init_types. I (barely) know enough about VS 2005 to add files to the project, so I added Modules/_typesmodule.c to the pythoncore

"best" rational number library for Python?

2006-10-31 Thread skip
A guy at work asked for functionality commonly found with rational numbers, so I said I'd find and install something. I figured gmpy would be suitable, alas I'm having trouble successfully building the underlying GMP 4.2.1 library on a PC running Solaris 10 (won't compile with the default --host,

Re: Where do nested functions live?

2006-10-31 Thread Frederic Rentsch
Rob Williscroft wrote: > Frederic Rentsch wrote in news:mailman.1536.1162292996.11739.python- > [EMAIL PROTECTED] in comp.lang.python: > > >> Rob Williscroft wrote: >> >>> Frederic Rentsch wrote in news:mailman.1428.1162113628.11739.python- >>> [EMAIL PROTECTED] in comp.lang.python: >>> >>>

Re: 3d programming without opengl

2006-10-31 Thread Stephen Eilert
nelson - wrote: > hi! >i want to build up a simple 3d interactive geometry application in > python. Since i want to run it without 3D acceleration (a scene will > be quite simple) I was wondering if there was a library in python that > allow me to build 3D graphic without the need to use OpenG

Re: Python tools for managing static websites?

2006-10-31 Thread Harry George
Walter Dörwald <[EMAIL PROTECTED]> writes: > Chris Pearl wrote: > > > Are there Python tools to help webmasters manage static websites? > > > > [...] > > You might give XIST a try: http://www.livinglogic.de/Python/xist/ > > Basically XIST is an HTML generator, that can be extended to generate

Re: ANN: Leo 4.4.2.1 final released

2006-10-31 Thread John Henry
Yes, it's Python 2.3, running under Windows XP. I managed to get it working using the ZIP file. Thanks, Edward K. Ream wrote: > >I downloaded the Windows exe, ran it and a small blank message window poped > >up and that was it. > > I am still running 2.3. > > I assume you mean Python 2.3, not Le

Re: ANN: Leo 4.4.2.1 final released

2006-10-31 Thread John Henry
Yes, it's Python 2.3, running under Windows XP. I managed to get it working using the ZIP file. Thanks, Edward K. Ream wrote: > >I downloaded the Windows exe, ran it and a small blank message window poped > >up and that was it. > > I am still running 2.3. > > I assume you mean Python 2.3, not Le

Re: enumerate improvement proposal

2006-10-31 Thread Raymond Hettinger
James Stroud wrote: > I think that it would be handy for enumerate to behave as such: > > def enumerate(itrbl, start=0, step=1): >i = start >for it in itrbl: > yield (i, it) > i += step I proposed something like this long ago and Guido has already rejected it. Part of the reason

Re: scared about refrences...

2006-10-31 Thread Tim Chase
> I don't know how to make this structure immutable... Pickle > it? Seems very inefficient to me... Well, classes can be made mostly immutable by intercepting the attempts to write to it...something like class Foo(object): def __setattr__( self, name, val ): raise TypeError("I'm

Re: Python tools for managing static websites?

2006-10-31 Thread jkn
Hi there I used cheetah (cheetahtemplate) and a makefile for something similar ;-). It worked pretty well for me. I only have a dozen or so pages though. I'm currently converting this to Jinja, which is a similar templating system compatible with Django. I plan to later migrate to dynamic pages u

Re: scared about refrences...

2006-10-31 Thread SpreadTooThin
J. Clifford Dyer wrote: > SpreadTooThin wrote: > > J. Clifford Dyer wrote: > >> SpreadTooThin wrote: > >>> Steven D'Aprano wrote: > On Mon, 30 Oct 2006 13:10:47 -0800, SpreadTooThin wrote: > > > >>> I seems that some of the objects in the list don't get along well with > >>> deep co

Re: PIL on Python 2.4 - ImportError: No module named _imagingft

2006-10-31 Thread Fredrik Lundh
Nico Grubert wrote: > I have installed Python 2.4.3. and PIL 1.1.5. on a Suse Linux 10 64 Bit > machine. > > If I try > > >>> import _imagingft > > I get this error: >ImportError: No module named _imagingft > > Did I miss something? installed how? _imagingft is an optional component,

Re: Help me understand this iterator

2006-10-31 Thread LaundroMat
On Oct 31, 3:53 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > LaundroMat wrote: > > That 'magic index' variable bugs me a little however. It gives me the > > same feeling as when I see hard-coded variables.what magic index? the > > variable named "index" is an argument to the > method it's used

Re: Python tools for managing static websites?

2006-10-31 Thread Fuzzyman
Chris Pearl wrote: > Are there Python tools to help webmasters manage static websites? > rest2web is a tool designed specifically for creating and managing static websites. It uses templates and has built-in tools to aid with creating side bars and navigation trails. It allows you to store your

PIL on Python 2.4 - ImportError: No module named _imagingft

2006-10-31 Thread Nico Grubert
Dear list members, I have installed Python 2.4.3. and PIL 1.1.5. on a Suse Linux 10 64 Bit machine. If I try >>> import _imagingft I get this error: ImportError: No module named _imagingft Did I miss something? On my 32 But Linux with Python 2.3.5. everything works fine. Kind regards, N

Re: What is the cleanest way to for a module to access objects from the script that imports it?

2006-10-31 Thread Michael L Torrie
On Fri, 2006-10-27 at 14:53 -0700, [EMAIL PROTECTED] wrote: > Hi, > > I am new to python and am currently writing my first application. One > of the problems I quickly ran into, however, is that python's imports > are very different from php/C++ includes in the sense that they > completely wrap th

Re: wxPython TextCtrl - weird scrolling behavior

2006-10-31 Thread John Salerno
abcd wrote: > On Oct 30, 3:47 pm, John Salerno <[EMAIL PROTECTED]> wrote: >> I noticed that one object you refer to is >> self.textPane, is that supposed to be self.textPanel? > > no, self.textPane is the actual wx.TextCtrl. > > I used a GUI Builder to the layout stuff...perhaps that's my problem

Re: PIL on Python 2.4 - ImportError: No module named _imagingft [Solved]

2006-10-31 Thread Nico Grubert
> If I try > > >>> import _imagingft > > I get this error: > ImportError: No module named _imagingft > > Did I miss something? Yes, I did. Somehow, there was no "_imagingft.so" in the PIL directory. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python tools for managing static websites?

2006-10-31 Thread Paul Boddie
Walter Dörwald skrev: > Chris Pearl wrote: > > > Are there Python tools to help webmasters manage static websites? > > You might give XIST a try: http://www.livinglogic.de/Python/xist/ See also the list on the python.org Wiki: http://wiki.python.org/moin/Templating The "Static Website Generators

Re: Help me understand this iterator

2006-10-31 Thread Fredrik Lundh
LaundroMat wrote: > That 'magic index' variable bugs me a little however. It gives me the > same feeling as when I see hard-coded variables. what magic index? the variable named "index" is an argument to the method it's used in. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter Listbox string formatting question - how to kill adancingsnake ?

2006-10-31 Thread Hendrik van Rooyen
"Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > > instead of trying to force the listbox to behave like a multicolumn > > widget, maybe you could switch to another widget? some alternatives include > > > > a Text widget (you have to roll your

Re: Python tools for managing static websites?

2006-10-31 Thread Walter Dörwald
Chris Pearl wrote: > Are there Python tools to help webmasters manage static websites? > > [...] You might give XIST a try: http://www.livinglogic.de/Python/xist/ Basically XIST is an HTML generator, that can be extended to generate the HTML you need for your site. The website http://www.living

Re: Help me understand this iterator

2006-10-31 Thread LaundroMat
Thanks all, those were some great explanations. It seems I have still still a long way for me to go before I grasp the intricacies of this language. That 'magic index' variable bugs me a little however. It gives me the same feeling as when I see hard-coded variables. I suppose the generator class

Re: 3d programming without opengl

2006-10-31 Thread Paul McGuire
"nelson -" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi paul, > i look at slut and it seem very good... Can i embed it into a > wxpython application? > > thanks, > nelson I've no earthly idea, nelson, sorry. The sphere program is the extent of my slut experience (for which m

Re: Tkinter Listbox string formatting question - how to kill a dancingsnake ?

2006-10-31 Thread Hendrik van Rooyen
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > instead of trying to force the listbox to behave like a multicolumn > widget, maybe you could switch to another widget? some alternatives include > > a Text widget (you have to roll your own selection logic) I _really_ don't feel strong enough

Re: Help me understand this iterator

2006-10-31 Thread LaundroMat
Ack, I get it now. It's not the variable's name ("index") that is hard-coded, it's just that the for...in... loop sends an argument by default. That's a lot more comforting. -- http://mail.python.org/mailman/listinfo/python-list

Re: 3d programming without opengl

2006-10-31 Thread Paul McGuire
"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Looks like c.l.py just slashdotted you ... """The GeoCities web site you > were trying to view has temporarily exceeded its data transfer limit. > Please try again later.""" > > regards > Steve > -- > Steve Holden

Re: Event driven server that wastes CPU when threaded doesn't

2006-10-31 Thread Jean-Paul Calderone
On Tue, 31 Oct 2006 07:33:59 GMT, Bryan Olson <[EMAIL PROTECTED]> wrote: >Snor wrote: >> I'm attempting to create a lobby & game server for a multiplayer game, >> and have hit a problem early on with the server design. I am stuck >> between using a threaded server, and using an event driven server.

Re: concatenating numpy arrays

2006-10-31 Thread Travis E. Oliphant
Rolf Wester wrote: > Hi, > > I want to concatenate two numpy arrays with shape (n1,n2) and (n1,n3) > into a single array with shape (n1,n2+n3). I guess there is an elegant > way to do this but I couldn't figure it out. So any help is very much > appreciated. > Suppose a1.shape is (n1,n2) and

Re: Printing out the objects stack

2006-10-31 Thread Fabiano Sidler
On Sunday 29 October 2006 17:48, I wrote: > Now the following things are not clear to me: > -Why does the VM crash? Did I use the wrong stack boundaries? > -Why are no locales printed? > -Why is the function "stack" not right before or after "foo" > on the stack? When I disassemble the code of f w

Re: Python tools for managing static websites?

2006-10-31 Thread UrsusMaximus
Firedrop2 is a content management system for static web sites. I have used it to manage www.awaretek.com for 3-4 yearts now. it is perfect for what you descibe. You can mkae a change in format and apply it to all pages in a flash. It is very stable, and it is easy to use. It is written in Python, a

Re: How can I import a script with an arbitrary name ?

2006-10-31 Thread Fredrik Lundh
Steven D'Aprano wrote: > I'm not arguing, you could very well be right, but I'm just curious what > part of the OP's post led you to believe he needed to specify an absolute > filename. Unless I'm missing a second post, he certainly never suggested > that his scripts weren't in the Python path, or

Re: How can I import a script with an arbitrary name ?

2006-10-31 Thread Steven D'Aprano
On Tue, 31 Oct 2006 22:53:56 +1100, Ben Finney wrote: > "Steven D'Aprano" <[EMAIL PROTECTED]> writes: > >> On Tue, 31 Oct 2006 11:00:52 +1100, Ben Finney wrote: >> >> > If you want a solution that gives you an actual module object, >> > here's what I use: >> > >> > def make_module_from_file(

Re: How can I import a script with an arbitrary name ?

2006-10-31 Thread Steven D'Aprano
On Tue, 31 Oct 2006 12:44:50 +0100, Fredrik Lundh wrote: > Steven D'Aprano wrote: > >> The only advantage (or maybe it is a disadvantage?) I can see to your >> function is that it doesn't search the Python path and you can specify an >> absolute file name. > > that's the whole point of doing an

  1   2   >