ANN: ewa 0.62 released

2007-01-03 Thread [EMAIL PROTECTED]
I'm pleased to announce the first release of ewa (East-West Audio), a server program for podcasters that dynamically adds intros and outros files (typically promotional material) to mp3s on the basis of user-defined rules. Ewa is available under the GPL. Its home page is

NYC Python User Group Meeting

2007-01-03 Thread John Clark
Greetings! The next New York City Python Users Group meeting is this Tuesday, Jan. 9th, 6:30pm at at the Millennium Partners office at 666 Fifth Avenue (53rd St. and 5th Ave.) on the 8th Floor. We welcome all those in the NYC area who are interested in Python to attend. However, we need a list of

taylayout 00.00.10

2007-01-03 Thread [EMAIL PROTECTED]
taylayout 00.00.10 http://cheeseshop.python.org/pypi/taylayout/00.00.10 Layout and Controls helpers for rapid and dynamic IronPython WinForms GUIs. TayLayout is a more sophisticated version of the flow layout - you can add controls to a panel or form and it takes care of positioning them.

ANN: Urwid 0.9.7.2 - Console UI Library

2007-01-03 Thread Ian Ward
Announcing Urwid 0.9.7.2 Urwid home page: http://excess.org/urwid/ Tarball: http://excess.org/urwid/urwid-0.9.7.2.tar.gz About this release: === This maintenance release significantly improves the performance of Urwid when run in UTF-8 mode. A

Re: How do I add users using Python scripts on a Linux machine

2007-01-03 Thread Tim Roberts
Ramdas [EMAIL PROTECTED] wrote: I need to add users from a web interface for a web server, which runs only Python. I need to add users, set quotas and in future even look at managing ip tables to limit bandwidth. I know os.system(), but this has to be done through a form entry through a web

Re: list/dictionary as case statement ?

2007-01-03 Thread Tom Plunket
Hendrik van Rooyen wrote: It works well - and it is surprisingly fast too... And its easy if the opcodes are all say one byte, else you need an opcode length field too, and fancier parsing. Often (always?) RISC architectures' instruction+operand lengths are fixed to the word size of the

Re: DOS, UNIX and tabs

2007-01-03 Thread Hendrik van Rooyen
Steven D'Aprano [EMAIL PROTECTED] wrote: I've spent a lot of time reading both sides of the tabs versus spaces argument, and I haven't found anything yet that explains why tabs are, in and of themselves, bad. +1 for QOTW Searching for the badness of tabs is like searching for the holy grail.

pythoncom module

2007-01-03 Thread Scripter47
Hey, I need a module called pythoncom anyone that knows where a can find that module??? thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing more efficient code

2007-01-03 Thread Hendrik van Rooyen
Jon Harrop [EMAIL PROTECTED] wrote: I think that is an excellent idea. Who will pay me? ;-) The same fellow who is paying you to post to this newsgroup... - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Synchronization methodology

2007-01-03 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Chris Ashurst wrote: Hi, I'm coming in from a despised Java background, and I'm having some trouble wrapping my head around sharing an object between multiple instances of a single class (in simpler terms, I would say imagine a simple chat server that has to share a

import order or cross import

2007-01-03 Thread Roland Hedberg
Hi! I'm having a bit of a problem with import. I'm writing a marshalling system that based on a specification will create one or more files containing mostly class definitions. If there are more than one file created (and there are reasons for creating more than one file in some instances) then

Re: how to use execfile with argument under windows

2007-01-03 Thread baur79
os.system() solve my problem thanks you guys and happy new year with best wishes from Kazakhstan / Shymkent city / sodbisystems.kz On Jan 2, 11:49 pm, Peter Otten [EMAIL PROTECTED] wrote: baur79 wrote: i need to execute this command line (different source for n times) filename.exe -type

Re: Synchronization methodology

2007-01-03 Thread [EMAIL PROTECTED]
Chris Ashurst wrote: Hi, I'm coming in from a despised Java background Consider strongly the fact that Python supports multiple process solutions well, so you're not stuck having to use multithreaded solutions in every circumstance (but can still use them when necessary). --

Re: import order or cross import

2007-01-03 Thread Jussi Salmela
Roland Hedberg kirjoitti: Hi! I'm having a bit of a problem with import. I'm writing a marshalling system that based on a specification will create one or more files containing mostly class definitions. If there are more than one file created (and there are reasons for creating more

Re: import order or cross import

2007-01-03 Thread Duncan Booth
Roland Hedberg [EMAIL PROTECTED] wrote: Now, running ONE.py causes no problem it will print Black, but running TWO.py I get: AttributeError: 'module' object has no attribute 'BaseColor' So, how can this be solved if it can be ? When you execute an import statement, it checks whether the

Re: Synchronization methodology

2007-01-03 Thread Paul Rubin
Chris Ashurst [EMAIL PROTECTED] writes: Hi, I'm coming in from a despised Java background, and I'm having some trouble wrapping my head around sharing an object between multiple instances of a single class (in simpler terms, I would say imagine a simple chat server that has to share a list of

Re: import order or cross import

2007-01-03 Thread Roland Hedberg
Duncan Booth wrote: Remember that all statements in Python are executed at the time they are encountered: there are no declarations (apart from 'global') so no looking ahead to see what classes or functions are coming up. Yes, I've seen this time and time again. One other complication

Re: Synchronization methodology

2007-01-03 Thread Paul Rubin
Paul Rubin http://[EMAIL PROTECTED] writes: # add the user to the connected user list, with timestamp and remote IP status = request(user_list.append, self, time(), remote_ip=whatever) Editing error, ignore the self, arg up there. Of course there may be other mistakes too, I didn't test

Re: Synchronization methodology

2007-01-03 Thread Duncan Booth
Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: You may want to make sure the lock will be released in case of an exception: def foo(self): self.lock.aquire() try: pass # code finally: self.lock.release() In Python 2.5 this can also be written more

Re: import order or cross import

2007-01-03 Thread Roland Hedberg
Jussi Salmela wrote: Roland Hedberg kirjoitti: I'm having a bit of a problem with import. I'm writing a marshalling system that based on a specification will create one or more files containing mostly class definitions. Maybe I'm missing something, but why is the class BaseColor in file

Using codecs.EncodedFile() with Python 2.5

2007-01-03 Thread David Hughes
I used this function successfully with Python 2.4 to alter the encoding of a set of database records from latin-1 to utf-8, but the same program raises an exception using Python 2.5. This small example shows the problem: import codecs fo = open('test.dat', 'w') fo.write('G\xe2teaux') fo.close()

Re: How do I add users using Python scripts on a Linux machine

2007-01-03 Thread Sebastian 'lunar' Wiesner
Piet van Oostrum [EMAIL PROTECTED] typed Sebastian 'lunar' Wiesner [EMAIL PROTECTED] (SW) wrote: SW Linux seems to ignore SUID bit on scripts: The reason is that obeying SUID bits on scripts would be a security risk. I don't see a problem with SUID on scripts. If you restrict write access

Re: Using codecs.EncodedFile() with Python 2.5

2007-01-03 Thread Peter Otten
David Hughes wrote: I used this function successfully with Python 2.4 to alter the encoding of a set of database records from latin-1 to utf-8, but the same program raises an exception using Python 2.5. This small example shows the problem: import codecs fo = open('test.dat', 'w')

[Half-off] How to get textboxes (text blocks) from ps/pdf files?

2007-01-03 Thread durumdara
Hi! I need to get textboxes/textblocks from pdf files. I can convert them into ps. Is anyone knows about method, trick, routine to I can get the textboxes from ps or pdf? (Pythonic, COM, or command line solutions needed.) I need to redraw them into my application, and user can reorder them,

convert frames from mpeg to array

2007-01-03 Thread seb
Hi, I need to convert each frame from a movie (mpeg for example) to an array (in order to do some computation) and then back to a video format mpeg for example. Do you know of any tools ? The equipment : I got myself an IP axis camera with wich I am playing to trying to

Re: list/dictionary as case statement ?

2007-01-03 Thread Bjoern Schliessmann
Tom Plunket wrote: Often (always?) RISC architectures' instruction+operand lengths are fixed to the word size of the machine. E.g. the MIPS 3000 and 4000 were 32 bits for every instruction, and PC was always a ^^ multiple of four. Intels aren't

function without brackets ?

2007-01-03 Thread Stef Mientki
If I call a parameterless function without brackets at the end, the function is not performed, but ... I don't get an error message ??? Is this normal behavior ? thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: a question on python dict

2007-01-03 Thread Fredrik Lundh
Tim Peters wrote: Taking my response out of context to begin with doesn't really change that I answered the question he asked ;-) welcome to comp.lang.python. /F -- http://mail.python.org/mailman/listinfo/python-list

Re: function without brackets ?

2007-01-03 Thread Carsten Haese
On Wed, 2007-01-03 at 15:37 +0100, Stef Mientki wrote: If I call a parameterless function without brackets at the end, the function is not performed, but ... I don't get an error message ??? Is this normal behavior ? Yes. If you call a function without brackets, it's not a call. Remember

Re: function without brackets ?

2007-01-03 Thread Sebastian 'lunar' Wiesner
Stef Mientki [EMAIL PROTECTED] typed If I call a parameterless function without brackets at the end, the function is not performed, but ... If you omit the brackets, you don't actually call the function. Instead you get a reference to the function object. Consider this example: cwd =

Re: function without brackets ?

2007-01-03 Thread rzed
Stef Mientki [EMAIL PROTECTED] wrote in news:57668 [EMAIL PROTECTED]: If I call a parameterless function without brackets at the end, the function is not performed, but ... I don't get an error message ??? Is this normal behavior ? Yes, it's normal, but you did not in fact call the

Re: function without brackets ?

2007-01-03 Thread Kay Schluehr
Stef Mientki schrieb: If I call a parameterless function without brackets at the end, the function is not performed, but ... I don't get an error message ??? Is this normal behavior ? Yes, this is perfectly o.k. because each function is a first class citizen in Python. The difference

code optimization (calc PI)

2007-01-03 Thread mm
(Yes, I konw whats an object is...) BTW. I did a translation of a pi callculation programm in C to Python. (Do it by your own... ;-) Calc PI for 800 digs(?). (german: Stellen) -- int a=1,b,c=2800,d,e,f[2801],g;main(){for(;b-c;)f[b++]=a/5;

Re: array of class / code optimization

2007-01-03 Thread mm
Yes, it was the (), equivalent to thiks like new() create new object from class xy. s1.append(Word) s1.append(Word()) But I was looking for a struct equivalent like in c/c++. And/or union. I can't find it. Maybe you know a source (URL) Python for c/c++ programmers or things like that.

Re: Unsubscribing from the list

2007-01-03 Thread Fredrik Lundh
Dotan Cohen wrote: Go to the bottom of the page. Next to the button Unsubscribe or edit options, enter your email address. Click the button. On the next page, click Unsubscribe. Follow the instructions in the email that is sent to you. Thanks. I read that page, got as far as this:

Re: array of class / code optimization

2007-01-03 Thread hg
mm wrote: Yes, it was the (), equivalent to thiks like new() create new object from class xy. s1.append(Word) s1.append(Word()) But I was looking for a struct equivalent like in c/c++. And/or union. I can't find it. Maybe you know a source (URL) Python for c/c++ programmers or

Re: Can I beat perl at grep-like processing speed?

2007-01-03 Thread Fredrik Lundh
Nick Craig-Wood wrote: #!/usr/bin/env python import re r = re.compile(r'destroy', re.IGNORECASE) for s in file('bigfile'): if r.search(s): print s.rstrip(\r\n) footnote: if you're searching for literal strings with Python 2.5, using in is a lot faster than using re.search. /F

Re: Unsubscribing from the list

2007-01-03 Thread mm
Fredrik Lundh wrote: if you're unable to follow written instructions, how on earth did you manage to subscribe to this list ? /F *lol* Just click ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: code optimization (calc PI)

2007-01-03 Thread Diez B. Roggisch
mm wrote: (Yes, I konw whats an object is...) BTW. I did a translation of a pi callculation programm in C to Python. (Do it by your own... ;-) Is that a question on how to optimize code you won't show us? If yes, I'm sorry to tell you that crystal balls are short these days. Too much

C/C++, Perl, etc. to Python converter

2007-01-03 Thread mm
Is there a Perl to Python converter? Or in general: a XY to Python converter? Is see, that Python is much better then Perl anyway. But for beginners, they whant to konw how is this done with Python etc. Sure, there are some docus out there in the internet. But a converter? --

Re: Why does Python never add itself to the Windows path?

2007-01-03 Thread Martin v. Löwis
Ben Sizer schrieb: Firstly, that solution only works for actual Python scripts; it doesn't solve the utility scripts that are often installed to the /scripts directory. Those packages should install .bat files into /scripts on Windows. It's a shame that many responses on this thread don't

Re: Why does Python never add itself to the Windows path?

2007-01-03 Thread Martin v. Löwis
vbgunz schrieb: I don't understand what all the fuss is about. Add a single page to the installer and on it, have 3 radio buttons. The choices could be add to path (recommended), add to path with version, do not add to path (not recommended). Please submit a patch to sf.net/projects/python

Re: code optimization (calc PI)

2007-01-03 Thread mm
Hmm... it's a question. It was not that easy to translate this [EMAIL PROTECTED] C-Program into readable code and then to Python. But it works. There are only two while-loops (a while within an other while). I konw, that for example while-loops in Perl are very slow. Maybe this is also known

Re: Filename encoding on XP

2007-01-03 Thread Martin v. Löwis
kent sin schrieb: What encoding does the NTFS store the filename? In UTF-16LE. However, on-disk storage is mostly irrelevant, what matters is what encoding is used on the OS API. Windows has two forms of file API: Wide (Unicode) and ANSI (byte-oriented). On NT, the Wide API is native; the ANSI

Re: bad marshal data in site.py in fresh 2.5 install win

2007-01-03 Thread Martin v. Löwis
TiNo schrieb: File F:\Python25\lib\encodings\__init__.py, line 32, in module from encodings import aliases ValueError: bad marshal data also removed site.pyc, and run it again, but with the same result. It's likely rather aliases.pyc which is bad, so try removing that. If in doubt,

Re: C/C++, Perl, etc. to Python converter

2007-01-03 Thread Diez B. Roggisch
mm wrote: Is there a Perl to Python converter? Or in general: a XY to Python converter? Is see, that Python is much better then Perl anyway. But for beginners, they whant to konw how is this done with Python etc. Sure, there are some docus out there in the internet. But a converter?

Re: C/C++, Perl, etc. to Python converter

2007-01-03 Thread Matimus
I don't know of a converter, one may exist. I have seen similar requests though and will give you a similar response to what I have seen. A converter, if it exists, may be able to produce working code but _not_ readable code. Python is a language whose strength comes from, among other things, its

Re: code optimization (calc PI)

2007-01-03 Thread Michael
Ah, no. It was a HASH (assoziative Array or somethings like that). mm wrote: I konw, that for example while-loops in Perl are very slow. Maybe this is also known in Pyhton. Then, I can translate the while-loops in to for-loops, for example. More general, maybe there is a speed

Re: How do I add users using Python scripts on a Linux machine

2007-01-03 Thread Ivan Voras
Sebastian 'lunar' Wiesner wrote: Carsten Haese [EMAIL PROTECTED] typed I don't think that that has anything to do with Linux or not. The script is not the actual executable, hence its suid bit is irrelevant. I don't think so. From what I know, the script is passed as executable to the

Re: C/C++, Perl, etc. to Python converter

2007-01-03 Thread Michael
Yes, I konw what you mean. And thats the right way to do it - for beginners. --But not for someone who allready know programmings things for many years. They ask themself: How can I do this in Python? I can remember, it was that-way with Perl or C or C++ or whatever. So, not only a ververter

When argparse will be in the python standard installation

2007-01-03 Thread [EMAIL PROTECTED]
Hi, I feel argparse has some useful things that optparse doesn't have. But I can't find it argparse in python library reference. I'm wondering when it will be available in the python standard installation. Thanks, Peng -- http://mail.python.org/mailman/listinfo/python-list

Re: C/C++, Perl, etc. to Python converter

2007-01-03 Thread Richard Charts
mm wrote: Is there a Perl to Python converter? Or in general: a XY to Python converter? Is see, that Python is much better then Perl anyway. But for beginners, they whant to konw how is this done with Python etc. Sure, there are some docus out there in the internet. But a converter? I

Re: Unsubscribing from the list

2007-01-03 Thread Dotan Cohen
On 03/01/07, Fredrik Lundh [EMAIL PROTECTED] wrote: if you're unable to follow written instructions, how on earth did you manage to subscribe to this list ? /F Actually, I'm a compete idiot and I always post to the mailing list instead of RTFM or STFW. What's the name of that big big

Re: array of class / code optimization

2007-01-03 Thread Jussi Salmela
hg kirjoitti: mm wrote: Yes, it was the (), equivalent to thiks like new() create new object from class xy. s1.append(Word) s1.append(Word()) But I was looking for a struct equivalent like in c/c++. And/or union. I can't find it. Maybe you know a source (URL) Python for c/c++

Re: C/C++, Perl, etc. to Python converter

2007-01-03 Thread Thomas Ploch
Matimus schrieb: I don't know of a converter, one may exist. I have seen similar requests though and will give you a similar response to what I have seen. A converter, if it exists, may be able to produce working code but _not_ readable code. Python is a language whose strength comes from,

Re: How do I add users using Python scripts on a Linux machine

2007-01-03 Thread Sebastian 'lunar' Wiesner
[ Ivan Voras [EMAIL PROTECTED] ] Sebastian 'lunar' Wiesner wrote: Carsten Haese [EMAIL PROTECTED] typed I don't think that that has anything to do with Linux or not. The script is not the actual executable, hence its suid bit is irrelevant. I don't think so. From what I know, the script

Re: function without brackets ?

2007-01-03 Thread Stef Mientki
Hope this helps, thanks You all guys, It's perfectly clear to me now ! cheers, Stef -- http://mail.python.org/mailman/listinfo/python-list

Re: Synchronization methodology

2007-01-03 Thread Jeremy Dillworth
Hi Chris, Have you looked at the mutex module? Jeremy -- http://mail.python.org/mailman/listinfo/python-list

type classobj not defined?

2007-01-03 Thread Wesley Brooks
Dear Users, I'm in the process of adding assert statements to a large piece of code to aid with bug hunting and came across the following issue; Using python in a terminal window you can do the following: type(False) == bool True I would like to check that an object is a class, here's an

Re: type classobj not defined?

2007-01-03 Thread Peter Otten
Wesley Brooks wrote: Dear Users, I'm in the process of adding assert statements to a large piece of code to aid with bug hunting and came across the following issue; Using python in a terminal window you can do the following: type(False) == bool True I would like to check that an

Re: Why does Python never add itself to the Windows path?

2007-01-03 Thread Ben Sizer
Chris Lambacher wrote: On Tue, Jan 02, 2007 at 09:08:41AM -0800, Ben Sizer wrote: Chris Lambacher wrote: The python part of the 'python setup.py install' idiom needs to be omitted on Windows, but that does not mean that the solution is to automatically add it to PATH.

Re: code optimization (calc PI)

2007-01-03 Thread Matimus
Using the '+' operator for string concatonation can be slow, especially when done many times in a loop. pi = pi + str(%04d % int(e + d/a)) ## this should be fast?! I dont The accepted solution would be to make pi an array and append to the end... pi = [] #create the array (empty) ... ...

Re: Why does Python never add itself to the Windows path?

2007-01-03 Thread Ben Sizer
Martin v. Löwis wrote: Ben Sizer schrieb: Firstly, that solution only works for actual Python scripts; it doesn't solve the utility scripts that are often installed to the /scripts directory. Those packages should install .bat files into /scripts on Windows. Which still need their

Re: Unsubscribing from the list

2007-01-03 Thread Diez B. Roggisch
Dotan Cohen wrote: On 03/01/07, Fredrik Lundh [EMAIL PROTECTED] wrote: if you're unable to follow written instructions, how on earth did you manage to subscribe to this list ? /F Actually, I'm a compete idiot and I always post to the mailing list instead of RTFM or STFW. What's the name

A python library to convert RTF into PDF ?

2007-01-03 Thread leonel . gayard
Hi, Does anyone know a good python library to convert a RTF file into PDF ? This should be done automaticaly: I have a web page that takes some values and inserts them into a RTF template, resulting in an RTF file. However, I cannot send the output back to the user in RTF, it must be sent in PDF

Re: a question on python dict

2007-01-03 Thread Tim Peters
[Tim Peters] ... Taking my response out of context to begin with doesn't really change that I answered the question he asked ;-) [Fredrik Lundh] welcome to comp.lang.python. /F Thanks for the welcome! It's tough to be a newbie here ;-) --

Re: Unsubscribing from the list

2007-01-03 Thread Fredrik Lundh
Dotan Cohen wrote: Actually, I'm a compete idiot Robert provided *detailed* instructions, which you ignored. I quoted the same instructions in my reply, which you also ignored. the sentence after the one where you stopped reading also tells you what to do. one might suspect that you

Re: array of class / code optimization

2007-01-03 Thread Neil Cerutti
On 2007-01-03, Jussi Salmela [EMAIL PROTECTED] wrote: hg kirjoitti: mm wrote: Yes, it was the (), equivalent to thiks like new() create new object from class xy. s1.append(Word) s1.append(Word()) But I was looking for a struct equivalent like in c/c++. And/or union. I can't find it.

Re: Unsubscribing from the list

2007-01-03 Thread Dotan Cohen
On 03/01/07, Fredrik Lundh [EMAIL PROTECTED] wrote: Robert provided *detailed* instructions, which you ignored. I quoted the same instructions in my reply, which you also ignored. the sentence after the one where you stopped reading also tells you what to do. one might suspect that you

Re: list/dictionary as case statement ?

2007-01-03 Thread Tom Plunket
Bjoern Schliessmann wrote: Intels aren't RISC, are they? Not the ones in PCs. The OP didn't specify the CPU that's being used, however. -tom! -- -- http://mail.python.org/mailman/listinfo/python-list

Re: A python library to convert RTF into PDF ?

2007-01-03 Thread Tom Plunket
[EMAIL PROTECTED] wrote: So, what library can I use to convert from RTF to PDF ? GPL / BSD Libraries are welcome. If you could write to LaTeX files instead, you could then just use pdflatex that comes with all of the LaTeX distributions. -tom! -- --

Re: list/dictionary as case statement ?

2007-01-03 Thread MRAB
Bjoern Schliessmann wrote: Tom Plunket wrote: Often (always?) RISC architectures' instruction+operand lengths are fixed to the word size of the machine. E.g. the MIPS 3000 and 4000 were 32 bits for every instruction, and PC was always a ^^

Sorting on multiple values, some ascending, some descending

2007-01-03 Thread dwelden
I have successfully used the sort lambda construct described in http://mail.python.org/pipermail/python-list/2006-April/377443.html. However, how do I take it one step further such that some values can be sorted ascending and others descending? Easy enough if the sort values are numeric (just

Re: A python library to convert RTF into PDF ?

2007-01-03 Thread leonel . gayard
No, this won't work. First, pdflatex is too slow. Second, my templates are M$-Word doc files, and they cannot be easily converted to tex. I have tried to convert them to tex using OpenOffice, but the result is ugly as hell. I cannot convert the doc files into PDF, because I do not have a library

Re: list/dictionary as case statement ?

2007-01-03 Thread Bjoern Schliessmann
MRAB wrote: I think that PC referred to the CPU's Program Counter. Argh, thanks. :) The x86 CPUs if typical Windows PCs aren't RISC but Intel also manufacture X-Scale (ARM core) processors which are. Okay, sorry for lack of precision. I was referring to x86. Regards, Björn -- BOFH

Re: code optimization (calc PI)

2007-01-03 Thread Stefan Schwarzer
On 2007-01-03 16:50, mm wrote: More general, maybe there is a speed optimazation docu out there. At least Alex Martellis Python in a Nutshell has a section on optimization. I presented this at the last EuroPython conference: http://sschwarzer.com/download/optimization_europython2006.pdf Stefan

Re: code optimization (calc PI)

2007-01-03 Thread Michael
Hmm.. thanks. I did this changes, but without any performance profits. Matimus wrote: Using the '+' operator for string concatonation can be slow, especially when done many times in a loop. pi = pi + str(%04d % int(e + d/a)) ## this should be fast?! I dont The accepted solution

Re: array of class / code optimization

2007-01-03 Thread Bjoern Schliessmann
mm wrote: But I was looking for a struct equivalent like in c/c++. And/or union. I can't find it. class Honk(object): pass test = Honk() test.spam = 4 test.eggs = Yum Is it this what you're looking for? Maybe you know a source (URL) Python for c/c++ programmers or things like that.

Re: type classobj not defined?

2007-01-03 Thread Martin v. Löwis
Wesley Brooks schrieb: type(b) == classobj Traceback (most recent call last): File stdin, line 1, in ? NameError: name 'classobj' is not defined For the time being I'll use b.__name__ == b to ensure I'm getting the right class. Is there a reason why the other types such as bool are

Re: When argparse will be in the python standard installation

2007-01-03 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I feel argparse has some useful things that optparse doesn't have. But I can't find it argparse in python library reference. I'm wondering when it will be available in the python standard installation. there's already two different option parsing modules in the

Re: Why does Python never add itself to the Windows path?

2007-01-03 Thread Martin v. Löwis
Ben Sizer schrieb: Those packages should install .bat files into /scripts on Windows. Which still need their location to be be fully qualified, due to /scripts not being in the path. This is not my experience with Linux installations of the same packages. Ah, so you not only want the

Re: When argparse will be in the python standard installation

2007-01-03 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: I feel argparse has some useful things that optparse doesn't have. But I can't find it argparse in python library reference. I'm wondering when it will be available in the python standard installation. On its own, never. Somebody has to contribute it to Python, and

Cannot build 2.5 on FC6 x86

2007-01-03 Thread Paul Watson
./configure make make test The result appears to hang after the test_tkl... line. I had to kill the 'make test' process which terminated it. Any suggestions? 280 tests OK. 4 tests failed: test_optparse test_socket test_socket_ssl test_urllib2 35 tests skipped: test_aepack test_al

Re: Why does Python never add itself to the Windows path?

2007-01-03 Thread vbgunz
I don't understand what all the fuss is about. Add a single page to the installer and on it, have 3 radio buttons. The choices could be add to path (recommended), add to path with version, do not add to path (not recommended). Please submit a patch to sf.net/projects/python that does so.

Re: Sorting on multiple values, some ascending, some descending

2007-01-03 Thread Raymond Hettinger
dwelden wrote: I have successfully used the sort lambda construct described in http://mail.python.org/pipermail/python-list/2006-April/377443.html. However, how do I take it one step further such that some values can be sorted ascending and others descending? Easy enough if the sort values

Re: bad marshal data in site.py in fresh 2.5 install win

2007-01-03 Thread TiNo
Removing aliases.pyc solved it. Thank you. 2007/1/3, Martin v. Löwis [EMAIL PROTECTED]: TiNo schrieb: File F:\Python25\lib\encodings\__init__.py, line 32, in module from encodings import aliases ValueError: bad marshal data also removed site.pyc, and run it again, but with the

Re: Sorting on multiple values, some ascending, some descending

2007-01-03 Thread Carsten Haese
On Wed, 2007-01-03 at 10:48 -0800, dwelden wrote: I have successfully used the sort lambda construct described in http://mail.python.org/pipermail/python-list/2006-April/377443.html. However, how do I take it one step further such that some values can be sorted ascending and others descending?

Re: A python library to convert RTF into PDF ?

2007-01-03 Thread Felipe Almeida Lessa
On 3 Jan 2007 10:52:02 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have tried to convert them to tex using OpenOffice, but the result is ugly as hell. Why not use OO.org to convert DOC to PDF? It does so natively, IIRC. -- Felipe. --

Re: list/dictionary as case statement ?

2007-01-03 Thread Stef Mientki
Tom Plunket wrote: Bjoern Schliessmann wrote: Intels aren't RISC, are they? Not the ones in PCs. The OP didn't specify the CPU that's being used, however. Well it was meant for a small micro-controller, the PIC-14-series, e.g. PIC16F877. I already build a simulator for this device in

Re: A python library to convert RTF into PDF ?

2007-01-03 Thread robert
[EMAIL PROTECTED] wrote: Hi, Does anyone know a good python library to convert a RTF file into PDF ? This should be done automaticaly: I have a web page that takes some values and inserts them into a RTF template, resulting in an RTF file. However, I cannot send the output back to the

Re: Why does Python never add itself to the Windows path?

2007-01-03 Thread Martin v. Löwis
vbgunz schrieb: I don't understand what all the fuss is about. Add a single page to the installer and on it, have 3 radio buttons. The choices could be add to path (recommended), add to path with version, do not add to path (not recommended). Please submit a patch to sf.net/projects/python

Re: Cannot build 2.5 on FC6 x86

2007-01-03 Thread Martin v. Löwis
Paul Watson schrieb: ./configure make make test The result appears to hang after the test_tkl... line. I had to kill the 'make test' process which terminated it. Any suggestions? There isn't (or shouldn't be) any test_tkl... line. What precisely was the line, and how long did you wait

Re: Sorting on multiple values, some ascending, some descending

2007-01-03 Thread bearophileHUGS
Raymond Hettinger: The simplest way is to take advantage of sort-stability and do successive sorts. For example, to sort by a primary key ascending and a secondary key decending: L.sort(key=lambda r: r.secondary, reverse=True) L.sort(key=lambda r: r.primary) That's probably the faster

Re: Sorting on multiple values, some ascending, some descending

2007-01-03 Thread Peter Otten
Raymond Hettinger wrote: dwelden wrote: I have successfully used the sort lambda construct described in http://mail.python.org/pipermail/python-list/2006-April/377443.html. However, how do I take it one step further such that some values can be sorted ascending and others descending? Easy

Re: Sorting on multiple values, some ascending, some descending

2007-01-03 Thread George Sakkis
dwelden wrote: I have successfully used the sort lambda construct described in http://mail.python.org/pipermail/python-list/2006-April/377443.html. However, how do I take it one step further such that some values can be sorted ascending and others descending? Easy enough if the sort values

Re: array of class / code optimization

2007-01-03 Thread hg
Neil Cerutti wrote: On 2007-01-03, Jussi Salmela [EMAIL PROTECTED] wrote: hg kirjoitti: mm wrote: Yes, it was the (), equivalent to thiks like new() create new object from class xy. s1.append(Word) s1.append(Word()) But I was looking for a struct equivalent like in c/c++. And/or

Re: Unsubscribing from the list

2007-01-03 Thread Robert Kern
Dotan Cohen wrote: On 03/01/07, Fredrik Lundh [EMAIL PROTECTED] wrote: Robert provided *detailed* instructions, which you ignored. I quoted the same instructions in my reply, which you also ignored. the sentence after the one where you stopped reading also tells you what to do. one might

M. Hammonds python panel

2007-01-03 Thread [EMAIL PROTECTED]
Hello all I am a great fan of Mark Hammonds python pannel. But since starship went down it didn't come up again ...with the link in my favs to http://starship.python.net/crew/mhammond/mozilla/pythonpanel.xul still pointing nowhere. Maybe Mark is around here somewhere... Jürgen --

Re: Unsubscribing from the list

2007-01-03 Thread Dotan Cohen
On 03/01/07, Robert Kern [EMAIL PROTECTED] wrote: He misunderstood you (as I nearly did, too). The way you phrased decided that there was no futher interest on the page for me is somewhat ambiguous: it can seem like it refers to the second time, not the first. Ah. Sorry. I'm getting better at

Re: Unsubscribing from the list

2007-01-03 Thread Jan Dries
Dotan Cohen wrote: On 03/01/07, Robert Kern [EMAIL PROTECTED] wrote: He misunderstood you (as I nearly did, too). The way you phrased decided that there was no futher interest on the page for me is somewhat ambiguous: it can seem like it refers to the second time, not the first. Ah.

  1   2   >