Re: except KeyError, everywhere

2011-06-06 Thread Gabriel Genellina
lementation in the standard library Yes, there is, in Python 3.2: http://docs.python.org/py3k/library/functools.html#functools.lru_cache -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: GIL in alternative implementations

2011-06-06 Thread Gabriel Genellina
change its meaning from one iteration to the next, so a complete name lookup is required at each iteration. This is very useful sometimes, but affects performance a lot. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Print Window on IDLE

2011-06-06 Thread Gabriel Genellina
the [General] section: print-command-posix=lpr %%s print-command-win=start /min notepad /p %%s (%s should become %%s). Tested on Windows, but Linux should have the same problem and temporary solution. You may need to roll this change back when the code is corrected. Reported as http://bugs.python.org/issue12274 -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: sys.tracebacklimit not working in Python 3.2?

2011-06-07 Thread Gabriel Genellina
issue12276 -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Function call arguments in stack trace?

2011-06-07 Thread Gabriel Genellina
ack.py in c(foo=90, bar=1) 26 "This is function c" 27 baz = foo+bar 28 spam.somenamethatdoesnotexist(foo+bar) 29 anotherglobal("thatdoesnotexisteither") 30 global spam = [] spam.somenamethatdoesnotexist undefined foo = 90 bar = 1 AttributeError: 'list

Re: Problems Compiling Python 2.6.7 for Win7

2011-06-08 Thread Gabriel Genellina
st of the other sources claiming to provide it. Doesn't http://www.microsoft.com/express/Downloads/#2008-Visual-CPP work for you? I didn't try past the initial download prompt, but it seems to be the right version. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: help on QUICKFIX

2011-06-10 Thread Gabriel Genellina
a mailing list - I think you'll get more help there. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Unsupported operand type(s) for +: 'float' and 'tuple'

2011-06-10 Thread Gabriel Genellina
above, I'd avoid using indexes, take two random nodes using random.sample instead, and avoid adjacency_list(): while True: a, b = random.sample(nod, 2) if b not in G[a]: break GG.add_edge(a, b) (mmm, I'm unsure of the adjacency test, I've used networkx some time ago but I don't have it available right now) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Unsupported operand type(s) for +: 'float' and 'tuple'

2011-06-10 Thread Gabriel Genellina
above, I'd avoid using indexes, take two random nodes using random.sample instead, and avoid adjacency_list(): while True: a, b = random.sample(nod, 2) if b not in G[a]: break GG.add_edge(a, b) (mmm, I'm unsure of the adjacency test, I've used networkx some time ago but I don't have it available right now) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.7.2 for Windows reports version as 2.7.0?

2011-06-22 Thread Gabriel Genellina
0 twice, "for all users" and also "for current user only", and both in the same directory (c:\python27). That could explain the old .dll in the install directory; the new one goes into system32, but the old one takes precedence. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: search through this list's email archives

2011-06-24 Thread Gabriel Genellina
En Thu, 23 Jun 2011 13:11:32 -0300, Cathy James escribió: I looked through this forum's archives, but I can't find a way to search for a topic through the archive. Am I missing something? Gmane provides a search capability also: http://blog.gmane.org/gmane.comp.python.general

Re: search through this list's email archives

2011-06-24 Thread Gabriel Genellina
En Fri, 24 Jun 2011 11:33:23 -0300, Grant Edwards escribió: On 2011-06-24, Gabriel Genellina wrote: En Thu, 23 Jun 2011 13:11:32 -0300, Cathy James escribi?: I looked through this forum's archives, but I can't find a way to search for a topic through the archive. Am I missing

Re: from module import * using __import__?

2011-07-04 Thread Gabriel Genellina
quot;import pickle" in your code; if the fast module is present, it is automatically loaded and used; else, the slow but compatible version is used. You don't even have to know that an alternative implementation exists. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Execute a method in a file in an egg

2011-08-24 Thread Gabriel Genellina
En Tue, 23 Aug 2011 13:14:06 -0300, RVince escribió: Is there a way to do this from the command line? Thanks. Something like this? python -c "import the.module;the.module.someclass().method(arguments)" -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling Script from Command line not working

2011-09-01 Thread Gabriel Genellina
e = None cyg.cygwin_dll_init() #hangs or returns here ... Anyway, I don't see why a console application would fail but not inside IDLE. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Handling 2.7 and 3.0 Versions of Dict

2011-09-02 Thread Gabriel Genellina
ctValues, despite being "indented", is defined at global scope, and may be used anywhere in the module. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Help required accessing dictionary

2011-09-02 Thread Gabriel Genellina
s((op)->ob_type, Py_TPFLAGS_INT_SUBCLASS) /* from object.h */ #define PyType_FastSubclass(t,f) PyType_HasFeature(t,f) #define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Invoking profile from command line prevent my sys.path modification

2011-09-02 Thread Gabriel Genellina
hon.org/install/index.html#modifying-python-s-search-path -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Handling 2.7 and 3.0 Versions of Dict

2011-09-02 Thread Gabriel Genellina
En Fri, 02 Sep 2011 13:53:37 -0300, Travis Parks escribió: On Sep 2, 12:36 pm, "Gabriel Genellina" wrote: En Wed, 31 Aug 2011 22:28:09 -0300, Travis Parks escribi : > On Aug 31, 7:37 pm, Gregory Ewing wrote: >> Ian Kelly wrote: >> > if sys.version_info &l

Re: puzzle about file Object.readlines()

2011-03-22 Thread Gabriel Genellina
MS-DOS, which borrowed from CP/M, an > > operating > > system which stored the file size as the number of 128-byte records. > > chr(26) was used to > > indicate where the text ended in the last record. > > On Win a ctrl-z is end of file.  So if you want to read beyond the end > of a text file, you have to pretend it's binary.  Open it with  "rb" > instead of "r" Using mode "rU" may be more convenient, because it still translates \r \n into \n but disregards chr(26) as a special marker. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: How to build and upload eggs to pypi?

2011-03-22 Thread Gabriel Genellina
l: http://wiki.python.org/moin/CheeseShopTutorial To add a new version, simply increment the version number, and then "python setup.py upload" should be enough. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: PYTHONPATH

2011-04-15 Thread Gabriel Genellina
ories like ~/.local/lib/python2.6/site-packages and %APPDATA%\Python\Python26\site-packages (see PEP370 [1] for details) so you don't even have to mess with the Python installation directories. [1] http://www.python.org/dev/peps/pep-0370/ -- Gabriel Genellina -- http://mail.python.org/m

Re: argparse parser stores lists instead of strings

2011-04-28 Thread Gabriel Genellina
ng, but that's not really something I want to do, especially if I start adding more options. That's because of nargs=1. From the argparse documentation: [1] Note that nargs=1 produces a list of one item. This is different from the default, in which the item is produced by itself. So, just remove nargs=1 from add_argument() [1] http://docs.python.org/py3k/library/argparse.html#nargs -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Access violation reading 0x00000010

2011-04-28 Thread Gabriel Genellina
those two lines of code, I'd say the problem is inside SIM_init() itself. It may be attempting to dereference a NULL pointer: accessing a field inside a struct, or calling a virtual function from a NULL object... Also, make sure CDLL is the right choice; it implies a prototype like t

Re: How to upload a file

2011-04-28 Thread Gabriel Genellina
battery isn't included (yet - see http://bugs.python.org/issue3244) but this little library may help: https://bitbucket.org/chrisatlee/poster -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Testing tools classification

2011-05-09 Thread Gabriel Genellina
En Sat, 07 May 2011 02:21:02 -0300, rusi escribió: There is this nice page of testing tools taxonomy: http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy But it does not list staf: http://staf.sourceforge.net/index.php. The good thing about wikis is, you can add it yourself. -- Gabriel

Re: This it is the code of tmb_import.py (to matter of .tmb to blender) I need tmb_exporter.py (to export of blender to .tmb) Thanks.

2011-05-10 Thread Gabriel Genellina
, así que tal vez te convenga preguntar en un foro como: http://www.g-blender.org/ (específicamente dedicado a Blender 3D en español) También está la comunidad de Python Argentina: http://python.org.ar/pyar/ (busca la lista de correo) Suerte! -- Gabriel Genellina -- http://mail.python.org

Re: NewBie Doubt in Python Thread Programming

2011-05-11 Thread Gabriel Genellina
tiveCount is the original Java spelling. 5. is there a way to find out if the thread is still active or dead? Yes, use is_alive() -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Peculiar Behaviour of __builtins__

2011-05-12 Thread Gabriel Genellina
://docs.python.org/library/__builtin__.html Note: using getattr with a literal name is not so useful. Better to use dot notation. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Peculiar Behaviour of __builtins__

2011-05-12 Thread Gabriel Genellina
En Thu, 12 May 2011 22:59:24 -0300, Gabriel Genellina escribió: En Thu, 12 May 2011 20:29:57 -0300, Aman Nijhawan escribió: I was trying to call the builtin function min by using getattr(__builtins__,'min') This works at the interpretter prompt However when I called it insid

Re: Import on case insensitive filesystem

2011-05-16 Thread Gabriel Genellina
g/dev/peps/pep-0235/ for details. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: turn monitor off and on

2011-05-16 Thread Gabriel Genellina
is buggy or does not implement the required functionality. Mine is from Philips. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Datetime.timedelta

2011-05-17 Thread Gabriel Genellina
elta + hours datetime.timedelta(1, 37800) py> def dhms_from_timedelta(td): ... return td.days, td.seconds // 3600, (td.seconds % 3600) // 60, td.seconds % 60 ... py> dhms_from_timedelta(delta + hours) (1, 10, 30, 0) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: FW: help please

2011-05-17 Thread Gabriel Genellina
ld be the python-win32 list: http://mail.python.org/mailman/listinfo/python-win32 Good luck! -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: cPickle -> invalid signature

2011-05-17 Thread Gabriel Genellina
quite portable, even cross-version. As a generic answer, make sure you open the file in binary mode, both when writing and reading. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: FW: help please

2011-05-17 Thread Gabriel Genellina
se refresh my memory? -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: cPickle -> invalid signature

2011-05-17 Thread Gabriel Genellina
En Tue, 17 May 2011 15:26:53 -0300, Neal Becker escribió: Gabriel Genellina wrote: En Tue, 17 May 2011 08:41:41 -0300, Neal Becker escribió: What does it mean when cPickle.load says: RuntimeError: invalid signature Is binary format not portable? Are you sure that's the actual

Re: cPickle -> invalid signature

2011-05-17 Thread Gabriel Genellina
En Tue, 17 May 2011 15:26:53 -0300, Neal Becker escribió: Gabriel Genellina wrote: En Tue, 17 May 2011 08:41:41 -0300, Neal Becker escribió: What does it mean when cPickle.load says: RuntimeError: invalid signature Is binary format not portable? Are you sure that's the actual

Re: Multiple file select with tkFileDialog passes back 'decorated' strings (sometimes)

2011-05-23 Thread Gabriel Genellina
arse both, not an issue but it raises the question: Are these the only two possibilities? Is it the same across platforms (I use Python 2.7 on Win Vista)? An old bug. See http://bugs.python.org/issue5712 for a workaround. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Hotshoting recursive function

2011-05-25 Thread Gabriel Genellina
not raise ProfileError anymore. Interpreting profile data is up to you... -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: pexpect: TIMEOUT no longer clears child.before

2011-05-25 Thread Gabriel Genellina
he author: www.noah.org -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to compute length of arbitrary dimension vector?

2011-05-30 Thread Gabriel Genellina
py> py> def f1(*args): ... return math.sqrt(sum(x*x for x in args)) ... py> def f2(*args): ... return math.sqrt(math.fsum(x*x for x in args)) ... py> pi=math.pi py> args=[pi]*16 py> abs(f1(*args)/4 - pi) 4.4408920985006262e-16 py> abs(f2(*args)/4 - pi) 0.0 -- Gabriel G

Re: Alternatives to PythonPath

2011-05-31 Thread Gabriel Genellina
(2.6 and up), on Windows it is located at %APPDATA%\Python\PythonXX\site-packages. Every user gets its own %APPDATA% directory, with read and write permissions. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Pickle to source code

2005-10-26 Thread Gabriel Genellina
tool, gnosis xml is another) so I believe I could build something based on them. But I dont want to reinvent the wheel, I wonder if anyone knows of a library which could do what I want? Thanks, Gabriel Genellina Softlab SRL -- http://mail.python.org/mailman/listinfo/python-list

Re: Pickle to source code

2005-10-26 Thread Gabriel Genellina
Benjamin Niemann ha escrito: > Gabriel Genellina wrote: > > > I want to convert from pickle format to python source code. That is, > > given an existing pickle, I want to produce a textual representation > > which, when evaluated, yields the original object (as if

Re: Pickle to source code

2005-10-26 Thread Gabriel Genellina
code and attribute values of the class instance, there > is no problem to produce a textual representation of the object. Isn't it? Yes, but I need it for many different objects, some of them written by other people. Please see my next post for clarification. Gabriel Genel

Re: Pickle to source code

2005-10-26 Thread Gabriel Genellina
nvolving the persistent_id mechanism of pickles, but I think it should not be too difficult. In this example, if xxx.z points to another external instance for which persistent_id returns '1234', would suffice to output another line like: xxx.z = external_reference('1234') I ho

Re: Pickle to source code

2005-10-26 Thread Gabriel Genellina
useful. If any changes are needed I'll report them. Gabriel Genellina Softlab SRL -- http://mail.python.org/mailman/listinfo/python-list

Re: Pickle to source code

2005-10-26 Thread Gabriel Genellina
obj.done > (1, 2, 1) Er... Touché :) - What year did World War II finish? - Same year the Potsdam Conference was held. - When was that? - The year World War II finished. I should have stated that I need an *explicit* string... Gabriel Genellina Softlab SRL -- http://mail.python.org/mailman/listinfo/python-list

Re: Error 'module' object has no attribute "_extension_registry" when cPickle is imported from an installed Python 2.7.1

2011-09-27 Thread Gabriel Genellina
odule' object has no attribute '_extension_registry' Looking at cPickle.c, it imports the copy_reg module and then looks for its "_extension_registry" attribute. Maybe your copy_reg.py is broken, or you have another copy_reg.py hiding the standard one. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: syntactic sugar for def?

2011-09-28 Thread Gabriel Genellina
STORE_NAME 0 (foo) 9 LOAD_CONST 1 (None) 12 RETURN_VALUE To get at the actual function code, one should use f.func_code.co_consts[0]; this would be the 'code' parameter for types.FunctionType. Very complicated, really; nothing can beat the 'def' statement for defining a function ;) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing Python 2.6.7 on Windows

2011-09-28 Thread Gabriel Genellina
2.6.7 (or apply only the .py changes) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Change import order with *.pth files

2011-10-03 Thread Gabriel Genellina
set the PYTHONPATH environment variable, or edit the site.py standard module. This may be fine in your development environment, but I would never do that in production. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: BaseHTTPServer ThreadMixIn not working

2011-10-04 Thread Gabriel Genellina
invalid and knows she cannot re-use the received body and has to issue the second request and waits again and ... Try with different URLs for each request: http://localhost:8080/a http://localhost:8080/b http://localhost:8080/c and you'll see they all are processed in parallel. -- Ga

Re: Is exec() also not used in python 2.7.1 anymore?

2011-10-04 Thread Gabriel Genellina
block, or perhaps locals(); # modify accordingly -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: database connection

2011-10-07 Thread Gabriel Genellina
user who can read the database file can connect to it. sqlite does not have internal users, and does not implement GRANT/REVOKE statements. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: How to inspect slot wrappers arguments in Python?

2011-10-07 Thread Gabriel Genellina
ments is encoded in its 'format' parameter, and is not stored anywhere. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: sending ftp file list to mail???

2011-10-07 Thread Gabriel Genellina
En Fri, 07 Oct 2011 03:23:57 -0300, selahattin ay escribió: hi all. I want to get my ftp list and send the list to my mail adress... my codes are And your problem is...? -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: sending ftp file list to mail???

2011-10-07 Thread Gabriel Genellina
s a string. retrlines, by default, outputs to stdout, isn't very useful. Try this: def posta_olustur(): ... lines = [] baglanti.retrlines("LIST", lines.append) text = '\n'.join(lines) posta.attach(MIMEText(text)) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: socket.getsockname is returning junk!!

2011-10-07 Thread Gabriel Genellina
1) I'd say it's a problem with the _socket module; did the unit tests flag anything when you built Python? On Windows, Python 2.7.1: server_address=('lepton', 1) sock.bind(server_address) sock.getsockname() ('127.0.0.1', 1) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Deleting files on a shared server

2011-10-07 Thread Gabriel Genellina
open. [1] http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/openfiles.mspx -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: why msvcrt.printf show the first char only?

2011-10-15 Thread Gabriel Genellina
ng, and stops as soon as it sees the '\0' following the 'T' in 'Testing'. Either use wprintf("Testing..."), or encode the Unicode object into a byte string before calling: printf("Testing...".encode(sys.stdout.encoding)), or tell ctypes about the right parameter type: printf = msvcrt.printf printf.argtypes = [c_char_p] printf("Testing\n") -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Fast recursive generators?

2011-10-28 Thread Gabriel Genellina
s print list(itertools.islice(my_generator(), 10)) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: When I use Python under Windows. I found some file handles are not closed,

2011-11-01 Thread Gabriel Genellina
the Python version you're using. Also, a small, complete, runnable code example showing the problem would be very valuable. Usually, in building such example, you may well find out where your problem is. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

threading IOError

2005-12-13 Thread Gabriel Genellina
el módulo PYTHON24.DLL de 016f:1e0ab51f. Registros: EAX=1e19d1af CS=016f EIP=1e0ab51f EFLGS=00010206 EBX=00841f80 SS=0177 ESP=0071e6ec EBP= ECX=73962000 DS=0177 ESI=1e06a1b0 FS=1a07 EDX=1e19d1b0 ES=0177 EDI=0000 GS= Any ideas? Gabriel Genellina Softlab SRL -- http://mail.python.org/mailman/listinfo/python-list

Re: threading IOError

2005-12-15 Thread Gabriel Genellina
Andrew MacIntyre ha escrito: > Gabriel Genellina wrote: > > File "C:\Apps\Python\Lib\threading.py", line 218, in wait > > remaining = endtime - _time() > > IOError: [Errno 2] No such file or directory > > > > The error appears to be insi

Design Patterns in Python

2006-08-04 Thread Gabriel Genellina
go on this list. But does anyone know of a complete discussion/analysis of patterns in Python? Books, articles, web pages... Unfortunately the pattern-SIG is now defunct... Gabriel Genellina Softlab SRL __ Pre

Re: Design Patterns in Python

2006-08-07 Thread Gabriel Genellina
At Saturday 5/8/2006 22:22, Alex Martelli wrote: > But does anyone know of a complete discussion/analysis of patterns in > Python? Books, articles, web pages... Thanks to all of you for your pointers on this subject! Gabriel Genellina Softl

Re: python - HTML processing - need tips

2006-08-07 Thread Gabriel Genellina
mitted, and then build a compatible Request. On many sites you don't even need to *get* the login page -nor parse it-, just posting the right Request is enough to log in successfully. Gabriel Genellina '@'.join(('gagsl-

Re: Accessing Yahoo Mail withtout POP

2006-08-08 Thread Gabriel Genellina
At Tuesday 8/8/2006 12:39, Dieter Deyke wrote: > Is there a way to access yahoo mail via its web interface? If so, can > someone give some pointers? www.freepops.org Very generic almost-anything-to-pop3, but it's not written in Python, uses LUA instead. Gabriel Genellina

Re: newb question: file searching

2006-08-08 Thread Gabriel Genellina
ot;images" instead of just the file name. See, when I go to use a particular image name later on, it won't do me much good if I don't have the path to it. Look at os.path.join() Gabriel Genellina Softlab SRL __

Re: newb question: file searching

2006-08-08 Thread Gabriel Genellina
if dirnames[i].startswith('.'): del dirnames[i] return imageList reversed() because you need to modify dirnames in-place, so it's better to process the list backwards. Gabriel Genellina Softlab SRL __

Re: os.path.normpath

2006-08-09 Thread Gabriel Genellina
idence (in fact it isn't...) URLs dont necesarily point to a real file on a real file system (Zope is an example). Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querí

Re: Nested function scope problem

2006-08-09 Thread Gabriel Genellina
(tok)>0: self.append(tok) tok = '' return tok ls = mylist() and use: tok = ls.addTok(tok) whenever the original code says addTok(tok) Gabriel Genellina Softlab SRL __ Preguntá. R

Re: Two Classes In Two Files

2006-08-09 Thread Gabriel Genellina
n't seem to find the answer. [...] When I run the Two.py file, I get the expected output but I'd like to eliminate the from line in two.py. Embody the Zen of Python: http://www.python.org/dev/peps/pep-0020/

Re: loop until keypress (Windows XP)

2006-08-09 Thread Gabriel Genellina
print "Hello world!" if kbhit(): stop = getch()=='q' kbhit() is used to detect when a keypress is waiting, so the next getch() will not block. Gabriel Genellina Softlab SRL __ Preguntá

Re: state of SOAP and python?

2006-08-10 Thread Gabriel Genellina
real interoperability, maybe just extending to support long integers could be easier... I remember extending once to support NaN's, moving to SOAP was too much effort for that application. Gabriel Genellina S

Re: Escape sequences (colour) and padding with "%8s"%

2006-08-10 Thread Gabriel Genellina
es library... print '\x1b[34m%8s\x1b[0m' % 'TEST' Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuest

RE: seaching a list...

2006-08-11 Thread Gabriel Genellina
ter than the network overhead, and the associated multiple db calls... should... are you sure? How many rows on the database? how many rows to compare? network overhead? Do some timing/performance tests to evaluate that. Things aren't always as you expect. Gabr

Re: Tab delimited file

2006-08-11 Thread Gabriel Genellina
true in general for any language, not only Python. > Assuming this is true, how do i find where the > tabs are in the file so that I can distinguish between the different criteria? >Assuming this is not true, does anyone suggest another way to do it? Look at the csv module: http://docs.

Re: seeking the "Hello World" of Packages

2006-08-11 Thread Gabriel Genellina
you could use: import MyPackage MyPackage.printHelloWorld() Note: In order to be able to import MyPackage, the directory MyPackage must be a subdir of anything listed on sys.path. It's unlikely that C:\MyPackage would work. Try using python\lib\site-packages instea

Re: Learning Python

2006-08-11 Thread Gabriel Genellina
R, Y = a if poly(10, M,O,N,E,Y) == poly(10, S,E,N,D) + poly(10, M,O,R,E): which is infinitely more legible (and a bit compact, too). (poly is left as an exercise: def poly(x, *args): ) And a,b,s are too short names... Gabriel Genellina Softlab SRL

Re: Newbie Python SQL

2006-08-14 Thread Gabriel Genellina
ython book, but all take a very introductory approach. Any recommendation would be appreciated. I think you need an SQL/database course rather than a Python one. Gabriel Genellina Softlab SRL __ Preguntá. Res

Re: looking for a simple way to load a program from another python program..

2006-08-14 Thread Gabriel Genellina
you tried os.system("cabel.py") Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuestas (Beta). ¡Probalo ya! htt

Re: sending mailing list with smtplib

2006-08-14 Thread Gabriel Genellina
At Monday 14/8/2006 10:22, 3KWA wrote: # ... but the actual message sending in a loop to send one email each (didn't work) Specify "didn't work" at least... see http://www.catb.org/~esr/faqs/smart-questions.html Gabriel G

Re: why the method get() of python Queue is hang on there?

2006-08-14 Thread Gabriel Genellina
At Monday 14/8/2006 12:35, zxo102 wrote: Thanks for your guys. I got it. I thought Queue can be used anywhere in the code and the second b.get() would return a "None". You can use a list as a generic queue, with append (== push) and pop(0) Gabriel Genellina S

Re: OT: p-gal website

2006-08-14 Thread Gabriel Genellina
? They are "true" and "real" international standards. Do you know what ISO is? HTML 4.01 is ISO/IEC 15445; see https://www.cs.tcd.ie/15445/15445.html Gabriel Genellina Softlab SRL __ Preguntá. Resp

Re: Python for arcgis

2006-08-18 Thread Gabriel Genellina
At Thursday 17/8/2006 00:25, subramanian2003 wrote: From where can I get the python tutorial for arcgis customisation?. Tried google? Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo

Re: Py2Exe and sys.argv : The Lost Arguments

2006-08-18 Thread Gabriel Genellina
lorer -some misbehaving context menu extension-. See <http://groups.google.com/group/microsoft.public.windowsxp.basics/browse_frm/thread/5d7a111f31fa7901> But, maybe next time, you could try and exclude all other variables (wxWindows, py2exe...) to keep things simple... Gabriel Genell

Re: Http client to POST using multipart/form-data

2006-08-18 Thread Gabriel Genellina
o use your custom HTTPConnection. Pass your custom HTTPHandler to build_opener and it will use it. Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imagi

Re: efficient memoize decorator?

2006-08-18 Thread Gabriel Genellina
example -function with no keyword arguments- use the much simpler implementation from <http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/325205> NOT the original recipe but the comment by Chris Spencer titled "A working example". Gabriel Genel

Re: Search or compai problem

2006-08-18 Thread Gabriel Genellina
unique object used as "nothing" or "no value". Try reading the Python tutorial, it's easy and you will learn a lot of things. Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Desc

Re: Documenting a package with Pydoc

2006-08-19 Thread Gabriel Genellina
erate now the docs for pychart: python c:\apps\python\lib\pydoc.py -w c:\apps\python\lib\site-packages\pychart Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo qu

Re: efficient memoize decorator?

2006-08-19 Thread Gabriel Genellina
#x27;s a pretty standard mantra. Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuestas (Beta). ¡Probalo ya! http://www.yahoo.co

Re: efficient memoize decorator?

2006-08-19 Thread Gabriel Genellina
line 49, in __call__ object = self.cache[args] = self.fn(self.instance, *args) AttributeError: 'Memoize' object has no attribute 'instance' For a standalone function, you should remove __del__ and self.instance, but I haven't

Re: Small Troll on notation of variables over time

2006-08-19 Thread Gabriel Genellina
* for *all* names would be ridiculous - objects would never get garbage collected, by example. And 99.% of programs don't need that behavior at all. So just implement that for your use case - if you have any! Gabriel Genellina Softla

Re: Search or compai problem

2006-08-21 Thread Gabriel Genellina
your items come from, but usually None is used to represent an empty/null value. It's not the same as "". Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber

Re: Need advice on how to improve this function

2006-08-22 Thread Gabriel Genellina
ds haven't changed very much lately :) ) Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuestas (Beta). ¡Probalo ya! http

Re: how do you get the name of a dictionary?

2006-08-22 Thread Gabriel Genellina
tandard OO, and there is no need to modify the Python language... Gabriel Genellina Softlab SRL p4.vert.ukl.yahoo.com uncompressed Tue Aug 22 17:27:05 GMT 2006 __ Preguntá. Respondé. Descubrí. Todo lo que querías s

Re: Job Jar

2006-08-22 Thread Gabriel Genellina
to be used for almost anything... It has nothing to do with version control. Gabriel Genellina Softlab SRL p5.vert.ukl.yahoo.com uncompressed Tue Aug 22 18:27:05 GMT 2006 __ Preguntá. Respondé. Descubrí. Todo lo q

  1   2   3   4   5   6   7   8   9   10   >