Announcing Transifex 0.5

2009-03-20 Thread Dimitris Glezos
Indifex and the Transifex Community are proud to announce the newest version of their flagship translation platform, Transifex 0.5. Transifex is a web application written in Python using the Django web framework that gives translators a web interface to various version control systems. Files to

Re: Unicode problem in ucs4

2009-03-20 Thread Martin v. Löwis
Any idea on why this is happening? Can you provide a complete example? Your code looks correct, and should just work. How do you know the result contains only 't' (i.e. how do you know it does not contain 'e', 's', 't')? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python + PostgreSQL

2009-03-20 Thread Martin v. Löwis
I saw in a different post that psycopg2 does work on Python 3.x as long as a patch is applied (by Martin v. Löwis): [...] Do you know where can I find this patch It's linked in http://wiki.python.org/moin/Early2to3Migrations and lives in

file.read() doesn't read the whole file

2009-03-20 Thread Sreejith K
Hi, snapdir = './mango.txt_snaps' snap_cnt = 1 block = 0 import os os.chdir('/mnt/gfs_local') snap = open(snapdir + '/snap%s/%s' % (repr(snap_cnt), repr(block)),'r') snap.read() 'dfdfdgagdfgdf\ngdgfadgagadg\nagafg\n\nfs\nf\nsadf\n\nsdfsdfsadf\n' snapdir + '/snap%s/%s' % (repr(snap_cnt),

Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread venutaurus...@gmail.com
Hello all, Is there any way to list out all the properties (name, type, size) and attributes( Accesstime, mod time, archived or readonly etc) of a folder and its contents recursively. Should I need ot go inside each and every directory to list them? This has to be for Windows.

parser module and doc

2009-03-20 Thread Steven D'Aprano
I'm reading the docs for the parser module and I'm confused. http://docs.python.org/library/parser.html The doc make a number of references to the file example.py, and says: All source files mentioned here which are not part of the Python installation are located in the Demo/parser/ directory

Regarding the lxml import error only in a web-request

2009-03-20 Thread nagraj
I'm trying to run Django from Apache using FastCGI in a shared hosting environment on DH. I've installed python 2.5.2 onto my home environment. And all the necessary libraries including lxml 2.1.3, libxml2, libxslt, flup, etc. I'm facing a strange issue with lxml, which occurs only when it is

Re: How complex is complex?

2009-03-20 Thread Hendrik van Rooyen
Aahz a...@pyft.com wrote: 8 .. Because the name Python is derived from the comedy TV show Monty Python, stupid jokes are common in the Python community.) Sacrilege! A joke based on the Monty Python series is BY DEFINITION

Re: Parallel processing on shared data structures

2009-03-20 Thread Hendrik van Rooyen
psaff...@lemail.com wrote: I'm filing 160 million data points into a set of bins based on their position. At the moment, this takes just over an hour using interval So why do you not make four sets of bins - one for each core of your quad, and split the points into quarters, and run four

Re: parser module and doc

2009-03-20 Thread Mark Dickinson
On Mar 20, 7:26 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: All source files mentioned here which are not part of the Python installation are located in the Demo/parser/ directory of the distribution. http://docs.python.org/library/parser.html#information-discovery What

Re: Heuristically processing documents

2009-03-20 Thread Hendrik van Rooyen
MRAB goo...@mrett.plus.com wrote: BJörn Lindqvist wrote: 8 --- For example, to find the email you can use a simple regexp. If there is a match you can be certain that that is the authors email. But what algorithms can you use to figure out the other information?

How to use self-inspection to check for try-block

2009-03-20 Thread elmar
Hi everyone, is there a sufficiently easy possibility for a Python function to find out whether it has been called from a try-block or not? try: print Calling foo foo() except: print Got exception In the example above, foo() should be able to 'see' that it was called from a try block,

Re: How to use self-inspection to check for try-block

2009-03-20 Thread Chris Rebert
On Fri, Mar 20, 2009 at 1:32 AM, el...@cmbi.ru.nl wrote: Hi everyone, is there a sufficiently easy possibility for a Python function to find out whether it has been called from a try-block or not? try:  print Calling foo  foo() except:  print Got exception In the example above, foo()

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread Tino Wildenhain
venutaurus...@gmail.com wrote: Hello all, Is there any way to list out all the properties (name, type, size) and attributes( Accesstime, mod time, archived or readonly etc) of a folder and its contents recursively. Should I need ot go inside each and every directory to list them?

Re: multiprocessing and Tk GUI program (won't work under Linux)

2009-03-20 Thread bieffe62
On Mar 20, 4:36 am, akineko akin...@gmail.com wrote: Hello everyone, I have started using multiprocessing module, which is now available with Python 2.6. It definitely opens up new possibilities. Now, I developed a small GUI package, which is to be used from other programs. It uses

Re: How complex is complex?

2009-03-20 Thread Tim Rowe
2009/3/20 Hendrik van Rooyen m...@microcorp.co.za: A joke based on the Monty Python series is BY DEFINITION not stupid! But may get /too/ silly. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: How complex is complex?

2009-03-20 Thread Vito De Tullio
Tim Roberts wrote: bearophileh...@lycos.com wrote: In Python 3 those lines become shorter: for k, v in a.items(): {k: v+1 for k, v in a.items()} That's a syntax I have not seen in the 2-to-3 difference docs, so I'm not familiar with it. How does that cause a to be updated? I think he

Re: How to use self-inspection to check for try-block

2009-03-20 Thread Chris Rebert
On Fri, Mar 20, 2009 at 2:09 AM, el...@cmbi.ru.nl wrote: On Mar 20, 9:44 am, Chris Rebert c...@rebertia.com wrote: On Fri, Mar 20, 2009 at 1:32 AM,  el...@cmbi.ru.nl wrote: Hi everyone, is there a sufficiently easy possibility for a Python function to find out whether it has been called

Re: Ban Xah Lee

2009-03-20 Thread David Kastrup
Bruce C. Miller bm3...@gmail.com writes: On Mar 7, 6:52 pm, Xah Lee xah...@gmail.com wrote: Of interest: • Why Can't You Be Normal? Though I doubt this will do any good, I'll offer some advice that hasn't been mentioned here and solved a lot of the problems I've had early in life with

PEP 3143: Standard daemon process library (was: Writing a well-behaved daemon)

2009-03-20 Thread Ben Finney
Ben Finney b...@benfinney.id.au writes: Writing a Python program to become a Unix daemon is relatively well-documented: there's a recipe for detaching the process and running in its own process group. However, there's much more to a Unix daemon than simply detaching. […] My searches for

Use of HTMLparser to change language

2009-03-20 Thread pranav
Greetings All, I have huge number of HTML files, all in english. I also have their counterpart files in Spanish. The non english files have their look and feel a little different than their english counterpart. My task is to make sure that the English HTML files contain the Spanish text, with

Re: Use of HTMLparser to change language

2009-03-20 Thread Jeremiah Dodds
On Fri, Mar 20, 2009 at 9:59 AM, pranav pra...@gmail.com wrote: Greetings All, I have huge number of HTML files, all in english. I also have their counterpart files in Spanish. The non english files have their look and feel a little different than their english counterpart. My task is to

Re: Need guidelines to show results of a process

2009-03-20 Thread bieffe62
On Mar 20, 1:00 am, Vizcayno vizcay...@gmail.com wrote: Hi: I wrote a Python program which, during execution, shows me messages on console indicating at every moment the time and steps being performed so I can have a 'log online' and guess remaining time for termination, I used many 'print'

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread venutaurus...@gmail.com
On Mar 20, 1:58 pm, Tino Wildenhain t...@wildenhain.de wrote: venutaurus...@gmail.com wrote: Hello all,             Is there any way to list out all the properties (name, type, size) and attributes( Accesstime, mod time, archived or readonly etc) of a folder and its contents recursively.

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread Tim Golden
venutaurus...@gmail.com wrote: Hello all, Is there any way to list out all the properties (name, type, size) and attributes( Accesstime, mod time, archived or readonly etc) of a folder and its contents recursively. Should I need ot go inside each and every directory to list them?

distutils compiler flags for extension modules

2009-03-20 Thread Christian Meesters
Hoi, as I got no answers with the previous question (subject: disabling compiler flags in distutils), I thought I should ask the question in a different way: Is there an option to set the compiler flags for a C/C++ extension in distutils? There is the extra_compile_args-option in the

Re: How to use self-inspection to check for try-block

2009-03-20 Thread elmar
On Mar 20, 9:44 am, Chris Rebert c...@rebertia.com wrote: On Fri, Mar 20, 2009 at 1:32 AM, el...@cmbi.ru.nl wrote: Hi everyone, is there a sufficiently easy possibility for a Python function to find out whether it has been called from a try-block or not? try: print Calling foo

Re: PEP 3143: Standard daemon process library

2009-03-20 Thread Ben Finney
Ben Finney ben+pyt...@benfinney.id.au writes: I've submitted PEP 3143 URL:http://www.python.org/dev/peps/pep-3143/ to meet this need, and have re-worked an existing library into a new ‘python-daemon’ URL:http://pypi.python.org/pypi/python-daemon/ library, the reference implementation. Now

locate items in matrix (index of lists of lists)

2009-03-20 Thread Alexzive
Hello there, let's suppose I have the following matrix: mat = [[1,2,3], [3,2,4], [7,8,9], [6,2,9]] where [.. , .. , ..] are the rows. I am interested into getting the row index of all the matrix rows where a certain number occurs. For example for 9 I should get 2 and 3 (starting from 0). For

Re: How to use Jython to create a javabean ???

2009-03-20 Thread Diez B. Roggisch
qq13234...@gmail.com schrieb: I want to make a bean with Jython and how to make it via Jython ? By subclassing a java interface. That's all you need. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: locate items in matrix (index of lists of lists)

2009-03-20 Thread Chris Rebert
On Fri, Mar 20, 2009 at 3:50 AM, Alexzive zasaconsult...@gmail.com wrote: Hello there, let's suppose I have the following matrix: mat = [[1,2,3], [3,2,4], [7,8,9], [6,2,9]] where [.. , .. , ..] are the rows. I am interested into getting the row index of all the matrix rows where a

Re: locate items in matrix (index of lists of lists)

2009-03-20 Thread Tino Wildenhain
Alexzive wrote: Hello there, let's suppose I have the following matrix: mat = [[1,2,3], [3,2,4], [7,8,9], [6,2,9]] where [.. , .. , ..] are the rows. I am interested into getting the row index of all the matrix rows where a certain number occurs. For example for 9 I should get 2 and 3

Re: Unicode problem in ucs4

2009-03-20 Thread abhi
On Mar 20, 11:03 am, Martin v. Löwis mar...@v.loewis.de wrote: Any idea on why this is happening? Can you provide a complete example? Your code looks correct, and should just work. How do you know the result contains only 't' (i.e. how do you know it does not contain 'e', 's', 't')?

Re: Use of HTMLparser to change language

2009-03-20 Thread Marco Mariani
pranav wrote: I am sure there is a python way of solving this problem. The common sense approach (nothing to do with python) would be to rewrite everything to be dynamically generated with a template language - in python those would be TAL, mako, genshi, jinja, whatever ... anything is

Re: How to use self-inspection to check for try-block

2009-03-20 Thread elmar
On Mar 20, 10:16 am, Chris Rebert c...@rebertia.com wrote: On Fri, Mar 20, 2009 at 2:09 AM, el...@cmbi.ru.nl wrote: On Mar 20, 9:44 am, Chris Rebert c...@rebertia.com wrote: On Fri, Mar 20, 2009 at 1:32 AM, el...@cmbi.ru.nl wrote: Hi everyone, is there a sufficiently easy possibility

Re: How to use self-inspection to check for try-block

2009-03-20 Thread Diez B. Roggisch
el...@cmbi.ru.nl schrieb: On Mar 20, 10:16 am, Chris Rebert c...@rebertia.com wrote: On Fri, Mar 20, 2009 at 2:09 AM, el...@cmbi.ru.nl wrote: On Mar 20, 9:44 am, Chris Rebert c...@rebertia.com wrote: On Fri, Mar 20, 2009 at 1:32 AM, el...@cmbi.ru.nl wrote: Hi everyone, is there a

Re: Ordered Sets

2009-03-20 Thread Nigel Rantor
Aahz wrote: In article 9a5d59e1-2798-4864-a938-9b39792c5...@s9g2000prg.googlegroups.com, Raymond Hettinger pyt...@rcn.com wrote: Here's a new, fun recipe for you guys: http://code.activestate.com/recipes/576694/ That is *sick* and perverted. I'm not sure why. Would it be less sick if it

Re: locate items in matrix (index of lists of lists)

2009-03-20 Thread Alessandro Zivelonghi
Many Thanks guys! and what if I need to look ONLY into the second and third columns, excluding the first item of each rows? for example if x = 3 I need to get [0] and not [0,1] many thanks, Alex 2009/3/20 Tino Wildenhain t...@wildenhain.de: Alexzive wrote: Hello there, let's suppose I

file.read() doesn't read the whole file

2009-03-20 Thread R. David Murray
Sreejith K sreejith...@gmail.com wrote: Hi, snapdir = './mango.txt_snaps' snap_cnt = 1 block = 0 import os os.chdir('/mnt/gfs_local') snap = open(snapdir + '/snap%s/%s' % (repr(snap_cnt), repr(block)),'r') snap.read()

Re: Use of HTMLparser to change language

2009-03-20 Thread pranav
On Mar 20, 3:53 pm, Marco Mariani ma...@sferacarta.com wrote: pranav wrote: I am sure there is a python way of solving this problem. The common sense approach (nothing to do with python) would be to rewrite everything to be dynamically generated with a template language - in python those

Re: locate items in matrix (index of lists of lists)

2009-03-20 Thread Chris Rebert
On Fri, Mar 20, 2009 at 4:34 AM, Alessandro Zivelonghi zasaconsult...@gmail.com wrote: Many Thanks guys! and what if I need to look ONLY into the second and third columns, excluding the first item of each rows? for example if x = 3 I need to get  [0] and not [0,1] indices = [i for i, row in

Preparing teaching materials

2009-03-20 Thread grkuntzmd
I am considering teaching a beginning programming course using Python. I would like to prepare my class handouts in such a way that I can import the Python code from real .py files directly into the documents. This way I can run real unit tests on the code to confirm that they work as expected. I

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread Tino Wildenhain
Tim Golden wrote: ... and do the following: code from winsys import fs for f in fs.flat (c:/temp): f.dump () ^ eeek! But btw, what extra information would it give? Regards Tino smime.p7s Description: S/MIME Cryptographic Signature --

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread Tino Wildenhain
venutaurus...@gmail.com wrote: On Mar 20, 1:58 pm, Tino Wildenhain t...@wildenhain.de wrote: venutaurus...@gmail.com wrote: Hello all, ... smime.p7s 4KViewDownload Thanks for your suggestion. By the way the attachment which have added has some unknown file extension. May I know how can I

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread Tim Golden
Tino Wildenhain wrote: Tim Golden wrote: ... and do the following: code from winsys import fs for f in fs.flat (c:/temp): f.dump () ^ eeek! Was the k! for the space before the bracket (which, for some unaccountable reason disturbs some people)? Or for the idea of dumping data

Re: Ban Xah Lee

2009-03-20 Thread Bruce C. Miller
On Mar 7, 6:52 pm, Xah Lee xah...@gmail.com wrote: Of interest: • Why Can't You Be Normal? Though I doubt this will do any good, I'll offer some advice that hasn't been mentioned here and solved a lot of the problems I've had early in life with resistance to overly-emotional negative reactions

Re: Lambda forms and scoping

2009-03-20 Thread R. David Murray
Benjamin Peterson benja...@python.org wrote: Márcio Faustino m.faustino at gmail.com writes: Executing the example below doesn't produce the expected behavior, but using the commented code does. Is this normal, or is it a problem with Python? I've tested it with version 2.6.1 on Windows

Re: Why doesn't this work ? For loop variable scoping ?

2009-03-20 Thread Gabriel Genellina
En Thu, 19 Mar 2009 19:33:36 -0300, Ryan Kelly r...@rfk.id.au escribió: newCylinderTempertature = newCylinderTemperature + deltaTemp Take a careful look at the variable name here: Tempertature. Python's dynamic nature provides a lot of wonderful benefits, but you've just hit one of

Re: Use of HTMLparser to change language

2009-03-20 Thread Tino Wildenhain
pranav wrote: On Mar 20, 3:53 pm, Marco Mariani ma...@sferacarta.com wrote: pranav wrote: I am sure there is a python way of solving this problem. The common sense approach (nothing to do with python) would be to rewrite everything to be dynamically generated with a template language - in

Re: Use of HTMLparser to change language

2009-03-20 Thread Vlastimil Brom
2009/3/20 pranav pra...@gmail.com: Greetings All, I have huge number of HTML files, all in english. I also have their counterpart files in Spanish. The non english files have their look and feel a little different than their english counterpart. My task is to make sure that the English HTML

Re: Preparing teaching materials

2009-03-20 Thread Tim Golden
Michele Simionato wrote: On Mar 20, 12:58 pm, grkunt...@gmail.com wrote: I am considering teaching a beginning programming course using Python. I would like to prepare my class handouts in such a way that I can import the Python code from real .py files directly into the documents. This way I

Re: Lambda forms and scoping

2009-03-20 Thread Michele Simionato
On Mar 19, 10:52 pm, Márcio Faustino m.faust...@gmail.com wrote: Hi, Executing the example below doesn't produce the expected behavior, but using the commented code does. Is this normal, or is it a problem with Python? It is a common gotcha. Notice that it has nothing to do with lambda

speech recognition help

2009-03-20 Thread Murali kumar
hi all.. I want* to add speech recognition *to my application for *disabled persons*. (running in python 2.6 with wxpython 2.8.9..) *problem:* actually i have some buttons scanned one by one.. button name is 'add' and if i tell 'add' then add button click event must be performed.. For that i

Re: Lambda forms and scoping

2009-03-20 Thread Márcio Faustino
So simple :) thanks! -- http://mail.python.org/mailman/listinfo/python-list

How to use Jython to create a javabean ???

2009-03-20 Thread qq13234722
I want to make a bean with Jython and how to make it via Jython ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode problem in ucs4

2009-03-20 Thread M.-A. Lemburg
On 2009-03-20 12:13, abhi wrote: On Mar 20, 11:03 am, Martin v. Löwis mar...@v.loewis.de wrote: Any idea on why this is happening? Can you provide a complete example? Your code looks correct, and should just work. How do you know the result contains only 't' (i.e. how do you know it does

Re: Can I rely on...

2009-03-20 Thread R. David Murray
alex23 wuwe...@gmail.com wrote: On Mar 20, 1:42 am, Emanuele D'Arrigo man...@gmail.com wrote: I just had a bit of a shiver for something I'm doing often in my code but that might be based on a wrong assumption on my part. Take the following code: pattern = aPattern compiledPatterns

Re: Preparing teaching materials

2009-03-20 Thread Michele Simionato
On Mar 20, 12:58 pm, grkunt...@gmail.com wrote: I am considering teaching a beginning programming course using Python. I would like to prepare my class handouts in such a way that I can import the Python code from real .py files directly into the documents. This way I can run real unit tests

Re: Preparing teaching materials

2009-03-20 Thread Michele Simionato
On Mar 20, 1:44 pm, Tim Golden m...@timgolden.me.uk wrote: Michele Simionato wrote: One word: Sphinx. And the second word(s): ..  literalinclude:: example.py TJG The interesting thing is that Sphinx uses pygments and can highlight any code fragment, not only Python code. For instance,

Re: PEP 3143: Standard daemon process library (was: Writing a well-behaved daemon)

2009-03-20 Thread Jean-Paul Calderone
On Fri, 20 Mar 2009 20:58:58 +1100, Ben Finney ben+pyt...@benfinney.id.au wrote: Ben Finney b...@benfinney.id.au writes: Writing a Python program to become a Unix daemon is relatively well-documented: there's a recipe for detaching the process and running in its own process group. However,

Re: Lambda forms and scoping

2009-03-20 Thread Gabriel Genellina
En Fri, 20 Mar 2009 09:28:08 -0300, R. David Murray rdmur...@bitdance.com escribió: Benjamin Peterson benja...@python.org wrote: Márcio Faustino m.faustino at gmail.com writes: Executing the example below doesn't produce the expected behavior, but using the commented code does. Is this

Re: Can I rely on...

2009-03-20 Thread Bruno Desthuilliers
Emanuele D'Arrigo a écrit : Hi everybody, I just had a bit of a shiver for something I'm doing often in my code but that might be based on a wrong assumption on my part. Do not assume. Either check or use another solution. My 2 cents... Take the following code: pattern = aPattern

Unable to compile pyprocessing module on SUN solaris

2009-03-20 Thread Deepak Rokade
I am trying to build package pyprocessing for python 2.5 I am using sun machine with Solaris 5.8 drok...@himalaya:~/modules_python/processing-0.52 (Deepak:)uname -a SunOS himalaya 5.8 Generic_117350-35 sun4u sparc SUNW,Sun-Fire While building the package I get below warnings. (Deepak:)python

Re: speech recognition help

2009-03-20 Thread Tim Chase
I want* to add speech recognition *to my application for *disabled persons*. (running in python 2.6 with wxpython 2.8.9..) *problem:* too many asterisks? ;-) actually i have some buttons scanned one by one.. button name is 'add' and if i tell 'add' then add button click event must be

Re: Use of HTMLparser to change language

2009-03-20 Thread Marco Mariani
pranav wrote: I am sure there is a python way of solving this problem. The common sense approach (nothing to do with python) would be to rewrite everything to be dynamically generated with a template language - in python those would be TAL, mako, genshi, jinja, whatever ... anything is better

Re: Unable to compile pyprocessing module on SUN solaris

2009-03-20 Thread Christian Heimes
Deepak Rokade wrote: How can I get rid of this ? Is this package not available for sun solaris ? Apparently Solaris doesn't support sem_timedwait(). You have to disable the feature in setup.py:: HAVE_SEM_TIMEDWAIT=0 Why are you using pyprocessing instead of multiprocessing? Christian --

Is there any way for a program to choose between 32 bit or 64-bit python dynamically?

2009-03-20 Thread srinivasan srinivas
Hi, Is thera any way for a program to choose between 32-bit or 64-bit dynamically? Thanks, Srini Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread venutaurus...@gmail.com
On Mar 20, 5:09 pm, Tim Golden m...@timgolden.me.uk wrote: Tino Wildenhain wrote: Tim Golden wrote: ... and do the following: code from winsys import fs for f in fs.flat (c:/temp):  f.dump ()          ^ eeek! Was the k! for the space before the bracket (which, for some

Re: improve this newbie code/nested functions in Python?

2009-03-20 Thread Esmail
Hi! On Mar 20, 1:06 am, Terry Reedy tjre...@udel.edu wrote: What you wrote are two nested classes, not functions.   Ooops .. yes of course .. simple mistake (it was late .. :) In my opinion, neither should be nested.  Nothing is gained and something is lost. Neither are used by client;

Re: PEP 3143: Standard daemon process library

2009-03-20 Thread Jean-Paul Calderone
On Fri, 20 Mar 2009 21:47:00 +1100, Ben Finney bignose+hates-s...@benfinney.id.au wrote: [snip] Somewhat by accident I noticed this other part of the PEP: Other Python daemon implementations that differ from this PEP: [snip] * Twisted [twisted]_ includes, perhaps unsurprisingly, an

Re: Unable to compile pyprocessing module on SUN solaris

2009-03-20 Thread Deepak Rokade
This did not wok. I continued to get those warning and Import Error. I wanr through documentation of multiprocessing and it looks almost similar to processing module. Any advantages of multiprocessing module ? On Fri, Mar 20, 2009 at 6:53 PM, Christian Heimes li...@cheimes.de wrote: Deepak

Compiling modules in OSX, eg PyUSB?

2009-03-20 Thread Dr Mephesto
Hi, I am using Leopard and MacPython, and I would like to access a USB device. I have installed libusb, and now I have tried to compile PyUSB from: http://sourceforge.net/projects/pyusb/ But when I compile I get lots of errors, ie: pcfr147:pyusb-0.4.1 david$ python setup.py install running

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread Tim Golden
venutaurus...@gmail.com wrote: Thank you for your suggestion but.. I'll have around 1000 such files in the whole directory and it becomes hard to manage such output because again I've to take this snapshot before backing up the data and have to do the same and compare both when the data gets

Re: Unable to compile pyprocessing module on SUN solaris

2009-03-20 Thread Christian Heimes
Deepak Rokade wrote: This did not wok. I continued to get those warning and Import Error. I wanr through documentation of multiprocessing and it looks almost similar to processing module. Any advantages of multiprocessing module ? You may have to disable more features and recompile

Re: Ordered Sets

2009-03-20 Thread Aahz
In article mailman.2269.1237548808.11746.python-l...@python.org, Nigel Rantor wig...@wiggly.org wrote: Aahz wrote: In article 9a5d59e1-2798-4864-a938-9b39792c5...@s9g2000prg.googlegroups.com, Raymond Hettinger pyt...@rcn.com wrote: Here's a new, fun recipe for you guys:

Re: file.read() doesn't read the whole file

2009-03-20 Thread Sreejith K
On Mar 20, 4:43 pm, R. David Murray rdmur...@bitdance.com wrote: Sreejith K sreejith...@gmail.com wrote: Hi, snapdir = './mango.txt_snaps' snap_cnt = 1 block = 0 import os os.chdir('/mnt/gfs_local') snap = open(snapdir + '/snap%s/%s' % (repr(snap_cnt), repr(block)),'r')

Re: Preparing teaching materials

2009-03-20 Thread Tim Golden
Michele Simionato wrote: The interesting thing is that Sphinx uses pygments and can highlight any code fragment, not only Python code. For instance, last week I did some experiment with Sphinx to convert my Adventures of a Pythonista in Schemeland (which contains Scheme code) to PDF and it

nested classes

2009-03-20 Thread Esmail
Hello all, I am curious why nested classes don't seem to be used much in Python. I see them as a great way to encapsulate related information, which is a good thing. In my other post improve this newbie code/nested functions in Python? (I accidentally referred to nested functions rather nested

Re: Compiling modules in OSX, eg PyUSB?

2009-03-20 Thread Philip Semanchuk
On Mar 20, 2009, at 9:48 AM, Dr Mephesto wrote: Hi, I am using Leopard and MacPython, and I would like to access a USB device. I have installed libusb, and now I have tried to compile PyUSB from: http://sourceforge.net/projects/pyusb/ But when I compile I get lots of errors, ie: Hi Dr. M.,

Re: Read a content file from a P7M

2009-03-20 Thread Emanuele Rocca
On 11/03/09 - 05:05, Luca wrote: There is standard or sugested way in python to read the content of a P7M file? I don't need no feature like verify sign, or sign using a certificate. I only need to extract the content file of the p7m (a doc, a pdf, ...) For PDF files you can just remove the

Re: Unable to compile pyprocessing module on SUN solaris

2009-03-20 Thread Deepak Rokade
Great ! It worked. I set HAVE_FD_TRANSFER = 0 and now that is working. I guess this feature should be for distributing task to remote machines... I do not require it as of now but any idea when this will be supported in multiprocessing ? Is this code not considered to support sun Solaris

get rid of duplicate elements in list without set

2009-03-20 Thread Alexzive
Hello there, I'd like to get the same result of set() but getting an indexable object. How to get this in an efficient way? Example using set A = [1, 2, 2 ,2 , 3 ,4] B= set(A) B = ([1, 2, 3, 4]) B[2] TypeError: unindexable object Many thanks, alex --

Re: Preparing teaching materials

2009-03-20 Thread Michele Simionato
On Mar 20, 3:05 pm, Tim Golden m...@timgolden.me.uk wrote: Michele Simionato wrote: http://www.phyast.pitt.edu/~micheles/scheme/TheAdventuresofaPythonist... (I think the OP may be interested in how the PDF output of Sphinx-generated documents may look like). That looks really snappy. Do

Re: blocked on futex

2009-03-20 Thread Aahz
[posted and e-mailed, please respond to newsgroup] In article 2961e0af-d99b-4d5e-a280-f521ce7fa...@e10g2000vbe.googlegroups.com, msoulier msoul...@digitaltorque.ca wrote: I'm using the Python packaged with CentOS 4.7, which is a patched 2.3.4. Yes, ancient but I can't do anything about it.

Re: locate items in matrix (index of lists of lists)

2009-03-20 Thread MRAB
Chris Rebert wrote: On Fri, Mar 20, 2009 at 4:34 AM, Alessandro Zivelonghi zasaconsult...@gmail.com wrote: Many Thanks guys! and what if I need to look ONLY into the second and third columns, excluding the first item of each rows? for example if x = 3 I need to get [0] and not [0,1]

Re: get rid of duplicate elements in list without set

2009-03-20 Thread Albert Hopkins
On Fri, 2009-03-20 at 07:16 -0700, Alexzive wrote: Hello there, I'd like to get the same result of set() but getting an indexable object. How to get this in an efficient way? Example using set A = [1, 2, 2 ,2 , 3 ,4] B= set(A) B = ([1, 2, 3, 4]) B[2] TypeError: unindexable

meta question - how to read comp.lang.python w/o usenet feed/google interface?

2009-03-20 Thread Esmail
Hi all, I've been reading/posting to usenet since the 80s with a variety of tools (vn, and most recently Thunderbird) but since my ISP (TimeWarner) no longer provides usenet feeds I'm stuck. I am not crazy about the web interface via google groups, is there another way to read/post this in a

Re: meta question - how to read comp.lang.python w/o usenet feed/google interface?

2009-03-20 Thread Esmail
I'd almost like to think there are a bunch of nice python programs out there that to this :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: meta question - how to read comp.lang.python w/o usenet feed/google interface?

2009-03-20 Thread Albert Hopkins
On Fri, 2009-03-20 at 07:42 -0700, Esmail wrote: Hi all, I've been reading/posting to usenet since the 80s with a variety of tools (vn, and most recently Thunderbird) but since my ISP (TimeWarner) no longer provides usenet feeds I'm stuck. I am not crazy about the web interface via google

Organize large DNA txt files

2009-03-20 Thread thomasvang...@gmail.com
Dear Fellow programmers, I'm using Python scripts too organize some rather large datasets describing DNA variation. Information is read, processed and written too a file in a sequential order, like this 1+ 1- 2+ 2- etc.. The files that i created contain positional information (nucleotide

Re: meta question - how to read comp.lang.python w/o usenet feed/google interface?

2009-03-20 Thread Mark Tolonen
Esmail ebo...@gmail.com wrote in message news:03081704-17b5-4c7d-82db-8efb7ebce...@q11g2000yqh.googlegroups.com... Hi all, I've been reading/posting to usenet since the 80s with a variety of tools (vn, and most recently Thunderbird) but since my ISP (TimeWarner) no longer provides usenet

Re: pylab plot_date problem

2009-03-20 Thread pylatino
On Mar 19, 2:02 am, Shah Sultan Alam ssa...@gmail.com wrote: Hi ,  I am using following code to create a graph def plot_plot():   ax = pylab.subplot(111)         for count in range(len(yaxes_values)):                 pylab.subplots_adjust(left=0.13, bottom=0.21, right=0.90,

Re: get rid of duplicate elements in list without set

2009-03-20 Thread thomasvang...@gmail.com
You could use: B=list(set(A)).sort() Hope that helps. T -- http://mail.python.org/mailman/listinfo/python-list

Holy hand grenade!

2009-03-20 Thread Aahz
http://www.telegraph.co.uk/news/newstopics/howaboutthat/5018294/Pub-evacuated-after-Monty-Python-prop-mistaken-for-grenade.html -- Aahz (a...@pythoncraft.com) * http://www.pythoncraft.com/ Programming language design is not a rational science. Most reasoning about it is at best

Re: get rid of duplicate elements in list without set

2009-03-20 Thread Albert Hopkins
On Fri, 2009-03-20 at 07:54 -0700, thomasvang...@gmail.com wrote: You could use: B=list(set(A)).sort() Hope that helps. Which will assign None to B. sorted(list(... or B.sort() is probably what you meant. -- http://mail.python.org/mailman/listinfo/python-list

Re: get rid of duplicate elements in list without set

2009-03-20 Thread Tino Wildenhain
thomasvang...@gmail.com wrote: You could use: B=list(set(A)).sort() Hope that helps. That would leave a B with value None :-) B=list(sorted(set(A)) could work. smime.p7s Description: S/MIME Cryptographic Signature -- http://mail.python.org/mailman/listinfo/python-list

Re: file.read() doesn't read the whole file

2009-03-20 Thread R. David Murray
On Fri, 20 Mar 2009 at 07:09, Sreejith K wrote: On Mar 20, 4:43?pm, R. David Murray rdmur...@bitdance.com wrote: Sreejith K sreejith...@gmail.com wrote: Hi, snapdir = './mango.txt_snaps' snap_cnt = 1 block = 0 import os os.chdir('/mnt/gfs_local') snap = open(snapdir + '/snap%s/%s' %

Re: get rid of duplicate elements in list without set

2009-03-20 Thread MRAB
Tino Wildenhain wrote: thomasvang...@gmail.com wrote: You could use: B=list(set(A)).sort() Hope that helps. That would leave a B with value None :-) B=list(sorted(set(A)) could work. sorted() accepts an iterable, eg a set, and returns a list: B = sorted(set(A)) --

Re: distutils compiler flags for extension modules

2009-03-20 Thread Floris Bruynooghe
On Mar 20, 9:48 am, Christian Meesters meest...@gmx.de wrote: as I got no answers with the previous question (subject: disabling compiler flags in distutils), I thought I should ask the question in a different way: Is there an option to set the compiler flags for a C/C++ extension in

Re: get rid of duplicate elements in list without set

2009-03-20 Thread Paul McGuire
On Mar 20, 9:54 am, thomasvang...@gmail.com thomasvang...@gmail.com wrote: You could use: B=list(set(A)).sort() Hope that helps. T That may hurt more than help, sort() only works in-place, and does *not* return the sorted list. For that you want the global built-in sorted: data = map(int,6

  1   2   3   4   >