Update to Python 3 Cheat Sheet

2017-01-28 Thread Laurent Pointal
Hi, I updated the cheat sheet on the aesthetic side. Parts bloc and their title are now more easily identified with colors (but its nice with B&W printing too). French and german versions have also been updated. See https://perso.limsi.fr/pointal/python:memento A+ L.Pointal. -- https://mail.p

[ANN] German translation of Python 3 Cheat Sheet

2016-09-14 Thread Laurent Pointal
Hello, The Python 3 Sheet Cheat (Mémento Bases Python 3) has been translated into german by StR Martin Putzlocher. Thanks to him. It can be downloaded on the same page as english and french versions: https://perso.limsi.fr/pointal/python:memento A+ L.Pointal. -- https://mail.python.org/mailman

Re: logging: getLogger() or getLogger(__name__)?

2016-07-27 Thread Laurent Pointal
Malcolm Greene wrote: > I've read that best practice for logging is to place the following line > at the top of all modules: > > logger = getLogger(__name__) > > I'm curious why the following technique wouldn't be a better choice: > > logger = getLogger() > > Are there scenarios that favor

Re: an error

2016-07-19 Thread Laurent Pointal
WePlayGames WeEnjoyIt wrote: > elif p2==8: >pygame1.blit(image3,(143,146) <= missing ) > total+=1 > fps=40 > clockfps.tick(fps) > pygame.display.update() > > the problem with this is that i get an syntax error at the very end at the > TOTAL+=1 when i delete this it tells me

Re: Touch screen development in Python

2016-07-13 Thread Laurent Pointal
Jahn wrote: > I was thinking about Python touch screen applications for industrial > boards( computers). > If I have a touch screen with that industrial board, what I must have > installed to be able to > write touch screen applications in Python? If you go with Kivy (its built for multitouch g

Re: Touch screen development in Python

2016-07-11 Thread Laurent Pointal
Jahn wrote: > Hi , > Does anyone use Python for developping applications that work with a > touch screen? You should take a look at Kivy: https://kivy.org/ A+ L.Pointal. -- https://mail.python.org/mailman/listinfo/python-list

Re: What the deal with python3.5m.so and python3.5.so ??

2016-07-03 Thread Laurent Pointal
Steven Truppe wrote: > Hi all, > > can someone tell me the difference between python3.5m.so and python3.5.so > ?? The 'm' tagged version is for a Python compiled with PyMalloc: https://www.python.org/dev/peps/pep-3149/ (found it with Blender's bundled Python) > > Tanks in advance, > Steven T

Re: I need a pure python module from PyPI without additional packages on my OS.

2016-07-03 Thread Laurent Pointal
Seti Volkylany wrote: > I heard about cairo, but it required installed on my computer before. Some precision would be wellcome. Do you need any pure Python module from PyPI ? Do you need a "cairo compatible" pure Python module from PyPI ? A+ L.P. -- https://mail.python.org/mailman/listinfo/py

Re: Request for opinions: A cross language development tool

2016-06-23 Thread Laurent Pointal
Tal Zion wrote: > Bridge compiles Python modules into native code, What is "native", really microprocessor executable binary ? How do you adapt to diversity? > which requires us to > support Python *language* features (for, while, class, generators, etc) > but it reuses CPython's libraries (li

Re: A tough one: split on word length?

2016-05-16 Thread Laurent Pointal
DFS wrote: > Have: > '584323 Fri 13 May 2016 17:37:01 - (UTC) 584324 Fri 13 May 2016 > 13:44:40 -0400 584325 13 May 2016 17:45:25 GMT 584326 Fri 13 May 2016 > 13:47:28 -0400' > > Want: > [('584323', 'Fri 13 May 2016 17:37:01 - (UTC)'), >('584324', 'Fri 13 May 2016 13:44:40 -0400'), >

Re: Performance with and without the garbage collector

2016-05-14 Thread Laurent Pointal
Steven D'Aprano wrote: > Just for kicks, I've been playing around with running code snippets with > and without the garbage collector enabled, looking to see if it will make > any obvious difference to performance. > > So far, I haven't found any. > > For instance, I tried: > > a = [i**3 for i

Re: After a year using Node.js, the prodigal son returns

2016-05-07 Thread Laurent Pointal
Chris Angelico wrote: > On Fri, May 6, 2016 at 11:45 PM, Grant Edwards > wrote: >>> JavaScript is terrible. Really, really bad. And because of that, it >>> has the potential to sweep the world. >> >> If your reasoning is correct, it'll never be able to overtake PHP. >> >> I've never written anyth

Re: from a module return a class

2016-03-19 Thread Laurent Pointal
John Gordon wrote: > In > kevind0...@gmail.com writes: > >> ## prompt the user for a User name a& pWord >> user_pword = promptUser_PWord() > >> I get the error >> File "H:\dev\eclipse\workspace\genXls\src\genXls\promptUser_PWord.py", >> line 58 >> return user_pword >> SyntaxErr

Re: from a module return a class

2016-03-19 Thread Laurent Pointal
kevind0...@gmail.com wrote: > Hello: > > Working with python 2.7. > > I have a module promptUser_PWord that will prompt a user for their user > name and pword. Works fine stand alone. > I also have a module, genXLS that does a bunch of processing it has worked > fine for months. And a class U

Re: from a module return a class

2016-03-18 Thread Laurent Pointal
John Gordon wrote: > In <56eaecc8$0$3658$426a7...@news.free.fr> Laurent Pointal > writes: > >> >> user_pword = promptUser_PWord() >> > >> > Show us the complete definition of promptUser_PWord(). > >> AFAIU It looks to be the module…

Re: ouvrir python

2016-01-06 Thread Laurent Pointal
Vincent Vande Vyvre wrote: > Le 04/01/2016 10:10, Jacques Rosier a écrit : >> J’ai téléchargé Python 351. Il est dans la liste des applications de mon >> ordi (Lenovo; Windows 10). Mais impossible de l’ouvrir. Que faire? > Cette liste de diffusion est anglophone, je te recommande de poster sur > c

Re: Bug in Python 3.5.1

2015-12-24 Thread Laurent Pointal
Hello, nisthesec...@verizon.net wrote: > Dear Sir, >I downloaded and installed Python 3.5.1 in Windows 10. >The pip command was not part of it. >In the future, can you kindly include numpy, scipy, and pygame as part >of the Python release? >I am a teacher trying to teach P

Re: [ANN] Python 3 Cheat Sheet v2.0

2015-10-31 Thread Laurent Pointal
Le Sat, 31 Oct 2015 12:16:08 +1100, Steven D'Aprano a écrit : > On Sat, 31 Oct 2015 06:56 am, Laurent Pointal wrote: >> https://perso.limsi.fr/pointal/python:memento > > > Very nice! Thank you! > > > Some small typos in the English version: Thanks for

Re: Idiosyncratic python

2015-09-24 Thread Laurent Pointal
wxjmfa...@gmail.com wrote: > Le jeudi 24 septembre 2015 08:02:38 UTC+2, Steven D'Aprano a écrit : >> >> >> What are your favorite not-wrong-just-weird Python moments? >> >> > Showing how to make Python 3.5.0 crash by > just using an "é", U+00E9. Like this ? Python 3.5.0 (default, Sep 24 201

Re: [ANN] Python TreeTagger wrapper updated to 2.2.1

2015-08-25 Thread Laurent Pointal
Laurent Pointal wrote: > It is available on PyPI: … incomplete URL… Here: https://pypi.python.org/pypi/treetaggerwrapper/ -- https://mail.python.org/mailman/listinfo/python-list

[ANN] Python TreeTagger wrapper updated to 2.2.1

2015-08-25 Thread Laurent Pointal
also added a treetaggerpoll module for use in a multiprocessing context. For important (and incompatible) modifications, see http://treetaggerwrapper.readthedocs.org/en/latest/#important-modifications-notes A+ Laurent Pointal -- https://mail.python.org/mailman/listinfo/python-list

Re: Check if dictionary empty with == {}

2015-08-20 Thread Laurent Pointal
Anton wrote: > Probably a silly question. > Let's say I have a dictionary mydict and I need to test if a dictionary is > empty. > > I would use > > if not mydict: > """do something""" > > But I just came across a line of code like: > > if mydict == {}: > """do something""" > > which s

Re: Regular expression and substitution, unexpected duplication

2015-08-19 Thread Laurent Pointal
MRAB wrote: > On 2015-08-18 22:42, Laurent Pointal wrote: >> Hello, >> ellipfind_re = re.compile(r"((?=\.\.\.)|…)", re.IGNORECASE|re.VERBOSE) >> ellipfind_re.sub(' ... ', >> "C'est un essai... avec différents caractères… pour

Regular expression and substitution, unexpected duplication

2015-08-18 Thread Laurent Pointal
Hello, I want to make a replacement in a string, to ensure that ellipsis are surrounded by spaces (this is not a typographycal problem, but a preparation for late text chunking). I tried with regular expressions and the SRE_Pattern.sub() method, but I have an unexpected duplication of the repl

Re: Who uses IDLE -- please answer if you ever do, know, or teach

2015-08-09 Thread Laurent Pointal
random...@fastmail.us wrote: > On Sat, Aug 8, 2015, at 13:59, Laurent Pointal wrote: >> > Level? >> >> Graduate (post-Bac in france) > > Yours or your students? My students. > >> > 1. Are you >> > grade school (1=12)? >> >> (so

Re: Who uses IDLE -- please answer if you ever do, know, or teach

2015-08-08 Thread Laurent Pointal
Terry Reedy wrote: > There have been discussions, such as today on Idle-sig , about who uses > Idle and who we should design it for. If you use Idle in any way, or > know of or teach classes using Idle, please answer as many of the > questions below as you are willing, and as are appropriate I t

Re: Why doesn't input code return 'plants' as in 'Getting Started with Beautiful Soup' text (on page 30) ?

2015-07-12 Thread Laurent Pointal
Simon Evans wrote: > - with open("C:\Beautiful Soup\ecologicalpyramid.html","r") as You seem to run Python under Windows. You have to take care of escape mechanism beyond \ char in string literals (see Python docs). By

Re: Trying to import numpy

2015-07-07 Thread Laurent Pointal
ryguy7272 wrote: > I'm trying to use numpy. I get this error: import numpy as np > > Traceback (most recent call last): > File "", line 1, in > import numpy as np > ImportError: No module named numpy > > > > I followed the instructions here. > https://pip.pypa.io/en/latest/install

Re: Bug in floating point multiplication

2015-07-02 Thread Laurent Pointal
Steven D'Aprano wrote: > Despite the title, this is not one of the usual "Why can't Python do > maths?" "bug" reports. > > Can anyone reproduce this behaviour? If so, please reply with the version > of Python and your operating system. Printing sys.version will probably > do. On Kubuntu 15.04,

Re: HOPE: A Python just-in-time compiler for astrophysical computations

2015-06-23 Thread Laurent Pointal
Mark Lawrence wrote: > Another beasty I've just stumbled across which you may find interesting > http://www.sciencedirect.com/science/article/pii/S2213133714000687 Why use a JIT complation when you could use some C++ generation then compilation as Python module, like with Pythran ? https://git

Re: PYTHON QUESTION

2015-06-14 Thread Laurent Pointal
adebayo.abra...@gmail.com wrote his student exercise as raw text: > Help with this problem! > > Temperature converter > Description > > Write two functions that will convert temperatures back and forth from the > Celsius and Fahrenheit temperature scales. The formulas for making the > conversion

Re: should "self" be changed?

2015-05-26 Thread Laurent Pointal
zipher wrote: > Would it be prudent to rid the long-standing "argument" (pun unintended) > about self and the ulterior spellings of it, by changing it into a symbol > rather than a name? > > Something like: > > class MyClass(object): > > def __init__(@): > @.dummy = None Just seein

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-18 Thread Laurent Pointal
Aditya Raj Bhatt wrote: > On Wednesday, March 18, 2015 at 1:04:39 PM UTC-5, Laurent Pointal wrote: >> > Can someone also provide a sort of a 'guide' to triple-quoted > comments >> > in general? >> >> A triple ' or " string is a Python st

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-18 Thread Laurent Pointal
Laurent Pointal wrote: (oups) > Take care of indent: > > def f(x): > a = 5 > """an correctly indented expression to be > inside the function""" > return a * x Here only the first indent of """ at beginning of

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-18 Thread Laurent Pointal
Aditya Raj Bhatt wrote: > I always do single line comments with # but just for the sake of it I > tried it with ''' ''' and it gives me a syntax error. > > In both the interpreter, and the source code text file, doing - > > a = 5 '''a comment''' > > results in a syntax error, with the very last

[Annonce] Une introduction à Python 3 - nouvelle version

2015-01-18 Thread Laurent Pointal
[updated book in french] Bonjour, L'ouvrage d'introduction à la programmation avec Python3 de B.Cordeau et L.Pointal a été mis à jour en version 1.618. Outre des améliorations dans la mise en page, les modifications suivantes ont été réalisées: * Tous les dessins ont été refaits en utilisant l

Re: Help understanding list operatoins inside functions in python 3

2015-01-13 Thread Laurent Pointal
Hello, stephen.bou...@gmail.com wrote: > I'm a bit confused why in the second case x is not [1,2,3]: > > x = [] > > def y(): > x.append(1) > > def z(): > x = [1,2,3] Here x is a local, so global x is not modified. If you want to modify gobal x, write: def z(): global x x = [1,

Re: dynamic values in yaml

2014-08-20 Thread Laurent Pointal
raphi...@gmail.com wrote: > Note that in my example the content to be inserted is not the result of a > variable substitution, but the result of a call to a function. format > doesn't seem to work in this case. And jinja2 doesn't seem to provide a > straight forward solution either > > Thx Yoy

Re: dynamic values in yaml

2014-08-19 Thread Laurent Pointal
raphi...@gmail.com wrote: > Hi, > > I'm using pyyaml, and need some values in a yaml files to be dynamic, for > example somethin like: > > filename: /tmp/backup_{% time.strftime('%Y-%m-%d') }.tgz > > Is there a simple way to achieve this? (Eg with a templating system that > would first hand

Re: Begginer in python trying to load a .dll

2014-08-19 Thread Laurent Pointal
c1234 py wrote: > This appear in the terminal: > > runfile('C://Python Scripts') > File "C:\\sitecustomize.py", line 585, in runfile > execfile(filename, namespace) > File "C://Sin título 38.py", line 19, in > hllApi = hllApiProto (("HLLAPI", hllDll), hllApiParams) > AttributeE

Re: Python in financial services

2014-08-19 Thread Laurent Pointal
wxjmfa...@gmail.com wrote: > I recommend to toy intensively with the 'EURO SIGN' in > strings manipulations. > > Py3: It may luckily work, Python may crash or fails (it raises > unicode errors on valid string!). > > Py2: It is safer and solid. There is however a subtility. 3rd > party tools may

RE: Controlling buffer alignment in file.read()

2014-03-22 Thread Laurent Pointal
Haralanov, Mitko wrote: >> For control at that level you'd be better off using >> direct system calls, i.e. os.open() and os.read(), >> then you can read exacty the number of bytes you want. >> > > The problem is not controlling the number of bytes read. That part seems > to be working. The issu

Re: What are the kinds of software that are not advisable to be developed using Python?

2014-02-22 Thread Laurent Pointal
Chris Angelico wrote: > Heavy computation might be unideal in Python, but if you can grunge it > into NumPy operations, that won't be a problem. May take a look to Pythran too, which generate C++ code from (limited subset of) Python code, usable as a Python compiled module or as standalone C++.

Re: decimal numbers

2014-02-15 Thread Laurent Pointal
luke.gee...@gmail.com wrote: > hello, > i have been working on a python resistor calculator to let my class show > what you can do with python. now i have a script that makes the more > speekable value of the resistance (res) > > #if len(str(res)) > 9: > # res2 = res / 10 > # print "de

Re: run command line on Windows without showing DOS console window

2013-11-20 Thread Laurent Pointal
-nd http://example.com/packages/ >> >> the path to wget is C:\Program Files\GnuWin32\bin\wget.exe >> > > subprocess.call(["wget", "-r", "-np", "-nd", "http://example.com";]) Complement: use .pyw extension for

Re: understanding someone else's program

2013-11-18 Thread Laurent Pointal
gt; making it difficult to trace what happens to a certain variable > > Am using ERIC4 IDE. To help for documentation, you may test pycallgraph, eventually depgraph if there are multiple modules. http://pycallgraph.slowchop.com/en/master/ http://www.tarind.com/depgraph.html A+ Laurent. --

Re: Py 3.3.2, MacBookPro, segmentation fault, GCC issue?

2013-11-10 Thread Laurent Pointal
piler tool. See discussions and links in http://stackoverflow.com/questions/9353444/how-to-use-install-gcc-on-mac-os-x-10-8-xcode-4-4 There may be other solutions, but you should prefer ask in a specific MacOS usenet group. A+ > > Thanks for any advice you may have. -- Laurent POIN

Re: Aide pour bien démarrer en Python

2013-09-29 Thread Laurent Pointal
tion qui > pourrait répondre à mes intérogations ? http://w2.syronex.com/jmr/python-paradox http://dirtsimple.org/2004/12/python-is-not-java.html Et deux textes dont on a l'impression qu'ils résultent d'un traducteur automatique: http://fr.softuses.com/231303 http://fr.softuses.com/1

Re: Do you consider Python a 4GL? Why (not)?

2013-06-11 Thread Laurent Pointal
> each error. (Before "integrated" development environments) This is a + for compiled environments that you effectively cannot have with Python, non-syntaxic errors found at runtime. A+ Laurent. -- Laurent POINTAL - laurent.poin...@laposte.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Printing a text over an image

2012-11-07 Thread Laurent Pointal
Martha Morrigan wrote: > > 3) Any more simple approach or module to deals with printers (paper > and/or pdf) will be welcome. For pdf, you can take a look at ReportLab's Toolkit. I used it to build a "trombinoscope" (ie an employee directory with each member's photo on top of his name and room

Re: how can I implement "cd" like shell in Python?

2012-06-28 Thread Laurent Pointal
> > plus you could add some error-handling code. To have a shell / python script interaction for cwd management, you can take a look at autojump https://github.com/joelthelion/autojump/wiki Its a Python script + different shells glue. A+ Laurent. -- Laurent POINTAL - laurent

Re: use Python to post image to Facebook

2012-06-24 Thread Laurent Pointal
ould appreciate it ever so much, Dave:) Note: if you develop such a tool, make it a "Web Out Of Browser" module. http://weboob.org/ -- Laurent POINTAL - laurent.poin...@laposte.net -- http://mail.python.org/mailman/listinfo/python-list

Re: English version for Mémento Python 3 (draft, readers needed)

2012-06-06 Thread Laurent Pointal
Ulrich Eckhardt wrote: > Am 05.06.2012 19:32, schrieb Laurent Pointal: >> I started a first translation of my document originally in french. Could >> some fluent english people read it and indicate errors or bad english >> expressions. > > Just one note up front: Lan

Re: English version for Mémento Python 3 (draft, readers needed)

2012-06-06 Thread Laurent Pointal
Paul Rubin wrote: > Laurent Pointal writes: >>> There are a few other things like that, and I'll try to look more >>> carefully tonight, I can't spend more time on it right now. >> I updated the document into 1.0.5a (and fix some other errors). > > A f

Re: English version for Mémento Python 3 (draft, readers needed)

2012-06-05 Thread Laurent Pointal
Paul Rubin wrote: > Laurent Pointal writes: >> I started a first translation of my document originally in french. Could >> some fluent english people read it and indicate errors or bad english >> expressions. >> >> http://perso.limsi.fr/pointal/python:memento

English version for Mémento Python 3 (draft, readers needed)

2012-06-05 Thread Laurent Pointal
Hello, I started a first translation of my document originally in french. Could some fluent english people read it and indicate errors or bad english expressions. http://perso.limsi.fr/pointal/python:memento Thanks. A+ Laurent. -- Laurent POINTAL - laurent.poin...@laposte.net -- http

Re: Converting a string to list for submission to easygui multenterb​ox

2012-05-02 Thread Laurent Pointal
title,qstack): > if choice[0] == None: > print ("No entries made") > break > > > print("CHOICE IS: ",choice). CHOICE IS: > ('', 'ksals', '', '',

Re: Naming future objects and their methods

2012-04-15 Thread Laurent Pointal
ata) if dataput.sent(timeout=1.0): print "Data has been sent." else: print "Data hasn't been sent within one second." -- Laurent POINTAL - laurent.poin...@laposte.net 3 allée des Orangers - 91940 Les Ulis - France Tél. 01 69 29 06 59 -- 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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

lxml and identification of elements in source

2007-09-19 Thread Laurent Pointal
Hello, I use lxml to parse a document, modify some elements in the tree, run xinclude on it (thanks to Stefan Behnel for the pointer), and finally use the data to feed my sax-aware tool. To report warnings/errors to the user (not related to XML itself, but to things like missing source for a cros

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

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: 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: 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: 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: SVG to raster conversion.

2007-09-17 Thread Laurent Pointal
J. Cliff Dyer a écrit : > Does anybody know a good solution (preferably in python) for rasterizing > SVG or other vector graphics. > > I'm thinking something like > > vector_image = SVGFile(path_to_image) > raster_image = vector_image.rasterize(format, (width, height), dpi) > raster_image.write(o

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: read part of jpeg file by pure python

2007-09-13 Thread Laurent Pointal
Pacino a écrit : > Hi, everyone, > > I am wondering whether it's possible to read part (e.g. 1000*1000) of > a huge jpeg file (e.g. 3*3) and save it to another jpeg file > by pure python. I failed to read the whole file and split it, because > it would cost 2GB memory. > > Can anyone help

Re: Get the complete command line as-is

2007-09-12 Thread Laurent Pointal
wangzq a écrit : > Hello, > > I'm passing command line parameters to my browser, I need to pass the > complete command line as-is, for example: > > test.py "abc def" xyz > > If I use ' '.join(sys.argv[1:]), then the double quotes around "abc > def" is gone, but I need to pass the complete comman

Re: memcpy

2007-09-11 Thread Laurent Pointal
Tim a écrit : > Can I initialize something in Python that I can get access to it's > pointer? No, there is no pointer in Python semantic (they exist behind the scene in C-Python). > How about: > > self.data = > TOTAL_OUTPUT_PARMETERS*[TOTAL_PARAMETER_ENTRIES*[c_float()] > > or > > self.data

Re: XML: SAX and XInclude

2007-09-11 Thread Laurent Pointal
Stefan Behnel a écrit : > Laurent Pointal wrote: >> does anybody know about an XML parser usable with the sax API (xml.sax) >> and with XInclude feature support (directly or via hacks). > > Try lxml.etree. > > http://codespeak.net/lxml/ > > http://codesp

XML: SAX and XInclude

2007-09-10 Thread Laurent Pointal
[python 2.5, Linux Mandriva 2007.1] Hello, does anybody know about an XML parser usable with the sax API (xml.sax) and with XInclude feature support (directly or via hacks). With specifying nothing (default parser), it simply transmit xinclude elements (i tried to call parser on included file

Re: Python object <-> XML

2007-09-03 Thread Laurent Pointal
Samuel wrote: > Hi, > > Say you have the following XML: > > > item 1 > > > item 2 > > > > > my group > > > Is there an easy way (i.e. without writing a sax/dom parser) to load > this into a (number of) Python object(s), manipulate the instance, and > save the result back to XM

Re: Coding Standards

2007-08-31 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : > 'Good code' is code that works, is bug free, and is readable and > maintainable. Standards need to be followed for coding. Read more... > > http://brsx.co.uk/SWtesting/FAQs/FAQs012.asp You misstyped your URL and referenced a C++ related document, for Python its here

Re: SCF released to GPL

2007-08-28 Thread Laurent Pointal
hg a écrit : > 2) I'm desperately searching for the French NG from my client but cannot > find it ... any clue ? Maybe you can pass the message ? Contact Michel Claveau ( [EMAIL PROTECTED] ) for a solution via his Usenet relay. A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-li

Re: SCF released to GPL

2007-08-27 Thread Laurent Pointal
hg a écrit : > 2) I'm desperately searching for the French NG from my client but cannot > find it ... any clue ? Maybe you can pass the message ? Done. See http://groups.google.com/group/fr.comp.lang.python/browse_frm/thread/fa4474921f77b1be/8d6150d502447510#8d6150d502447510 -- http://mail.py

Re: curses library

2007-08-25 Thread Laurent Pointal
Ghirai wrote: > Hello list, > > I need to write a console application. > > Are there any wrappers around curses/ncurses? > Or any other similar libraries? > > Thanks. I have some links here: http://www.limsi.fr/Individu/pointal/python.html#liens-graph-curses A+ Laurent. -- http://mail.pyth

Re: How to minimize command window when running wxPython script

2007-08-24 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : > Dear friends, > > I have almost completed my first wxPython application. The only thing > I need now is to minimize the command window. How is this accomplished > on Win32? Use a .pyw main module (eventually a wrapper calling your main .py module) - it is associate

Re: redirect or cover .bat log

2007-08-22 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : > Can I execute one .bat file (without opening .bat window) just execute > commands > and log process redirect with sys.stdout or something in my wx window? > > Is this clear enough? Type "help cmd" in a Windows console, then grab ad-oc options (/C and /A or /U seem g

Re: clarification

2007-08-17 Thread Laurent Pointal
Laurent Pointal a écrit : [cleaning] fh = open('sheet1') for line in fh: -- http://mail.python.org/mailman/listinfo/python-list

Re: clarification

2007-08-17 Thread Laurent Pointal
Thomas Jollans a écrit : > On Friday 17 August 2007, Beema shafreen wrote: >> hi everybody, >> i have a file with data separated by tab >> mydata: >> fhl1fkh2 >> shows these two are separated by tab represented as columns >> i have to check the common data between these two coloumn1 an coloumn

Re: Python Book Recommendations

2007-08-15 Thread Laurent Pointal
Azazello a écrit : > On Aug 15, 7:47 am, "Shawn Milochik" <[EMAIL PROTECTED]> wrote: >> If I could have only one book, I would buy "Core Python, Second >> Edition," by Wesley Chun. >> >> For the record, I own: >> Core Python, Second Edition (great) >> wxPython in Action (haven't used yet) >> Beginn

Re: LEGB rule, totally confused ...

2007-08-14 Thread Laurent Pointal
stef mientki a écrit : > hello, > > I've thought many times I finally understood the import / namespace rules, > but again I'm totally lost :-( > > This is my library file > ># Module lib_test.py > >X = 1 > >def Init(): >global X >X = 3 >print 'Init', X > >

Re: Script to copy database

2007-08-14 Thread Laurent Pointal
Tony a écrit : > I'm new at this and would like to know how set up a script to copy a > database from a local computer to a network at a certain time everyday. > Should be simple enough, but, as of now I am unfamiliar with how to do this. > Would this be done by writing a script and setting up a

Re: JPype - passing to Java main

2007-08-14 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : >> Try this: >> com.JPypeTest.main("arg") >> >> Ian > > Thanks for your suggestion, but it doesn't work (produces an error). This is where you should have copy/pasted the error. ;-) > > Does anybody else have any ideas? Sorry, no. -- http://mail.python.org/mailma

  1   2   3   >