Re: 3d programming without opengl

2006-10-31 Thread Paul McGuire
"nelson -" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 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 > allo

Re: Python windows interactive.

2006-10-31 Thread Fredrik Lundh
notejam wrote: > Can not figure out how to write more than one line in interpreter mode. press return between the lines. if you get a "..." prompt, keep adding more lines to the current statement. press return an extra time to end the multiline-statement. > Is that all interpreter is good for

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

2006-10-31 Thread Fredrik Lundh
Hendrik van Rooyen wrote: > Is there a way to format this so it will line up with *any* font ? > > I would prefer not to give up and use a fixed width font - it looks so > teletypish... sounds like contradicting requirements to me. instead of trying to force the listbox to behave like a multi

Re: create global variables?

2006-10-31 Thread Steve Holden
[EMAIL PROTECTED] wrote: > > J. Clifford Dyer wrote: > >>Alistair King wrote: [... advice and help ...] > this worked a treat: > > def monoVarcalc(atom): > >a = atom + 'aa' >Xaa = a.strip('\'') >m = atom + 'ma' >Xma = m.strip('\'') >Xaa = DS1v.get(atom) >Xma = pt.get(a

Re: Cann't connect zope server

2006-10-31 Thread Bruno Desthuilliers
steve wrote: > Can I ask question about zope here? Unless it has more to do with Python than with Zope itself, you'd better ask on Zope's mailing-list. > I started Zserver but could not connect to it using firefox.The runzope > gave message: > > /usr/bin/zope/instance/bin/runzope -X debug-mode=o

Re: scared about refrences...

2006-10-31 Thread Peter Otten
J. Clifford Dyer wrote: > Thanks, that's very helpful.  Playing with your code a bit, I narrowed > the problem down to the array.array() structure.  Looking at > help(array), there's a method defined called __deepcopy__, which, it > seems, takes no arguments, while deepcopy is passing it one argum

Re: 3d programming without opengl

2006-10-31 Thread Paul McGuire
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "nelson -" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> 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 w

Re: 3d programming without opengl

2006-10-31 Thread Steve Holden
Paul McGuire wrote: > "nelson -" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>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 li

Re: create global variables?

2006-10-31 Thread Alistair King
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > >> J. Clifford Dyer wrote: >> >> >>> Alistair King wrote: >>> > > [... advice and help ...] > > >> this worked a treat: >> >> def monoVarcalc(atom): >> >>a = atom + 'aa' >>Xaa = a.strip('\'') >>m = atom + 'ma' >>Xma

Re: create global variables?

2006-10-31 Thread Steve Holden
Alistair King wrote: > Steve Holden wrote: > >>[EMAIL PROTECTED] wrote: >> >> >>>J. Clifford Dyer wrote: >>> >>> >>> Alistair King wrote: >> >>[... advice and help ...] >> >> >> >>>this worked a treat: >>> >>>def monoVarcalc(atom): >>> >>> a = atom + 'aa' >>> Xaa = a.str

Re: Where do nested functions live?

2006-10-31 Thread Frederic Rentsch
Rob Williscroft wrote: > Frederic Rentsch wrote in news:mailman.1428.1162113628.11739.python- > [EMAIL PROTECTED] in comp.lang.python: > > >>def increment_time (interval_ms): >> outer weeks, days, hours, minutes, seconds, mseconds # 'outer' >> akin to 'global' >> (...) >>

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

2006-10-31 Thread robert
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 really mean the import statemen

Re: python, threading and a radio timer

2006-10-31 Thread ArdPy
Renato wrote: > Dear all, > > I found this nifty article on how to record your favourite radio show > using cron and mplayer: > http://grimthing.com/archives/2004/05/20/recording-streaming-audio-with-mplayer/ > > Because I couldn't get the date in the filename (and was too lazy to > look into sh/b

Re: Compile Python With SSL On Solaris 10

2006-10-31 Thread judasi
Martin v. Löwis wrote: > [EMAIL PROTECTED] schrieb: > > I am trying to compile py2.4.3/2.5 on a Solaris 10x86 machine, but > > cannot get it to build an SSL enabled version. I have added the > > relevant sfw directories into the path/crle, with no success. I've > > even explicitly added ssl via

Re: enumerate improvement proposal

2006-10-31 Thread Steven D'Aprano
On Mon, 30 Oct 2006 23:42:16 +, Steve Holden wrote: > Divorce is obviously the only answer. How could you end up marrying > someone who counts from one and not zero? ;-) "Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration." (Stan

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

2006-10-31 Thread Steven D'Aprano
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(module_name, file_name): > """ Make a new module object from the code in specified file """ > > from types

Re: create global variables?-the full story

2006-10-31 Thread Alistair King
Steve Holden wrote: > Alistair King wrote: > >> Steve Holden wrote: >> >> >>> [EMAIL PROTECTED] wrote: >>> >>> >>> J. Clifford Dyer wrote: > Alistair King wrote: > > >>> [... advice and help ...] >>> >>> >>> >>>

Re: 3d programming without opengl

2006-10-31 Thread nelson -
Hi paul, i look at slut and it seem very good... Can i embed it into a wxpython application? thanks, nelson -- http://mail.python.org/mailman/listinfo/python-list

Help me understand this iterator

2006-10-31 Thread LaundroMat
Hi, I've found this script over at effbot (http://effbot.org/librarybook/os-path.htm), and I can't get my head around its inner workings. Here's the script: import os class DirectoryWalker: # a forward iterator that traverses a directory tree def __init__(self, directory): self.

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

2006-10-31 Thread Fredrik Lundh
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 explicit load, of course. if you think that's a disadvantage, you h

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

2006-10-31 Thread Ben Finney
"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(module_name, file_name): > > """ Make a new module object

Re: Help me understand this iterator

2006-10-31 Thread Fredrik Lundh
LaundroMat wrote: > Now, if I look at this script step by step, I don't understand: > - what is being iterated over (what is being called by "file in > DirectoryWalker()"?); as explained in the text above the script, this class emulates a sequence. it does this by implementing the __getindex__

Re: Help me understand this iterator

2006-10-31 Thread Peter Otten
LaundroMat wrote: > Hi, > > I've found this script over at effbot > (http://effbot.org/librarybook/os-path.htm), and I can't get my head > around its inner workings. Here's the script: > > import os > > class DirectoryWalker: > # a forward iterator that traverses a directory tree > > d

Re: Help me understand this iterator

2006-10-31 Thread Steven D'Aprano
On Tue, 31 Oct 2006 03:36:08 -0800, LaundroMat wrote: > Hi, > > I've found this script over at effbot > (http://effbot.org/librarybook/os-path.htm), and I can't get my head > around its inner workings. [snip code] > Now, if I look at this script step by step, I don't understand: > - what is be

Re: Where do nested functions live?

2006-10-31 Thread Rob Williscroft
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: >> >> >> def whatever( new_ms ): >> class nam

Re: Help me understand this iterator

2006-10-31 Thread Peter Otten
LaundroMat wrote: [me hitting send too soon] > Now, if I look at this script step by step, I don't understand: > - where the "while 1:"-loop is quitted. > class DirectoryWalker: > # a forward iterator that traverses a directory tree > > def __init__(self, directory): > self.sta

Python tools for managing static websites?

2006-10-31 Thread Chris Pearl
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 changing parts (body conten

concatenating numpy arrays

2006-10-31 Thread Rolf Wester
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. Regards Rolf -- http://mail.python.org/mailman/listinfo/python-l

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

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 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: 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: 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: 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: 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: 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: 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: 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
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: 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: 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: 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: 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: 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

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: 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

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: 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: 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: 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 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: 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: 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: 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: 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: 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: >>> >>>

"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,

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

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: 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: "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

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: 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.

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: 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

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 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

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: 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: "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: 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: 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: 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 [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 [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: 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: "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: 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: 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: 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: 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 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: 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: 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: 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

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: 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. >

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 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

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: 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: 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: 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

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: "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

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: 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

  1   2   >