Re: Game programming for kids: looking for open source 2D game development kit

2007-03-30 Thread Laurent Pointal
John Salerno wrote: > Laurent Pointal wrote: > >> With Python: >> * pygame + build your drag'n drop features >> * if you like 3D, vpython. >> >> >> http://www.pygame.org/ >> http://www.vpython.org/ > > Wow, vpython looks pretty n

Re: Newbie Question (real-time communication between apps: audio, 3d, PD, Blender)

2007-03-31 Thread Laurent Pointal
ou may write long computing code into a separate C module or library (may see ctypes and pyrex). Another point, if you build Python multithreading code in same process, the Global Lock may lead to unefficient use of your computing capacities. Note. You may take a look at OSC (Open Sound Control

Re: Remote XML Parsing

2007-03-31 Thread Laurent Pointal
[EMAIL PROTECTED] wrote: > On Mar 30, 5:56 pm, Laurent Pointal <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] a écrit : >> >> > How can I parse a remote XML file with Python? >> > And what will I be able to do with this XML file in Python? >> >>

Re: reverse engineering Excel spreadsheet

2007-04-01 Thread Laurent Pointal
Duncan Smith wrote: > Hello, > I am currently implementing (mainly in Python) 'models' that come > to me as Excel spreadsheets, with little additional information. I am > expected to use these models in a web application. Some contain many > worksheets and various macros. > > What I'd like

Re: Python Based API

2007-04-01 Thread Laurent Pointal
[EMAIL PROTECTED] wrote: > Hi, > > I work on a project that is built entirely using python and Tkinter. > We are at the point where we would like to give access to our > functionality to others via some sort of API. People who would use > our API develop in all kinds of languages from C/C++ to P

Re: Problem with global variables

2007-04-02 Thread Laurent Pointal
e it! To complete hg reply, Python compile your tiny function which contains a foo assignment. As foo is not defined "global", it is considered to be local. So the error when you tries to iterate throught foo before assigning it. And so the solution to add "global foo" before using it. A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with global variables

2007-04-02 Thread Laurent Pointal
Bjoern Schliessmann wrote: > Laurent Pointal wrote: > >> And so the solution to add "global foo" before using it. > > Didn't you read his final question? Yes, and i replies: "which contains a foo assignment. As foo is not defined "global", it is

Re: Python "with"

2007-09-17 Thread Laurent Pointal
Ivan Voras a écrit : > I know it can be almost always done by using a temporary variable: > > tmp = some.big.structure.or.nested.objects.element > tmp.member1 = something > tmp.member2 = something > > but this looks ugly to me.) The ugly part is the 'tmp' name, try to choose a name with a prope

Re: SVG to raster conversion.

2007-09-17 Thread Laurent Pointal
dpi) > raster_image.write(out_file) > > Thanks for any pointers you might have. Another link to complement other replies: Maybe witgh Cairo: Library: http://cairographics.org/ SVG support: http://cairographics.org/manual/cairo-SVG-Surfaces.html Python binding: http://cairographics.or

Re: Python "with"

2007-09-17 Thread Laurent Pointal
Ivan Voras a écrit : > Laurent Pointal wrote: > >> The ugly part is the 'tmp' name, try to choose a name with a proper >> meaning about what it is really, and it become clean and readable: >> >> filerefs = some.big.structure.or.nested.object.with.file.

Re: Saving parameters between Python applications?

2007-09-17 Thread Laurent Pointal
Stodge a écrit : > I'm trying to do the following. I have a Python application that is > run: > > python app1.py --location=c:\test1 > > What I want to do is save the location parameter, so I can then do (in > the same window): > > python app2.py > > And have app2.py automatically have access t

Re: The meaning of a = b in object oriented languages

2007-09-18 Thread Laurent Pointal
Summercool a écrit : > > > The meaning of a = b in object oriented languages. > Oups, reading the subject I thought it was a Xah Lee post. ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question

2007-09-18 Thread Laurent Pointal
[EMAIL PROTECTED] wrote: > If I have a file name: AVC1030708.14. How do I strip out certain > characters from the file name? I am so used to using MID, LEFT, and > RIGHT functions, that I have no idea how to do this in python? I have > had trouble as well with most newbies on finding the help.

Re: Extracting xml from html

2007-09-19 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : > On Sep 18, 1:56 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> I am attempting to extract some XML from an HTML document that I get >>> returned from a form based web page. For some reason, I cannot figure >>> out how to do this. >>> Here'

lxml codespeak pages empty ?

2007-09-19 Thread Laurent Pointal
I can no longer get codespeak's lxml page at http://codespeak.net/lxml/ (get an empty HTML document )... Am-I alone in this case ? Any codespeaker reading ? A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: lxml codespeak pages empty ? Come back.

2007-09-19 Thread Laurent Pointal
Laurent Pointal a écrit : > I can no longer get codespeak's lxml page at http://codespeak.net/lxml/ > (get an empty HTML document Transitional//EN">)... > > > Am-I alone in this case ? > Any codespeaker reading ? It magically come-back -- http://mail.pyt

lxml and identification of elements in source

2007-09-19 Thread Laurent Pointal
cross-reference by example), is there a way to get the source-file and line/column of an element ? [note: these informations are available when lxml parse the source, but are they kept anywhere in the document tree ?] Thanks. Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting numbers to unicode charaters

2007-09-24 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : > Here's how I'm doing this right now, It's a bit slow. I've just got > the code working. I was wondering if there is a more efficient way of > doing this... simple example from interactive Python: > word = '' hexs = ['42', '72', '61', '64'] for h in hexs

Re: Fwd: Using fractions instead of floats

2007-10-01 Thread Laurent Pointal
Andres Riofrio a écrit : > Well, then I have > a question: Is there a way to make 5/2 return something other than an > integer? >>> from __future__ import division >>> 5/2 2.5 -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: magnitude 0.9.1

2007-10-16 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : > I am happy to announce the first release of magnitude, a > library for computing with physical quantities. It is > released under the Apache v. 2 license. > > A physical quantity is a number with a unit, like 10 > km/h. Units can be any of the SI units, plus a bunch o

Re: Parallel insert to postgresql with thread

2007-10-26 Thread Laurent Pointal
s may share the module, but not connections. 2 Threads may share the module and connections. 3 Threads may share the module, connections and cursors. """ http://www.python.org/dev/peps/pep-0249/ -- Laurent POINTAL - [EM

Re: How python writes text into another windows application

2007-10-30 Thread Laurent Pointal
tion via its gui. http://sourceforge.net/projects/pywinauto -- Laurent POINTAL - [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Establishing if an Object is Defined

2007-01-10 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : > Hi, > > The following code works - > > one = 1 > if one == 1: > ok = 1 > print ok > > but this does not, without exception - > > one = 2 > if one == 1: > ok = 1 > print ok > > How do I establish before printing ok if it actually exists so as to > avoid this ex

Re: convert binary data to int

2007-01-10 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : > Hello, > > > I need to convert a 3 byte binary string like > "\x41\x00\x00" to 3 int values ( (65,0,0) in this case). > The string might contain characters not escaped with a \x, like > "A\x00\x00" > > > Any ideas? >>> s = "\x41\x00\x00" >>> [ ord(c) for c in s ]

Re: maximum number of threads

2007-01-10 Thread Laurent Pointal
Paul Sijben a écrit : > Gabriel Genellina wrote: >> Simply you can't, as you can't have 1 open files at once. Computer >> resources are not infinite. > > sure but *how* fast they run out is the issue here > >> Do you really need so many threads? > > I might be able to do with a few less but

Re: Print message with Colors

2007-01-11 Thread Laurent Pointal
prk a écrit : > Hi Folks, > > Is there any procesure for print messages with colors. Yes, see: http://www.google.fr/search?q=python+print+color http://groups.google.fr/groups?as_q=python+print+color&num=100&as_ugroup=comp.lang.python See also ANSI escape sequences for the more general subject

Re: Read from database, write to another database, simultaneously

2007-01-11 Thread Laurent Pointal
Bjoern Schliessmann a écrit : > Sean Davis wrote: > >> The author of one of the python database clients mentioned that >> using one thread to retrieve the data from the oracle database and >> another to insert the data into postgresql with something like a >> pipe between the two threads might mak

Re: pygame and python 2.5

2007-01-12 Thread Laurent Pointal
siggi a écrit : > Hi all, > > when I rtry to install pygame (pygame-1.7.1release.win32-py2.4.exe, the most > ciurrent version I found) it requires Python 2.4! Will I really have to > uninstall my Python 2.5 and install the old Python 2.4 in order to use > pygame? Note: You can have both versions

Re: getting the name of hyperlinks in a file

2007-01-15 Thread Laurent Rahuel
,%20**kwargs) Regards, Laurent CSUIDL PROGRAMMEr wrote: > folks, > I am trying to write a script that would open a download server and > download all the files and store them in a list > > for example Download server is > http://download.fedora.redhat.com/pub/fedora/linux/co

Re: check if there is data in stdin without blocking

2007-01-15 Thread Laurent Pointal
hg a écrit : > hg wrote: > >> Hi, >> >> Is there a way ? ... select ? >> >> >> >> hg > PS: > > import sys > import select > > l_r = select.select([sys.stdin],[],[],0) > > gives me: > File "select.py", line 2, in ? > import select > File "/home/philippe/Desktop/select.py", line 4, in ? >

Re: Python Windows Editors

2007-01-21 Thread laurent rahuel
Hi, I guess you could take a look at pydev extension for eclipse and if you wan't an almost straight forward installation, you should consider this link : http://www.easyeclipse.org/site/distributions/python.html Regards, Laurent W. Watson a écrit : > I downloaded python-2.5

Re: Python Windows Editors

2007-01-23 Thread Laurent Pointal
dn't discover: > 1. Time is money. > 2. Matter will be damaged in direct proportion > to its value. Have you take a look at the IDEs page in the Python Wiki (python.org)? http://wiki.python.org/moin/IntegratedDevelopmentEnvironments A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: beep or sound playing under linux

2007-01-23 Thread Laurent Pointal
hg a écrit : > Hi, > > Is there a way to do that ? > > Regards, > > hg > Some links: Official doc: http://docs.python.org/lib/mmedia.html ==> http://docs.python.org/lib/module-ossaudiodev.html PyAudio (binding to portaudio): ==> http://people.csail.mit.edu/hubert/pyaudio/ Maybe with pyG

Re: Removing outdated files

2007-01-23 Thread Laurent Pointal
Jan Danielsson a écrit : > Hello all, > >I have a backup system which produces files using the following pattern: ... > >Obviously, I have little need for *all* those files. What I want to > do is to delete old files according to this pattern: > >- Keep all backup files which are two

Re: Python Windows Editors

2007-01-23 Thread Laurent Pointal
stef a écrit : > Laurent Pointal wrote: >> W. Watson a écrit : >> >>> I downloaded python-2.5.msi and installed it. I believe its editor is >>> IDE. I understand there's a Win editor called pythonwin. I believe it's >>> in the download p

Re: I need suggests

2007-01-23 Thread Laurent Pointal
oks: http://wiki.python.org/moin/PythonBooks You may get more help in c.l.python about book choice by explaining to readers what is your computer science knowledge level, and what is the domain of this big program (text processing, network, GUI...). A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: My python programs need a GUI, wxPython or PyQt4?

2007-01-24 Thread Laurent Rahuel
Hi, I known this can be impossible but what about an "HTML" GUI ? Daniel Jonsson wrote: > So, I've reached the point where my building pipeline tools actually > needs to be used by other people in my company. By this reason I > actually need to think about the usability, and I've come to the > c

Re: how to remove c++ comments from a cpp file?

2007-01-26 Thread Laurent Rahuel
And using the codecs module [CODE] import codecs f = codecs.open("show_btchina.user.js","r","utf-8") modf = codecs.open("modified.js","w","utf-8") for line in f: idx = line.find(u"//") if idx==0: continue elif idx>0: line = line[:idx]+u'\n' modf.write(line) m

Re: Yank Bastards KILLED THEIR OWN PEOPLE to stage 911 DRAMA

2007-01-29 Thread Laurent Pointal
its very hard to ban people (or better, ban out-of-subject posts) from non-moderated Usenet newsgroups. A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: "Correct" db adapter

2007-01-31 Thread Laurent Rahuel
Maybe you should take a look at sqlalchemy king kikapu wrote: > Hi to all, > > i have started a month ago to seriously studying Python. I am now > looking at the databases stuff > and i want the opinion of more experienced Python programmers (than > me) at the following : > > I see that there a

Re: Why does this not work?

2007-02-02 Thread Laurent Pointal
le." -Calvin > > > What about this: > class Object(object):pass > myobj=Object() > myobj.newattr=5 > > and it works !!! > Python allows the dynamic creation of attributes for an instance of an > object. See previous discussion in this group "Re: Why don't have an object() instance a __dict__ attribute by default?" (2007-01-30) http://groups.google.fr/group/comp.lang.python/browse_thread/thread/a7e952d01b2eea68/961dec95bc20877e?lnk=st&q=&rnum=1#961dec95bc20877e A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie/ merging lists of lists with items in common

2007-02-02 Thread Laurent Pointal
ardief a écrit : > Hi everyone > Here is my problem: > I have a list that looks like this - > [['a', '13'], ['a', '3'], ['b', '6'], ['c', '12'], ['c', '15'], ['c', > '4'], ['d', '2'], ['e', '11'], ['e', '5'], ['e', '16'], ['e', '7']] > > and I would like to end up with something like this, i.e. wi

Re: newbie/ merging lists of lists with items in common

2007-02-02 Thread Laurent Pointal
Neil Cerutti a écrit : > On 2007-02-02, ardief <[EMAIL PROTECTED]> wrote: > This is a job for... duhn-duhn-DH! Captain CHAOS! > > Er... I mean itertools.groupby. > > def key_func(t): > return t[0] Not needed: --> from operator import itemgetter See in the example: http://docs

Re: when will python 2.5 take in mainstream?

2007-02-05 Thread Laurent Pointal
nder Python 2.5, then you can have both Python 2.4 and 2.5 installed and running some code. Setup Pyro [1] on both, and go throught remote object invocation. And if you dont need new Python 2.5 stuff in your code evolution, just stay with 2.4, it works well. A+ Laurent. [1] http://pyro.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.0 (Was: when will python 2.5 take in mainstream?)

2007-02-05 Thread Laurent Pointal
Steven Bethard a écrit : > Laurent Pointal wrote: >> For Python 3.0, AFAIK its a big rewrite and developers know that it will >> be uncompatible in large parts with existing code. > > Wrong on both counts. ;-) Python 3.0 is not a rewrite. It's based on the > same c

Re: when will python 2.5 take in mainstream?

2007-02-05 Thread Laurent Pointal
Jean-Paul Calderone a écrit : > On Mon, 05 Feb 2007 10:19:26 +0100, Laurent Pointal > <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] a écrit : >>> When they have to ... >>> >>> One of the big things about Python is that its penetration sl

Re: Calling J from Python

2007-02-05 Thread Laurent Pointal
Diez B. Roggisch wrote: > m=: >@(0&{) > v=: >@(1&{) > h=: >@(2&{) > qu =: >@(3&{) > z=: [EMAIL PROTECTED]: > ret =: |[EMAIL PROTECTED]: > init =: z;z;z;i. > f1m =: (m,[EMAIL PROTECTED]);v;h;[EMAIL PROTECTED] > f5m =: (z;(v,{:@m);h;qu,[EMAIL PROTECTED]) @ (f1m^:5) > f1h =: (z;

Re: Calling J from Python

2007-02-05 Thread Laurent Pointal
Bruno Desthuilliers wrote: > Gosi a écrit : >> On Feb 5, 2:59 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> J has very many advanced operations. > > what's an "advanced operation" ? An operation which dont stay in place. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python cheatsheets

2007-02-06 Thread Laurent Pointal
Bart Ogryczak wrote: > On Jan 7, 10:03 pm, gonzlobo <[EMAIL PROTECTED]> wrote: >> Curious if anyone has a python cheatsheet* published? I'm looking for >> something that summarizes all commands/functions/attributes. Having >> these printed on a 8" x 11" double-sided laminated paper is pretty >> c

Re: How to prevent from race conditions to share data between many process and thread in python

2007-02-07 Thread Laurent Pointal
test/choose one solution... http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252495 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203 ... A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: Formatting milliseconds to certain String

2007-02-12 Thread Laurent Pointal
0 - secs * 1000 ... return "%(hours)02d:%(mins)02d:%(secs)02d,%(millis)03d"%locals() ... >>> millisToFormat(185804 ) '00:03:05,804' See chapter "3.6.2 String Formatting Operations" in the Python Library Reference. http://docs.python.org/lib/typesseq-strings.html A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with Optimization of Python software: real-time audio controller

2007-02-12 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : > As mentioned above, my application deals with music training. I have a > Tkinter GUI, which communicates via pyserial with an external device I > built myself. The code reads in a MIDI file and converts the song to > "output data " for the external device and the GUI,

Re: The Python interactive interpreter has no command history

2007-02-15 Thread Laurent Rahuel
Hi, You need to have readline installed. Laurent ThomasC wrote: > Hello, > > How to configure Python2.5's interactive interpreter to get command > history ? > > I always got ^[[A and ^[[B . > > Thank you !! > > Thomas# -- http://mail.python.org/mailman/listinfo/python-list

Re: WHAT IS THIS?

2007-02-17 Thread Laurent Pointal
Captain wrote: > Just bought a new PC with Windows XP Media Edition. I have two entries in > the "Add or Remove Programs" section of Control Panel, but there is no > corresponding item in the Start Menu. One entry says: Python 2.2.3 and > the > other says: Python 2.2 pywin32 extensions (build203

Re: Help Required for Choosing Programming Language

2007-02-20 Thread Laurent Pointal
Mark Morss a écrit : > On Feb 16, 4:22 pm, [EMAIL PROTECTED] wrote: >> I am VB6 programmer and wants to start new programming language but i >> am unable to deciced. >> >> i have read about Python, Ruby and Visual C++. but i want to go >> through with GUI based programming language like VB.net >> >

Re: Weird result returned from adding floats depending on order I add them

2007-02-20 Thread Laurent Pointal
joanne matthews (RRes-Roth) a écrit : > I'm getting different results when I add up a list of floats depending > on the order that I list the floats. For example, the following returns > False: > def check(): > totalProp=0 > inputs=[0.2,0.2,0.2,0.1,0.2,0,0.1] > for each in inputs:

Re: ocaml to python

2007-02-20 Thread Laurent Pointal
Gigs_ wrote: > Is there any way to convert ocaml code to python? but not manually For Python and ocaml, my bookmark contains this link: http://www.programs4all.net/programs/Pycaml-Python-Embedding-API-for-Ocaml.htm But no ocaml to Python compiler... -- http://mail.python.org/mailman/listinfo/

Re: eval('000052') = 42?

2007-02-21 Thread Laurent Pointal
e (and beginning by 0x it is interpreted as hexadecimal value). You may use int construction from string, which allow to specify a base (default to ten): >>> int('00052') 52 >>> int('00052',10) 52 >>> int('00052',8) 42 Note: thi

Re: converting u'11\xa022' to '11\xa022'

2007-02-21 Thread Laurent Pointal
Gabriel Genellina a écrit : > En Wed, 21 Feb 2007 00:31:32 -0300, alf <[EMAIL PROTECTED]> escribió: >> 2-list of supported encodings? > I don't know how to query the list, except by reading the documentation > for the codecs module. >>> from encodings import aliases >>> aliases.aliases {'iso_

Re: Europe Tests Established Chemicals on Millions of Animals

2007-02-23 Thread Laurent Pointal
You help nothing by posting subjects unrelated to the *programming language* Python into a usenet group about this language. -- http://mail.python.org/mailman/listinfo/python-list

Re: Lib for audio?

2007-11-29 Thread Laurent Pointal
Dave a écrit : > I need to read microphone input and determine frequency. Is there a lib > for that? > > Thanks, > Dave Another possible solution, the PortAudio binding (pyportaudio). http://people.csail.mit.edu/hubert/pyaudio/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Generating API documentation as a textfile

2007-12-04 Thread Laurent Pointal
MonkeeSage a écrit : > On Dec 3, 8:58 am, Samuel <[EMAIL PROTECTED]> wrote: >> On Mon, 03 Dec 2007 06:45:45 -0800, Giampaolo Rodola' wrote: >>> dir.__doc__ >> This contains only the docstring one object (module, class, >> function, ...). I was thinking more of the complete API documentation >> that

Re: Some python syntax that I'm not getting

2007-12-07 Thread Laurent Pointal
Chris a écrit : > On Dec 7, 2:31 pm, waltbrad <[EMAIL PROTECTED]> wrote: >> I understand how D['say'] gets you 5, But I still don't understand >> the line after the 5. >> >> How is the character 's' some special code? And I don't get what is >> going on with the % character. I'm used to it's use

Re: Writing backwards compatible code - when?

2006-04-24 Thread Laurent Pointal
's a reference that stops at 2.3: > > http://rgruet.free.fr/PQR2.3.html Remove the 2.3, and you get the 2.4 :-) http://rgruet.free.fr/ A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python editor recommendation.

2006-05-11 Thread Laurent Pointal
Dale Strickland-Clark a écrit : > Vim. > > Everything else is Notepad. ++, yes Notepad++ !!! (windows only) See http://notepad-plus.sourceforge.net/uk/site.htm :-) > > DeepBlue wrote: > >> Hi all, >> >> Can any one please recommend me an editor for coding Python. Thank u. >> I have Komodo (

Re: WTF? Printing unicode strings

2006-05-19 Thread Laurent Pointal
t;, line 1, in ? > UnicodeEncodeError: 'ascii' codec can't encode character u'\xbd' in > position 0: ordinal not in range(128) This is default encoding for evaluation of expressions in u"..." strings, this has nothing to do with printing. For the output encoding, see sys.stdout.encoding. >>> import sys >>> sys.stdout.encoding 'cp850' >>> A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: Includeing Python in text files

2006-05-22 Thread Laurent Pointal
): The current date is <% import time print time.strftime("%d:%m:%y",time.localtime(time.time())) %> See http://karrigell.sourceforge.net/ A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: enumerate() question

2006-05-22 Thread Laurent Pointal
Gregory Petrosyan a écrit : > Hello! > I have a question for the developer[s] of enumerate(). Consider the > following code: > > for x,y in coords(dots): > print x, y > > When I want to iterate over enumerated sequence I expect this to work: > > for i,x,y in enumerate(coords(dots)): > pr

Re: Testing for file type

2006-05-22 Thread Laurent Pointal
Andrew Robert a écrit : > Hi Everyone, > > Is there a way to test if a file is binary or ascii within Python? > > I'd prefer not to text against file extension. > > Any help you can provide would be greatly appreciated. May look at unix "file" command sources... A+ L.Pointal. -- http://mail

Re: Importing java within python

2008-01-17 Thread Laurent Pointal
Thanks everyone... >> -- >> http://mail.python.org/mailman/listinfo/python-list >> To complement Henry Chang reply, you can also take a look at: http://jpype.sourceforge.net/ (Java To Python Integration) http://jepp.sourceforge.net/ (Java Embeded Python) See my other Python/Java links at http://w

Re: Pythonland documentation

2008-01-19 Thread Laurent Pointal
x27;ve been used to > doxygen in c++ land, and although it makes a reasonable stab with a > python project in java mode, the output is a bit messy. > > Can any one suggest a more tailored tool? or do I risk a flamewar? :) You can take a look at epydoc http://epydoc.sourceforge.net/

Re: dream hardware

2008-02-13 Thread Laurent Pointal
Le Tue, 12 Feb 2008 10:05:59 -0800, castironpi a écrit : > What is dream hardware for the Python interpreter? Dream... I dont know, but hardware for the Python interpreter, yes. http://www.telit.co.it/product.asp?productId=96 -- Laurent POINTAL - [EMAIL PROTECTED] -- http://mail.python.

Re: Creating 50K text files in python

2009-03-18 Thread Laurent Rahuel
x27; %j) Here are the results on a ext3 file system time python test.py real0m5.299s user 0m0.939s sys 0m3.539s Regards, Laurent venutaurus...@gmail.com a écrit : On Mar 18, 6:35 pm, Peter Otten <__pete...@web.de> wrote: venutaurus...@gmail.com wrote: Hello all, I

strip char from list of strings

2009-05-19 Thread Laurent Luce
I have the following list: [ 'test\n', test2\n', 'test3\n' ] I want to remove the '\n' from each string in place, what is the most efficient way to do that ? Regards, Laurent -- http://mail.python.org/mailman/listinfo/python-list

Re: strip char from list of strings

2009-05-19 Thread Laurent Luce
I had a simple loop stripping each string but I was looking for something concise and efficient. I like the following answer: x = [s.rstrip('\n') for s in x] David Stanek wrote: > On Mon, May 18, 2009 at 3:30 PM, Laurent Luce wrote: >> I have the following list: >&g

Re: strip char from list of strings

2009-05-19 Thread Laurent Luce
Thanks Casey. I like your solution. Casey Webster wrote: > On May 18, 3:30 pm, Laurent Luce wrote: >> I have the following list: >> >> [ 'test\n', test2\n', 'test3\n' ] >> >> I want to remove the '\n' from each string in

Re: Python in non-standard location erring with "No module named _sha256"

2008-05-21 Thread Laurent Rahuel
Maybe you run the configure, make, make install without addind devel packages on your system. I mean: openssl-devel readline-devel ... Regards, emallove wrote: > I'm running into the below "No modules named _sha256" issue, with a > python installed in a non-standard location. > > $ python > Py

Re: read file into list of lists

2008-07-11 Thread Laurent Rahuel
Hello, A way to do it === from __future__ import with_statement res = [] with open("sentences.txt","r") as f: sentences = [elem for elem in f.read().split('\n') if elem] for sentence in sentences: res.append(sentence.split()) p

Re: Where can I find :

2008-03-31 Thread Laurent Pointal
into Python", there is an online version, translation in some languages other than english (if needed). It propose a line by line explanation on many scripts targetting language and libraries usage. http://www.diveintopython.org/ -- Laurent POINTAL - [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python in High School

2008-04-01 Thread Laurent Pointal
hat, given your available time, > would you be proficient enough to teach it? And if you want to do easy and simple 3D graphics programming, look at VPython http://www.vpython.org/ -- Laurent POINTAL - [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: webcam (usb) access under Ubuntu

2008-04-15 Thread Laurent Pointal
ust a wrapper to V4L2, so you must know what options and image format your camera support and use these (you may have to convert image by yourself - see PIL and Numpy for quick data processing functions). To find the supported options you can use xawtv and give it ad-hoc cli option to make it verbose. A+ Laurent. -- Laurent POINTAL - [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading binary from a file...

2006-03-08 Thread Laurent Pointal
eric etc >> etc... >> > You really want the struct module here. If all data are same 16 bits integer values, you can also see the array module (and the fromfile() method - see docs). A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: Send email notification

2006-03-08 Thread Laurent Pointal
module here: http://nojhan.free.fr/article.php3?id_article=22 Else, see other posts. A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to comment lot of lines in python

2006-03-30 Thread Laurent Rahuel
[EMAIL PROTECTED] wrote: > Like in C we comment like > /* > Bunch of lines of code > */ > > Should we use docstring """ """ > > Or there is something else too ?? > > Every help is appreciated. > > Thanks Hi, Maybe this sounds simplier than regexp and so, just use the """ marker like this : "

Re: Connecting to gnuplot with Popen?

2006-03-31 Thread Laurent Pointal
t-py.sourceforge.net/ A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

LaTeX parser and pstricks generator in python

2010-02-14 Thread Laurent Claessens
x file and take information about the values \label and \ref Every comments (and patches) are much welcome ! Have a good day Laurent [1] http://www.gitorious.org/phystricks [2] http://www.gitorious.org/latexparser [3] http://www.gitorious.org/phystricks-doc [4] http://www.gitorious.org/phys

Communicating with a program using subprocess

2010-06-17 Thread Laurent Verweijen
I have a file called increment.py as follows: #!/usr/bin/python n = 0 while True: n = int(raw_input(n)) + 1 This is easy to understand, but I want to pipe it's input/output by another python program. (I will show what I

Running a program from another program.

2010-06-17 Thread Laurent Verweijen
I have a program called increment.py as follows: #!/usr/bin/python n = 0 while True: n = int(raw_input(n)) + 1 This is probably very easy to understand, but I want to run this program from another python program. Below is an attempt

Re: how to get bit info

2010-06-17 Thread Laurent Verweijen
Op donderdag 17-06-2010 om 12:51 uur [tijdzone -0700], schreef Back9: > Hi, > > I have one byte data and want to know each bit info, > I mean how I can know each bit is set or not? > > TIA def bitset(x, n): """Return whether nth bit of x was set""" return bool(x & (1 << n)) -- http://mail.pyt

Re: Running a program from another program.

2010-06-17 Thread Laurent Verweijen
Op donderdag 17-06-2010 om 13:01 uur [tijdzone -0700], schreef Stephen Hansen: > On 6/17/10 12:13 PM, Laurent Verweijen wrote: > > How do I make sure the inputstream stays open after the first call to > > communicate? > > This was just asked a few days ago in different

Re: Running a program from another program.

2010-06-17 Thread Laurent Verweijen
Op donderdag 17-06-2010 om 13:48 uur [tijdzone -0700], schreef Stephen Hansen: > On 6/17/10 1:42 PM, Laurent Verweijen wrote: > > I tried putting what Ian Kelly said in my code, by it doesn't work for > > me. > > > > Python 2.6.5 (r265:79063, Apr 16 2010, 13:5

Re: Running a program from another program.

2010-06-17 Thread Laurent Verweijen
Op donderdag 17-06-2010 om 23:09 uur [tijdzone +0200], schreef Laurent Verweijen: > Op donderdag 17-06-2010 om 13:48 uur [tijdzone -0700], schreef Stephen > Hansen: > > On 6/17/10 1:42 PM, Laurent Verweijen wrote: > > > I tried putting what Ian Kelly said in my code, b

Re: Running a program from another program.

2010-06-17 Thread Laurent Verweijen
Op donderdag 17-06-2010 om 14:36 uur [tijdzone -0700], schreef Stephen Hansen: > On 6/17/10 2:09 PM, Laurent Verweijen wrote: > > It just gives me an empty string. > > > > Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) > > [GCC 4.4.3] on linux2 > > Type

Re: Running a program from another program.

2010-06-17 Thread Laurent Verweijen
Op donderdag 17-06-2010 om 14:48 uur [tijdzone -0700], schreef Stephen Hansen: > On 6/17/10 2:40 PM, Laurent Verweijen wrote: > > Op donderdag 17-06-2010 om 14:36 uur [tijdzone -0700], schreef Stephen > > Hansen: > >> On 6/17/10 2:09 PM, Laurent Verweijen wrote: > &g

Re: Running a program from another program.

2010-06-18 Thread Laurent Verweijen
Op donderdag 17-06-2010 om 15:16 uur [tijdzone -0700], schreef Stephen Hansen: > On 6/17/10 3:06 PM, Laurent Verweijen wrote: > >> > >> In your other thread you include an actual traceback: > >> > >> Traceback (most recent call last): > &

Re: I strongly dislike Python 3

2010-06-26 Thread Laurent Verweijen
Since I was relatively new to python when python 3 was released (I'm using it since python 2.5) I don't really care about the print statement. Making print a function makes print less an exception since all other functions need brackets. I also like most of the other changes in python 3 like float

Scan until random delimiter.

2010-06-27 Thread Laurent Verweijen
In contrast to java or c python seems not be able to use a random delimiter. In java, you can do: Code: import java.util.Scanner Scanner sc = new Scanner(System.in).useSeperator(" ") int a = sc.nextInt() But in python there seems to be no other option then waiting until you see a newline. I

windows explorer integration

2009-07-10 Thread Laurent Luce
Hello, Do you know if it is possible to write a plugin for windows explorer using win32 module ? The idea is to modify the way the folders/files are displayed in the explorer window and also to provide some controls. Laurent -- http://mail.python.org/mailman/listinfo/python-list

unicode + xml

2009-09-07 Thread Laurent Luce
for each unicode character: ie: /ufffdX Should I format the data differently inside the xml so minidom is happy ? Laurent -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode + xml

2009-09-07 Thread Laurent Luce
The xml data is generated on Windows (python 2.6.2) and sent using a post request to a Django server. The django server is running on Ubuntu server with python 2.6.2. The post data is passed to minidom for parsing. Laurent - Original Message From: Mark Tolonen To: python-list

<    1   2   3   4   5   >