Re: Can not run under python 2.6?

2009-04-29 Thread Gabriel Genellina
://groups.google.com/group/comp.lang.python/t/1beda7d8ee474b64/ -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Third Party Modules

2009-04-28 Thread Gabriel Genellina
ndows installer. If I want something, it's usually more like a 50-50 chance of there being an installer. If the package includes some C extensions, typical Windows users won't be able to compile them, so a binary distribution is a must. Usually, it's enough to execute: python s

Re: fcntl and siginfo_t in python

2009-04-28 Thread Gabriel Genellina
estions or hints are appreciated. In case you don't find any existing library, yes, I think you could do that using ctypes. It's available as a separate download from http://sourceforge.net/projects/ctypes/ and I think it works from 2.4 up. -- Gabriel Genellina -- http://mail.pyth

Re: How to retry something with a timeout in Python?

2009-04-28 Thread Gabriel Genellina
n is completely exhausted. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: bug with os.rename in 2.4.1?

2009-04-28 Thread Gabriel Genellina
_dir+'/HEADER.DAT',paths.xferin_dir+'/ HEADER.DAT'+'.0') if os.path.exists(paths.xferin_dir+'/LINE.DAT'): os.rename(paths.xferin_dir+'/LINE.DAT',paths.xferin_dir+'/ LINE.DAT'+'.0') except: print "Unexpected error:", sys.exc_info()[0] raise And the error is...? -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Unknown Visual C++ error

2009-04-28 Thread Gabriel Genellina
any clue on what went wrong. Also, try running the script using python.exe instead of pythonw.exe; you might see some diagnostic messages in the console. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory leak on python 2.5 if using str(dict(a='a'))

2009-04-28 Thread Gabriel Genellina
after half an hour it still consumes the same amount of memory. (Note that, even if there is a real bug in 2.5, it's too late in the development cycle - 2.5 gets only security fixes now) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: desperately looking for a howto on running my wxPython app on Vista

2009-04-28 Thread Gabriel Genellina
? R6034 is likely a DLL mismatch between parts of your project. Can someone please point me to a howto on crafting the right Setup.py and manifests etc. to make this work? If you're using 2.6.1, try again with 2.6.2 and post the specific error you get. -- Gabriel Genellina --

Re: bug with os.rename in 2.4.1?

2009-04-28 Thread Gabriel Genellina
is open by any process. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Why bool( object )?

2009-04-28 Thread Gabriel Genellina
of a conscious decision. To Aaron: "Programming language design is not a rational science. Most reasoning about is is at best rationalization of gut feelings, and at worst plain wrong." (GvR in python-ideas: http://groups.google.com/group/python-ideas/msg/ac61f03c32578bae ) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Get objects from ZODB into MySQL

2009-04-27 Thread Gabriel Genellina
:) Try Shane Hathaway's APE library [1]. Currently unmaintained, but if this is a one-shot project it may be useful. [1] somewhere inside http://www.hathawaymix.org -- maybe http://hathawaymix.org/Software -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: is PyCodec_Encode API able to change encoding fron UCS-2 to UCS-4

2009-04-27 Thread Gabriel Genellina
irrelevant. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: is PyCodec_Encode API able to change encoding fron UCS-2 to UCS-4

2009-04-27 Thread Gabriel Genellina
vides some convenience functions, like PyUnicode_DecodeUTF16 and PyUnicode_EncodeUTF32 -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: wxpython notebook oddness

2009-04-27 Thread Gabriel Genellina
o the bare minimum showing the discrepancy (and tell us *what* you see and what you expect) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a maximum size to a Python program?

2009-04-27 Thread Gabriel Genellina
En Mon, 27 Apr 2009 14:50:23 -0300, Gabriel Genellina escribió: En Mon, 27 Apr 2009 13:12:29 -0300, Aahz escribió: In article , Steven D'Aprano wrote: On Sun, 26 Apr 2009 21:51:00 -0700, John Machin wrote: ἐδάκρυσεν ὁ Ἰησοῦς Alright, I give up. Is that APL code? *grin* b

Re: Is there a maximum size to a Python program?

2009-04-27 Thread Gabriel Genellina
like Greek, and I can transliterate the last word as Iesous, so it might be some kind of Biblical reference. But I don't have the slightiest idea of what that means... -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to evaluate boolean expressions from strings?

2009-04-27 Thread Gabriel Genellina
recent thread may be of interest: Safe eval of moderately simple math expressions http://groups.google.com/group/comp.lang.python/t/c1aff28494ab5b59/ -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: repost: http web page fetch question

2009-04-24 Thread Gabriel Genellina
_something() -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: repost: http web page fetch question

2009-04-24 Thread Gabriel Genellina
_something() -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: first, second, etc line of text file

2009-04-24 Thread Gabriel Genellina
En Thu, 23 Apr 2009 18:50:06 -0300, Scott David Daniels escribió: Gabriel Genellina wrote: En Wed, 25 Jul 2007 19:14:28 -0300, James Stroud escribió: [nice recipe to retrieve only certain lines of a file] I think your time machine needs an adjustment, it spits things almost two years

Re: Raw command line arguments

2009-04-24 Thread Gabriel Genellina
x27;txt', '-c', '"Test Only"', '{Help}'] Two double quotes represent a single one. And you have to enclose the whole argument in quotes too because of the space character. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Python-URL! - weekly Python news and links (Apr 24)

2009-04-24 Thread Gabriel Genellina
QOTW: "... [C]alling Python Object-Orientated is a bit of an insult :-). I would say that Python is Ego-Orientated, it allows me to do what I want." - Martin P. Hellwig April 25: Python Bug Day A perfect opportunity to get involved in Python development, bring your own issues to att

Re: Any adv. in importing a module and some objects in the same module, into the same file?

2009-04-21 Thread Gabriel Genellina
ookups. In that case I'd assign the desired function to a local name, to avoid any name lookup inside the loop. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 401

2009-04-21 Thread Gabriel Genellina
lize the Status :-( ... Excuse me At least the heart will not blow up to someone else . :-D Note that Status was set as "Accepted" until April 6, only then changed to the current value: http://svn.python.org/view/peps/trunk/pep-0401.txt?r1=70977&r2=71338 -- Gabr

Re: Hello everyone!

2009-04-21 Thread Gabriel Genellina
En Sun, 19 Apr 2009 09:54:36 -0300, Yilong Deng <05301...@bjtu.edu.cn> escribió: I'm a newby here, I love python very much. Welcome! Is there any Chinese here? Maybe - it seems there are people from all around the world... -- Gabriel Genellina -- http://mail.python.

Re: [False,True] and [True,True] --> [True, True]?????

2009-04-20 Thread Gabriel Genellina
(two lists). A and B means: check the boolean value of A; if it's false, return A. Else, return B. A non-empty list has a boolean value of true, so the second list is returned. If you want an element-wise operation: A = [False,True] B = [True,True] result = [a and b for a,b in zip(A,B)]

Re: can python access OS level features like bash scripting?

2009-04-19 Thread Gabriel Genellina
En Sun, 19 Apr 2009 18:40:58 -0300, Krishnakant escribió: On Sun, 2009-04-19 at 14:55 -0300, Gabriel Genellina wrote: Write a setup.py script using the distutils package: http://docs.python.org/distutils/index.html So that can distutil do the work of setting up the database and can it

Re: The Python standard library and PEP8

2009-04-19 Thread Gabriel Genellina
En Sun, 19 Apr 2009 15:41:02 -0300, Emmanuel Surleau escribió: On Sunday 19 April 2009 19:37:59 Gabriel Genellina wrote: En Sun, 19 Apr 2009 13:43:10 -0300, Emmanuel Surleau > On an unrelated note, it would be *really* nice to have a length > property on > strings. Even Java

Re: The Python standard library and PEP8

2009-04-19 Thread Gabriel Genellina
En Sun, 19 Apr 2009 14:52:23 -0300, Paul Hankin escribió: On Apr 19, 7:37 pm, "Gabriel Genellina" wrote: The threading module has such aliases, but there are no plans for mass   renaming all the stdlib that I know of. You'll have to live with this   inconsistency. It&

Re: can python access OS level features like bash scripting?

2009-04-19 Thread Gabriel Genellina
line: python path/to/main.py, and a Python script that just imports some modules and then calls the main function. Perhaps bash is more useful if your program (or any library) requires some environment variables to be set. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/p

Re: The Python standard library and PEP8

2009-04-19 Thread Gabriel Genellina
g module has such aliases, but there are no plans for mass renaming all the stdlib that I know of. You'll have to live with this inconsistency. On an unrelated note, it would be *really* nice to have a length property on strings. Even Java has that! Why would it be nice to have? I

Re: Overriding methods per-object

2009-04-18 Thread Gabriel Genellina
se I think this is the solution I like best. You may want to implement some kind of cache: creating a new class for every instance is expensive. Also, note that those instances are not pickleable. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Condition.wait(0.5) doesn't respect it's timeout

2009-04-17 Thread Gabriel Genellina
timeout is detected, but the wait method doesn't return, it's stuck at the last line (trying to restore a saved RLock state). I don't understand the logic behind that. Please file a bug report at http://bugs.python.org/ -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: compiler package vs parser

2009-04-17 Thread Gabriel Genellina
st): File "", line 1, in NameError: name 'k' is not defined Note that i starts as a global name and after the exec "i=5" it becomes a local variable; and k is always a local variable even if there is no explicit assignment to it (except in the exec). -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Create standalone Windows program with simple graphics?

2009-04-16 Thread Gabriel Genellina
sures. See the wiki on the site above for details. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Python-URL! - weekly Python news and links (Apr 16)

2009-04-16 Thread Gabriel Genellina
QOTW: "Yes, by Daddy telling him so. That's how nature does it, and how you should do it. Or do you think that because DNA-tests are available to us we should just put all kids into a big pool and make them find out who their parents are themselves, once they grew up?" - Diez B. Roggisch, on data-

Re: zProblem

2009-04-14 Thread Gabriel Genellina
En Tue, 14 Apr 2009 18:42:32 -0300, norseman escribió: Gabriel Genellina wrote: En Mon, 13 Apr 2009 15:13:53 -0300, norseman escribió: Gabriel Genellina wrote: Below there is an attempt to reproduce the layout you describe in the PDF: from Tkinter import * root = Tk() pane

Re: zProblem

2009-04-13 Thread Gabriel Genellina
En Mon, 13 Apr 2009 15:13:53 -0300, norseman escribió: Gabriel Genellina wrote: Now, if ... summarizes your problem, I think you should use the "place" geometry manager, not grid (nor pack). The Tkinter documentation [1] is rather short but the Tcl docs [2] have more info.

Re: HTML Conversion in python

2009-04-12 Thread Gabriel Genellina
writing each and every tag in my script.. You're looking for a templating engine -- see http://wiki.python.org/moin/Templating -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: choosing background color in tkfiledialog.askopenfile()

2009-04-12 Thread Gabriel Genellina
tkinter -- please report it at http://bugs.python.org/ -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: OverflowError while sending large file via socket

2009-04-12 Thread Gabriel Genellina
pen the socket and send smaller packets through it. And instead of reinventing the wheel again, use the shutil module to do exactly that. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: GUI Programming

2009-04-12 Thread Gabriel Genellina
t crossplatform compatibility it has a native look on all platforms too and no commercial license whatsoever... there are a huge lot of examples oonline f almost anything you want ideal for schoolwork ;) I second that. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Definition of Pythonic?

2009-04-12 Thread Gabriel Genellina
, the fume cupboard's broken down? Definitely! Honestly I feel fine... Sure... just don't drive :) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: "str object is not callable" error

2009-04-12 Thread Gabriel Genellina
ome_module some_module.add(123) Do the same in C: callback = PyObject_GetAttrString(some_module, "add"); if (!callback) ...error... result = PyObject_CallFunction(callback, "i", arg); Py_DECREF(callback); return result; -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: save error with embedded python 2.5

2009-04-12 Thread Gabriel Genellina
ou use the same two-loop design both times? Or better, use a bidimensional data structure (like a list of lists, or the numpy library if you're mostly concerned with numbers). -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Recommendations on Pythonic tree data structure design techniques

2009-04-12 Thread Gabriel Genellina
lementTree. An Element is a generic container for hierarchical data - doesn't have to be XML. See http://effbot.org/zone/element-index.htm and http://docs.python.org/library/xml.etree.elementtree.html -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading only headers

2009-04-12 Thread Gabriel Genellina
up/comp.lang.python/t/b1060b62b2f12a04/ http://groups.google.com/group/comp.lang.python/t/bbac82df3d64d48e/ -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiprocessing module

2009-04-11 Thread Gabriel Genellina
, and evaluate how serious may be the known problems in your own context. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't create list of dictionaries

2009-04-11 Thread Gabriel Genellina
stake somewhere else. If the function is supposed to return a *different* dictionary each time, ensure that, don't "fix" the result value after it has returned. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: zProblem

2009-04-10 Thread Gabriel Genellina
En Fri, 10 Apr 2009 21:14:01 -0300, norseman escribió: norseman wrote: Gabriel Genellina wrote: En Fri, 10 Apr 2009 14:50:57 -0300, norseman escribió: However, in order to explain my problem, I need to control the font since text graphics only work for a given font. It's as small

Re: zProblem

2009-04-10 Thread Gabriel Genellina
En Fri, 10 Apr 2009 14:50:57 -0300, norseman escribió: However, in order to explain my problem, I need to control the font since text graphics only work for a given font. It's as small as I can get it. I didn't understand what your problem is actually. -- Gabriel Genellin

Python-URL! - weekly Python news and links (Apr 8)

2009-04-08 Thread Gabriel Genellina
QOTW: "Those who show promise can advance to our Winter Improve Python to Expert program, for an additional fee, and, be given expert tutoring to help you gain our exemplary A.R.S.E./W.I.P.E certification which is guaranteed to attract certain types of employers by its name alone." - Paddy3118

Re: Injecting python function in an embedded python engine

2009-04-07 Thread Gabriel Genellina
how to inject a new function in an already imported module. Easy (so I wonder whether I misunderstood your question): some_module.function_name = new_function_object or setattr(some_module, function_name, new_function_object) or use PyObject_SetAttr/PyObject_SetAttrString in C code. -- Gabrie

Re: Incomplete exception tracebacks when importing from zipped modules

2009-04-07 Thread Gabriel Genellina
ld be able to find it reported somewhere at http://bugs.python.org -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting a PIL image object to a buffer

2009-04-07 Thread Gabriel Genellina
lipboardData should be a handle to a bitmap resource, not a string. See win32\test\test_clipboard.py for an example. PS: Hmm, looking at SetClipboardData, seems that a string containing the data in the right format *might* work too. But it's easier to use LoadImage than building the resource

Re: Adding method to class at run-time: bad style?

2009-04-07 Thread Gabriel Genellina
ed more "inside" information (the names of all the different subclasses). New style classes have a __subclasses__() method that could be used to find all of them (*at a certain moment*) -- but considering all the issues, I think that monkey-patching the base class is the "l

Re: Cannot find text in *.py files with Windows Explorer?

2009-04-05 Thread Gabriel Genellina
soft.com/?kbid=309173 [2] http://channel9.msdn.com/wiki/desktopsearchifilters/ -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Cannot find text in *.py files with Windows Explorer?

2009-04-05 Thread Gabriel Genellina
soft.com/?kbid=309173 [2] http://channel9.msdn.com/wiki/desktopsearchifilters/ -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: with open('com1', 'r') as f:

2009-04-04 Thread Gabriel Genellina
56k Ram64k EPROM date 5/13/96 DSP date 5/13/96 EPROM rev 2.0 DSP rev2.0 OK ^C -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: with open('com1', 'r') as f:

2009-04-04 Thread Gabriel Genellina
;              print('line') Why bother, why not just     for line in open('com1', 'r') :         print line Interesting :) So its does the same thing as with right ? Automatic closing and finalizing stuff. No, it does not. Either use `with` o a `try...finally` bl

Python-URL! - weekly Python news and links (Apr 3)

2009-04-03 Thread Gabriel Genellina
QOTW: "A programmer has to know the name of many data structures." - bearophile Code organization: how to split a project into modules http://groups.google.com/group/comp.lang.python/browse_thread/thread/56c320cea02796cc/ A speech generator, expert in leading-edge W

Re: with open('com1', 'r') as f:

2009-04-03 Thread Gabriel Genellina
/msdn.microsoft.com/en-us/library/aa363196(VS.85).aspx pySerial takes care of all those details, as suggested. Maybe its a bug in open() on windows? open() doesn't care about the file name; it's the OS that interprets "com1" as a serial port. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: config parser -help - anybody please immediately help for me...

2009-04-03 Thread Gabriel Genellina
En Fri, 03 Apr 2009 08:46:17 -0300, Murali kumar escribió: Is there anyway to read all my configuration filenames with extension (.cfg)? See the glob module http://docs.python.org/library/glob.html glob.glob(os.path.expanduser('~/*.cfg')) -- Gabriel Genellina -- http://mail.

Re: Regression test

2009-04-03 Thread Gabriel Genellina
too -- I assume they were considered minor issues... -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe problem

2009-04-03 Thread Gabriel Genellina
En Fri, 03 Apr 2009 03:55:20 -0300, Wolfgang Forstmeier escribió: On 03.04.2009 05:29, Gabriel Genellina wrote: En Thu, 02 Apr 2009 08:06:22 -0300, Wolfgang Forstmeier escribió: On 02.04.2009 11:34, Gabriel Genellina wrote: En Wed, 01 Apr 2009 17:51:52 -0300, Wolfgang Forstmeier escribió

Re: py2exe problem

2009-04-02 Thread Gabriel Genellina
En Thu, 02 Apr 2009 08:06:22 -0300, Wolfgang Forstmeier escribió: On 02.04.2009 11:34, Gabriel Genellina wrote: En Wed, 01 Apr 2009 17:51:52 -0300, Wolfgang Forstmeier escribió: what kind of error do I have with getting this error at starting my app. Im am not using IdleConf.GetOption

Re: py2exe problem

2009-04-02 Thread Gabriel Genellina
En Thu, 02 Apr 2009 08:06:22 -0300, Wolfgang Forstmeier escribió: On 02.04.2009 11:34, Gabriel Genellina wrote: En Wed, 01 Apr 2009 17:51:52 -0300, Wolfgang Forstmeier escribió: what kind of error do I have with getting this error at starting my app. Im am not using IdleConf.GetOption

Re: python for loop

2009-04-02 Thread Gabriel Genellina
a structure. Maybe the ratio is even less than that. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe problem

2009-04-02 Thread Gabriel Genellina
27; from section 'Keys'. returning default value: '' but do you use idle or idlelib in your application? -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe fails to make valid exe

2009-04-02 Thread Gabriel Genellina
etup.py: #python setup.py py2exe from distutils.core import setup import py2exe setup(console=['nameofprg.py']) This would be the minimal setup.py, and works with most simple programs. Note that some modules and libraries have special needs. What modules do you use in your code? --

Re: modifying a list element from a function

2009-04-02 Thread Gabriel Genellina
I imagine that you process the whole list: for elem in some_list: set_elem_1(elem, new_value) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: how to optimize zipimport

2009-04-02 Thread Gabriel Genellina
orted, it isn't loaded again, even from a zip file. Surely there is another reason for the delay, not the import itself. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Help for Toplevel

2009-04-02 Thread Gabriel Genellina
shouldn't the last line be ScrolledList(alist,new)? -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Hands on Python - Problem with Local Cgi Server

2009-04-02 Thread Gabriel Genellina
(e.g. 8765) both in the browser address and the Python script. The py file brings up the DOS box as if its running ok And you don't see any error message in the console? It doesn't close automatically? -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: How to pass one HTML values to another HTML

2009-04-02 Thread Gabriel Genellina
, you may start here: http://code.google.com/intl/en/appengine/docs/ -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: An inheritance question: getting the name of the "one up" class

2009-03-31 Thread Gabriel Genellina
En Tue, 31 Mar 2009 05:16:47 -0300, Steven D'Aprano escribió: On Tue, 31 Mar 2009 01:29:50 -0300, Gabriel Genellina wrote: Oh, and while the gurus are at it, what would be the advantage (if any) of changing, say Primate.__init__(self) to super(Human, self).__init__() None, i

Re: An inheritance question: getting the name of the "one up" class

2009-03-30 Thread Gabriel Genellina
ld be the advantage (if any) of changing, say Primate.__init__(self) to super(Human, self).__init__() None, if you use single inheritance everywhere. super is very tricky; see: http://fuhm.net/super-harmful/ and http://www.artima.com/weblogs/viewpost.jsp?thread=236275 -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Unix programmers and Idle

2009-03-30 Thread Gabriel Genellina
seful, I'd say... -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Relative Imports, why the hell is it so hard?

2009-03-30 Thread Gabriel Genellina
En Mon, 30 Mar 2009 21:15:59 -0300, Aahz escribió: In article , Gabriel Genellina wrote: I'd recommend the oposite - use relative (intra-package) imports when possible. Explicit is better than implicit - and starting with 2.7 -when "absolute" import semantics will be ena

Re: Unix programmers and Idle

2009-03-30 Thread Gabriel Genellina
hard to believe, but AFAIK, there is no way to set the program arguments from inside IDLE (and I'd love to be proven wrong!). You have to set sys.argv by code in your main entry point: sys.argv[1:] = ["--strict", "--debug", "file.dat"] or sys.argv[1:] = "

Re: unpack the source tarball on Windows

2009-03-30 Thread Gabriel Genellina
ype at the Cygwin prompt to unpack this puppy? Are you asking how to decompress a .bz2 file? Instead of cygwin, I prefer native executables. You can get one from: http://www.bzip.org/downloads.html I think you're interested in the Demo\turtle directory. -- Gabriel Genellina -- http://mail.pyt

Re: recursive outline numbering for object trees

2009-03-30 Thread Gabriel Genellina
En Mon, 30 Mar 2009 17:34:32 -0300, Alia K escribió: Thanks Gabriel. Your solution works like a charm. (-: You should thank Aaron Brady who wrote the original function. I just smoothed some edges and glued it with your own code. -- Gabriel Genellina -- http://mail.python.org/mailman

Re: recursive outline numbering for object trees

2009-03-30 Thread Gabriel Genellina
dren: for subnode in walk(child, o): yield subnode o.throw(up) (BTW, there is a proposal for a "yield from" statement, so the last part would become: o.throw(down) for child in node.children: yield from walk(child, o) o.throw(up) and I think it's a lot clearer) > As an aside, if a solution is possible as an external walk function > would it be possible to work in __iter__? return walk(self) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems with background processes on Windows

2009-03-29 Thread Gabriel Genellina
Gabriel Genellina yahoo.com.ar> writes: > En Sat, 28 Mar 2009 06:03:33 -0300, geoffbache jeppesen.com> > escribió: > > > > Well yes, but the point is surely that the standard output of the > > background sleeping process is pointed to a different location? (you &

Python-URL! - weekly Python news and links (Mar 28)

2009-03-28 Thread Gabriel Genellina
QOTW: "Knowing C++ does tend to be a bit of a handicap, but I think any competent programmer could learn Python." - Grant Edwards Introducing Python to others - which amazing features to show? http://groups.google.com/group/comp.lang.python/t/6e366356eca17c98/ Do dee

Re: Problems with background processes on Windows

2009-03-28 Thread Gabriel Genellina
plementations for Windows and Linux - it tries hard to hide the differences, but they're not the same thing. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Calendar module: HTMLCalendar overrides style sheet settings

2009-03-28 Thread Gabriel Genellina
En Sat, 28 Mar 2009 04:04:18 -0300, Chris Rebert escribió: On Fri, Mar 27, 2009 at 6:24 PM, Gabriel Genellina wrote: En Fri, 27 Mar 2009 17:48:33 -0300, Sibylle Koczian escribió: Terry Reedy schrieb: Calendar is an ancient and not-well-maintained module which may even predate html

Re: Profiler throws NameError on any function

2009-03-28 Thread Gabriel Genellina
#x27;re first *importing* dummy.py and then *calling* prof(). Call prof() directly inside dummy.py and it should work. That is, add this line at the end: prof() and invoke it using: python dummpy.py -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Ordered Sets

2009-03-28 Thread Gabriel Genellina
latter rant has been building up for a while (spurred on by a sojourn into the unittest code where they have the private disease in spades. My commiserations. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory Leak after Py_Finalize()

2009-03-27 Thread Gabriel Genellina
if at all possible, try to avoid calling Py_Initialize and Py_Finalize more than once. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Help in reading the pdf file

2009-03-27 Thread Gabriel Genellina
DF is rather difficult. It's a "presentation" format (or "display" format); every word in the document might be absolutely positioned, there is no paragraph structure you can rely on. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Import aliases for moving a module?

2009-03-27 Thread Gabriel Genellina
inside foo\__init__.py) *every* name that was present in the old foo package. If this is not feasible (there are many names, or loading all of them would be too slow, or whatever) you may implement a "lazy" importer. See __init__.py in the email package for an example. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: file transfer over LAN

2009-03-27 Thread Gabriel Genellina
) f.close() http://docs.python.org/library/socket.html#socket.socket.makefile http://docs.python.org/library/shutil.html#shutil.copyfileobj -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: how do you prevent distutils from downloading and building packages without consent?

2009-03-27 Thread Gabriel Genellina
s setuptools, which is a quite different distribution method. Have you read the setuptools documentation? Didn't you *test* your setup.py before making it available to the world? (Ouch, I didn't notice your earlier reply when I posted mostly the same thing, sorry!) -- Gabriel Gene

Re: Calendar module: HTMLCalendar overrides style sheet settings

2009-03-27 Thread Gabriel Genellina
Stichting Mathematisch Centrum, Amsterdam import calendar calendar.prmonth(2009,3) March 2009 Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: how do you prevent distutils from downloading and building packages without consent?

2009-03-27 Thread Gabriel Genellina
version='1.0', packages=['foo']) Two statements, nothing more. To include an extension module bar.c: setup(... ext_modules=[Extension('bar', ['bar.c', 'other.c'])], ...) See http://docs.python.org/distutils/index.html -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Python print and types selection

2009-03-27 Thread Gabriel Genellina
ave to stay with 2.5 I'm afraid any solution would require to modify your code: -- put long() around those arguments -- "%s" % format_hex(val) (where format_hex does the long conversion) -- redefine __str__ and use %s -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: C extension using GSL

2009-03-27 Thread Gabriel Genellina
in Python to see the reference count for an object: py> from sys import getrefcount as rc py> x = object() py> rc(x) 2 # the name x, and a temporary reference as parameter py> rc([]) 1 # only the temporary reference py> x = y = [] py> rc(x) 3 py> x = () py> rc(x)

Re: Cross platform installer builder for Python? (like IzPack for Java)

2009-03-25 Thread Gabriel Genellina
distutils. To distribute complete applications, py2exe + InnoSetup (Windows). -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Relative Imports, why the hell is it so hard?

2009-03-25 Thread Gabriel Genellina
En Tue, 24 Mar 2009 21:57:12 -0300, Istvan Albert escribió: On Mar 24, 3:16 pm, "Gabriel Genellina" wrote: Did you know, once a module is imported by the first time yeah yeah, could we not get sidetracked with details that are not relevant? what it obviously means is to import

<    5   6   7   8   9   10   11   12   13   14   >