Re: Performance with and without the garbage collector

2016-05-14 Thread Laurent Pointal
0)] >>> b = [a] >>> a.append(b) >>> del a# a remain referenced in b list >>> del b# b remain referenced in a list Now, how to test for performance impact… A+ Laurent. -- https://mail.python.org/mailman/listinfo/python-list

Re: A tough one: split on word length?

2016-05-16 Thread Laurent Pointal
00 (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' >>> re.split("(\d{6})(.*?)", s) ['', '584323', '', ' Fri 13 May 2016 17:37:01 - (UTC) ', '584324', '&

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: 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: 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: 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: Touch screen development in Python

2016-07-13 Thread Laurent Pointal
a try, even on your mouse controlled interface. A+ Laurent. -- https://mail.python.org/mailman/listinfo/python-list

Re: an error

2016-07-19 Thread Laurent Pointal
en parenthesis, brackets, square brackets with missing close one. A+ Laurent. -- https://mail.python.org/mailman/listinfo/python-list

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

2005-10-19 Thread Laurent Rahuel
Hi, I guess you need to look at __import__ Regards, Laurent. Joerg Schuster wrote: > Hello, > > I need to import modules from user defined paths. I.e. I want to do > something > like: > > module_dir = sys.argv[1] > > my_path = os.path.join(module_dir, 'bin&

Re: Converting a flat list to a list of tuples

2005-11-22 Thread Laurent Rahuel
mber) in list: > print key, number > > but it's not working... > > Thank you Hi, newList = zip(aList[::2], aList[1::2]) newList [('a', 1), ('b', 2), ('c', 3)] Regards, Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing big XML files where beginning depends on end.

2005-11-28 Thread Laurent Pointal
s for solutions are appreciated. An idea. Put spaces in your names Store { "#1": }. When you have collected all your final data, go throught your stored #, seek at their position in the file, and replace the data (writting same amount of chars than reserved). A kind of direct access to nodes in an XML document file. A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to creat a file?

2005-12-02 Thread Laurent RAHUEL
sandorf wrote: > I'm new to python. Have a simple question. > > "open" function can only open an existing file and raise a IOerror when > the given file does not exist. How can I creat a new file then? fic = open('test.txt', 'w') fic.write('Hello world') fic.close() -- http://mail.python.org/

Re: appending messages in imaplib

2005-12-05 Thread Laurent Pointal
[EMAIL PROTECTED] wrote: > So I have the unfortunate task of migrating several hundred users from > local mail (mbox and mh) up to an exchange server as part of wearisome > SOX compliance nonsense. > > I thought the best path through this thicket would be to knock up a > quick python script using

Re: Creating referenceable objects from XML

2005-12-05 Thread Laurent Pointal
> > I need it to somehow convert my XML to intuitively referenceable > object. Any ideas? I could even do it myself if I knew the mechanism > by which python classes do this (create variables on the fly). > > Thanks in advance! Another tool (ElementsTree already quoted): Amara

Re: Unpacking Binary Data - not using struct module

2004-12-16 Thread Laurent Pointal
) as it is normally not used as a digit in this coding. 3) I think that the trailing "f" is sometimes used to indicate the sign of the number and perhaps even the number of decimal places ... but am not sure. Maybe... but have you an example of a negative number ? A+ Lauren

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: 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: Why doesn't os.remove work on directories?

2015-12-24 Thread Laurent Delacroix
On 23/12/15 05:29, Random832 wrote: > > This is surprising to anyone accustomed to the POSIX C remove > function, which can remove either files or directories. Is there > any known rationale for this decision? > Hello, in POSIX C the remove() function is actually rmdir() when called on a direct

Re: Bug in Python 3.5.1

2015-12-24 Thread Laurent Pointal
n be installed via conda as indicated on this page - you may test under common student OS). A+ Laurent. -- https://mail.python.org/mailman/listinfo/python-list

Re: CGI

2015-12-27 Thread Laurent Delacroix
On 26/12/15 10:41, Pol Hallen wrote: > > How can I execute a local command (like ls or similar) and show output > via browser? > Either you use a proper web framework (Flask, Bottle, Django in order of complexity) or you set up a web server with FastCGI support (e.g. nginx) and run a WSGI appli

Re: ouvrir python

2016-01-06 Thread Laurent Pointal
ande de poster sur > ce forum: > > http://www.developpez.net/forums/f96/autres-langages/python-zope/ > > Vincent Il y a un groupe francophone sur Usenet: fr.comp.lang.python There is a french Usenet group: fr.comp.lang.python A+ Laurent. -- https://mail.python.org/mailman/listinfo/python-list

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: from a module return a class

2016-03-19 Thread Laurent Pointal
function). > The final line of promptUser_PWord become: user_pword = Unamepword(dbUser, pWord) def get_user_pword(): return user_pword and call get_user_pword() from within genXLS: user_pword = promptUser_PWord.get_user_pword() A+ Laurent > > Many thanks for your attention to this matter. > > KD -- https://mail.python.org/mailman/listinfo/python-list

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: Help understanding list operatoins inside functions in python 3

2015-01-13 Thread Laurent Pointal
d for your problem, its the same with Python2 and Python3) Or… A+ Laurent. -- https://mail.python.org/mailman/listinfo/python-list

[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: decimal numbers

2014-02-15 Thread Laurent Pointal
dividing by floating point numbers, like res2 = res / 1000. Note: should take a lok at the log10() function from math module. (with Python3) In [1]: from math import log10 In [2]: r = 132828378723 In [3]: int(log10(r)) Out[3]: 11 In [4]: r / 10**int(log10(r)) Out[4]: 1.32828378723 A+ Laurent. -- https://mail.python.org/mailman/listinfo/python-list

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

2014-02-22 Thread Laurent Pointal
tandalone C++. https://github.com/serge-sans-paille/pythran A+ Laurent. -- https://mail.python.org/mailman/listinfo/python-list

RE: Controlling buffer alignment in file.read()

2014-03-22 Thread Laurent Pointal
ffered) ? Eventually going to os.open() which map tp low level (eventually followed by an os.fdopen()) http://docs.python.org/2/library/os.html#os.open A+ Laurent. -- https://mail.python.org/mailman/listinfo/python-list

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: 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: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-18 Thread Laurent Pointal
with no stored result (ie. no assignment to a name), and this is how are used triple quoted strings as comments. a = 5 """a comment""" Take care of indent: def f(x): a = 5 """an correctly indented expression to be inside the function""" return a * x A+ Laurent. -- https://mail.python.org/mailman/listinfo/python-list

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: > 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: should "self" be changed?

2015-05-26 Thread Laurent Pointal
> itch that couldn't be scratched. «Explicit is better than implicit» I think that googling for that idea you will find other people already proposing it (I've seen propositions to directly remove part before the dot like this: .dummy = None). Just read it. > Anyone else have any

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: HOPE: A Python just-in-time compiler for astrophysical computations

2015-06-23 Thread Laurent Pointal
an ? https://github.com/serge-sans-paille/pythran For heavy computing, you may loose some time before running computation, to have (generate) the right tool, then do the job with real bonus. … A+ Laurent. -- https://mail.python.org/mailman/listinfo/python-list

Re: Bug in floating point multiplication

2015-07-02 Thread Laurent Pointal
= 0.9999 >>> for i in range(1, 100): ... if int(i*x) == i: ... print(i); break ... >>> A+ Laurent. -- https://mail.python.org/mailman/listinfo/python-list

Re: Trying to import numpy

2015-07-07 Thread Laurent Pointal
sourceforge.net/projects/numpy/files/NumPy/1.9.2/numpy-1.9.2-win32-superpack-python2.7.exe/download And install it with the installer. A+ Laurent. -- https://mail.python.org/mailman/listinfo/python-list

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
ng a r to disable escape sequences: r"C:\Beautiful Soup\ecologicalpyramid.html" A+ Laurent. -- https://mail.python.org/mailman/listinfo/python-list

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

Regular expression and substitution, unexpected duplication

2015-08-18 Thread Laurent Pointal
... avec différents caractères ... pour voir." ^^^ I tested with/without group capture, same result. My Python version: Python 3.4.3 (default, Mar 26 2015, 22:03:40) [GCC 4.9.2] on linux Any idea ? Thanks. Laurent. -- https://mail.python.org/mailman/listinfo/python-list

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

Re: Check if dictionary empty with == {}

2015-08-20 Thread Laurent Pointal
form 'if not mydict:' is AMA the more pythonic, but it may be a source of question for beginners (what is the boolean meaning of a dictionnary…). A+ Laurent. -- 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: [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

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

protect psycopg script from sql injection?

2014-06-25 Thread celati Laurent
Hello, I coded this following python script via psycopg; web_service_test.py 1/ When i execute it, the result is 'bad resquest'. Could you tell me why? 2/ Could you tell me how to protect this script from SQL injections please?

Re: Python in financial services

2014-08-19 Thread Laurent Pointal
re information. >>> print("€"*10) €€ >>> With IDLE and Python 2.7, there seem to be an encoding problem: >>> s = u"€"*10 >>> >>> import sys >>> sys.stdout.encoding 'utf-8' >>> print s.encode(&q

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: 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: 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: Question on Manipulating List and on Python

2011-09-29 Thread Laurent Claessens
ogram inside Word macros, I guess the answer ;) If he is used to program in C, I'm less sure. It really depends on the context of the question. Laurent -- http://mail.python.org/mailman/listinfo/python-list

Counting the number of call of a function

2011-09-29 Thread Laurent Claessens
he way, I tried to print globals() inside __init__() to see what happens. It turns out that the entry 'foo' is never modified. Any idea ? I fact what I have to do is to add a decorator _a posteriori_ ... Have a good night Laurent -- http://mail.python.org/mailman/listinfo/python-list

Re: Counting the number of call of a function

2011-09-30 Thread Laurent Claessens
The keys of globals() are the _names_. You're giving it the function itself. Ow, ok. I didn't caught it. I understand now. > A decorator would be better. Yes. I keep the solution with foo=Wraper(foo) Thanks a lot all ! Laurent -- http://mail.python.org/mailman/listinfo/python-list

1/2 evaluates to 0

2011-10-12 Thread Laurent Claessens
python says : There should be one-- and preferably only one --obvious way to do it. and I don't believe that float(1)/2 is an "obvious way" (I'm not Dutch) Have a good afternoon Laurent -- http://mail.python.org/mailman/listinfo/python-list

Re: 1/2 evaluates to 0

2011-10-13 Thread Laurent Claessens
l never be the default in 2.x. Thanks all for your ansers. I'll import division from __future__ Most of what I'm using in Python is with Sage[1]. Thus I'm not about to step to 3.x :( Laurent [1] www.sagemath.org -- http://mail.python.org/mailman/listinfo/python-list

Re: 1/2 evaluates to 0

2011-10-13 Thread Laurent Claessens
just two of the biggest python parts in Sage, but there are many others ... 'till sage itself. Have a good afternoon Laurent -- http://mail.python.org/mailman/listinfo/python-list

Re: Entre local et global

2011-10-28 Thread Laurent Claessens
Woops. This was aimed to the french speaking python's usenet. Sorry. Laurent Le 28/10/2011 11:29, Laurent a écrit : Le 28/10/2011 10:43, ll.snark a écrit : On 27 oct, 17:06, Laurent Claessens wrote: > J'aimerais donc pouvoir indiquer dans fonca, que la variable lst es

Re: Extracting elements over multiple lists?

2011-11-07 Thread Laurent Claessens
don't want new lists, I would do : a=[1,2,3,4,5] b=["one", "two", "three", "four", "five"] c=["cat", "dog", "parrot", "clam", "ferret"] for x in [a,b,c]: x.remove(x[0]) print a pri

Re: Extracting elements over multiple lists?

2011-11-07 Thread Laurent Claessens
r the loop. Laurent -- http://mail.python.org/mailman/listinfo/python-list

Re: suitability of python

2011-11-24 Thread Laurent Claessens
situations, Sage is the "correct" successor of Fortran instead of plain python. Well, it does not answers the question, but ... Laurent [1] http://sagemath.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Complete beginner, any help appreciated :) - For Loops

2011-12-01 Thread Laurent Claessens
opython.pdf (page 58) Have a nice day Laurent -- http://mail.python.org/mailman/listinfo/python-list

Re: ERROR:root:code for hash md5 was not found

2012-01-11 Thread Laurent Claessens
ing) File "/usr/lib/python2.6/hashlib.py", line 80, in __get_builtin_constructor raise ValueError, "unsupported hash type" ValueError: unsupported hash type You should give us a more comprehensive example of your problem. Laurent -- http://mail.python.org/mailman/listinfo/python-list

csv module

2005-12-28 Thread Laurent Laporte
hello, I'm using cvs standard module under Python 2.3 / 2.4 to write a file delimited with tabs. I use the "excel-tab" dialect to do that. To read my CSV file, I choose to 'sniff' with a sample data in order to get the dialect. The problem I meet is that I get a wrong dialect: the sniffer return

csv.Sniffer: wrong detection of the end of line delimiter

2005-12-28 Thread Laurent Laporte
ss_delimiter(self, t_data, p_delimiters) if t_delimiter == '' and '\t' in p_data: t_delimiter = '\t' return (t_delimiter, t_skipInitialSpace) # --- end of patch --- Bye. --- Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: csv module

2005-12-28 Thread Laurent Laporte
Sorry, Here is my example: Python 2.3.1 (#1, Sep 29 2003, 15:42:58) [GCC 2.96 2731 (Red Hat Linux 7.1 2.96-98)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import csv >>> t_sniffer = csv.Sniffer() >>> t_data = "aaa\tbbb\r\n\r\nAAA\tBBB\r\n" >>> t_diale

Re: csv module

2005-12-28 Thread Laurent Laporte
freq = line.count(char) It works fine. Do you have a workaround for that? --- Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: text representation of HTML

2006-07-19 Thread Laurent Rahuel
Hi, I guess stripogram would be more pythonic : http://sourceforge.net/project/showfiles.php?group_id=1083 Regards, Laurent Diez B. Roggisch wrote: > Ksenia Marasanova wrote: > >> Hi, >> >> I am looking for a library that will give me very simple text >>

update a window with tkinter ...

2006-07-27 Thread Laurent Hermann
Hi I'm new on this list so let me say hello to everybody.I have a little problem with tkinter but I could not find the solution on the net so I ask it here...The thing I want to do is simple but I cannot, I would like to have a tkinter window that update itself during the program is running, I crea

metaclass : parse all class once before doing anything else ?

2006-07-28 Thread Laurent Rahuel
more : Before adding anything to these classes, 1 - I need to parse all defined Foo classes 2 - "sort" them 3 - parse this sorted list to add attrs and methods. This seems to be really to clever for me ;-( Any idea ? Regards, Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: Programming newbie coming from Ruby: a few Python questions

2006-08-02 Thread Laurent Pointal
ython" from Mark Pilgrim, good examples with comments. http://diveintopython.org/ Its available as paper-print or as electronic reading. A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to stop python

2006-08-02 Thread Laurent Pointal
victor a écrit : > or if u want explicit exit of program then use: > > import sys > sys.exit(1) > > or > > raise SystemExit, 'message' There is also the (not recommanded - see docs, but it exists) os._exit(n) function. A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode/utf-8 data in SQL Server

2006-08-09 Thread Laurent Pointal
27;cp1252',errors='replace') As cp1252 may not cover all utf8 chars. Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: Reference Variables In Python Like Those In PHP

2006-08-16 Thread Laurent Pointal
"credits" or "license" for more information. >>> class Dummy(object) : pass ... >>> x=Dummy() >>> x.val = 1 >>> y = x <-- here x and y refer to *same* Dummy object >>> y.val += 1 >>> x.val 2 >>> y.val 2 A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: Subprocess confusion: how file-like must stdin be?

2006-08-18 Thread Laurent Pointal
ilesystem, or perhaps the > stdout of a previous subprocess? Is there no built-in way to > feed it an in-memory construct? As this is a pipe at OS level, there may be no other way than using os-level tools (ie. real files with fileno), maybe creating an anonymous pipe, writing to it (relying on pipe buffering by the OS to avoid the creation of a writer thread), and giving this pipe (which should have a fileno) to the subprocess.Popen stdin parameter. Such a construction (pipe/writer thread) would be welcome as standard subprocess tool. A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: What do you want in a new web framework?

2006-08-21 Thread Laurent Pointal
S)? Personnally I use Karrigell at home, simple, nice. A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for assignement operator

2006-10-17 Thread Laurent Pointal
Int(10) a.set(12) And, if a is a member of another class, you may define an accessor for that 'a' member in that class, which automatically call your set method when giving an int value. b.a = MyInt(10) b.a = 12---> b.a.set(12) A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: I would like write some data recovery software

2006-10-17 Thread Laurent Pointal
Once you get a way to access the bytes to recover... the Hachoir library can be interresting as a model to map structures on these data. http://hachoir.org/ A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.5 ; Effbot console ; thank ; pb release.

2006-10-24 Thread Laurent Pointal
Thomas Heller a écrit : > Ben Finney schrieb: >> "Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: >> >> [quoting problems fixed] >> >>> "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: some days, I ask myself why I shouldn't just use GPL for everything I do, and ship it as source code only. >>

Re: PyFAQ: help wanted with thread article

2006-11-14 Thread Laurent Pointal
Fredrik Lundh a écrit : > this FAQ item talks about using sleep to make sure that threads run > properly: > > http://effbot.org/pyfaq/none-of-my-threads-seem-to-run-why.htm > > I suspect it was originally written for the "thread" module, but as > far as I know, the "threading" module takes care o

Re: graphical class diagram tool?

2006-11-14 Thread Laurent Pointal
nic a écrit : > Hi all > Some years ago I saw a graphical class diagram generated by > examining a python program. I *thought* that this was done with Boa > Constructor, but I may be wrong. I've download a recent version of BC > and can't find reference to this feature. Can anyone point me at o

Re: Python-2.5.exe?

2006-11-15 Thread Laurent Pointal
seem to find one of > those today. > > Can the Python-2.5.msi installation files from python.org be installed > so as not to touch the registry, to make them portable? It seems movpy can install Python2.5 on an USB Key. A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-17 Thread Laurent Pointal
test if it is an unicode string, and if not, convert it to unicode using the encoding indicated by sys.getfilesystemencoding(). Have a try. A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: Running Python scripts under a different user

2006-05-29 Thread Laurent Pointal
d.ch/py430/python/index.html And too: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 See also google links for python + daemon A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to format datetime values

2006-06-02 Thread Laurent Pointal
't be done with C printf formatting. For long integer formating like your example, its not direct - maybe look at locale formating of numbers (module... 'locale'). And I recently annouce the PQRC (on clp.announce), which can gives you some directions: http://www.limsi.fr/Individu/pointal/python/pqrc/ A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python for Visual Basic or C# programmers

2006-06-02 Thread Laurent Pointal
fr/Individu/pointal/python/pqrc/ A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

ANN: PQRC - Python Quick Reference Card - v 0.55

2006-06-03 Thread Laurent Pointal
[for those who dont read clp.announce] The Python Quick Reference Card (PQRC) aims to provide a printable quick reference documentation for the Python language and some of its main standard libraries (currently for Python 2.4). PQRC tries to group informations about same/similar subject to avoid

Re: ANN: PQRC - Python Quick Reference Card - v 0.55

2006-06-04 Thread Laurent Pointal
Kent Johnson wrote: > Laurent Pointal wrote: >> And I'll maintain a fixed URL at >> >> http://laurent.pointal.org/python/pqrc/ > > Broken at the moment. Its back. Its at my home ADSL, normally online, but my provider reset the connexion each 24h and its home

Re: Python is fun (useless social thread) ;-)

2006-06-16 Thread Laurent Pointal
I guess help() is good for this though). http://www.limsi.fr/Individu/pointal/python/pqrc/ A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] code is data

2006-06-19 Thread Laurent Pointal
bruno at modulix a écrit : > Anton Vredegoor wrote: >> bruno at modulix wrote: >> >>> I still don't get the point. >> >> Well, I've got to be careful here, lest I'd be associated with the >> terr.., eh, the childp..., eh the macro-enablers. >> >> The idea is to have a way to transform a Python (.py

Re: [OT] code is data

2006-06-20 Thread Laurent Pointal
Fredrik Lundh a écrit : > Laurent Pointal wrote: > >>>> The idea is to have a way to transform a Python (.py) module into XML >>>> and then do source code manipulations in XML-space using ElementTree. >>> >>> My my my... I'm not against the id

Re: How to truncate/round-off decimal numbers?

2006-06-20 Thread Laurent Pointal
ng of last expression result in the cli interpreter displays up to the highest precision, print statement works differently: >>> a=2 >>> b=3 >>> c=round(a*1.0/b,2) >>> c 0.67004 >>> print c 0.67 >>> A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: style question

2006-06-26 Thread Laurent Rahuel
his comes out in the input and isn't aligned there. Hi, msgs = ['This is line1.','This is line2.','This is line3.'] message = '\n'.join(msgs) Regards, Laurent. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with sets and Unicode strings

2006-06-28 Thread Laurent Pointal
data associated. When these strings must be converted they are considered to be using sys.getdefaultencoding() [generally ascii - forced ascii in python 2.5] So a short reply: the utf8 directive has no effect on 8 bits strings, use unicode strings to manage correctly non-ascii texts. A+ L

Re: best small database?

2006-09-11 Thread Laurent Pointal
David Isaac a écrit : > I have no experience with database applications. > This database will likely hold only a few hundred items, > including both textfiles and binary files. > > I would like a pure Python solution to the extent reasonable. > > Suggestions? May take a look at buzhug (very pyth

Re: Pythondocs.info : collaborative Python documentation project

2006-09-18 Thread Laurent Pointal
rom one main Python developers (dont remember who start this neither what is the URL). In all case, dont setup another new system, use http://wiki.python.org/moin/, at least your work will not be lost. A+ Laurent. -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   >