Re: my Python lib is broken

2007-10-06 Thread Guilherme Polo
2007/10/6, Bruno Rezende <[EMAIL PROTECTED]>: > Hi, > > I think I've broken my python installation (don't know how). All the > packages that are under 'lib' in python installation doesn't work the > way expected: > > >>> import xml > >>> xml.dom > Traceback (most recent call last): > File "", lin

Re: struct.unpack less than 1 byte

2007-10-10 Thread Guilherme Polo
2007/10/10, cprogrammer <[EMAIL PROTECTED]>: > hello all, > > i need to read from a file a struct like this [1byte, 12bits, 12bits] > reading 1 byte or more is not a problem ... but the 12 bits values > are ... > > thanks > > -- > http://mail.python.org/mailman/listinfo/python-list > 12bits, 12bit

Re: Selection error...

2007-10-21 Thread Guilherme Polo
2007/10/21, Abandoned <[EMAIL PROTECTED]>: > > > cursor.execute("SELECT id from templinks where url=%s", (URL,) ) > Yes i already try this before ask. > > URL.decode('latin-1').encode('utf-8') to transcode it into utf-8. > i know this but how do you know the html encoding's a latin-1 ? Try using c

Re: pure python data compression (zip)

2007-10-23 Thread Guilherme Polo
2007/10/23, Rene Maurer <[EMAIL PROTECTED]>: > Hallo > > I wonder if there are any pure python implementations available/known > for the zip (or any other) data compression... As far as I know > python's zlib uses http://www.zlib.net/, which is written in > C. Unfortunately this is not solution for

Re: crontab library

2007-10-24 Thread Guilherme Polo
2007/10/24, Martin Marcher <[EMAIL PROTECTED]>: > Hello, > > is anyone aware of a crontab library. > > Possibly even more complete, something that will let me > create/manipulate/delete crontab entries in a nice way and install the > new crontab accordingly. > > I had a look at the crontab docs and

Re: crontab library

2007-10-24 Thread Guilherme Polo
2007/10/24, Martin Marcher <[EMAIL PROTECTED]>: > 2007/10/24, Guilherme Polo <[EMAIL PROTECTED]>: > > 2007/10/24, Martin Marcher <[EMAIL PROTECTED]>: > > > I had a look at the crontab docs and never realized how complex it > > > actually is. So befor

Re: .py to sqlite translator [1 of 2]

2007-10-26 Thread Guilherme Polo
2007/10/26, smitty1e <[EMAIL PROTECTED]>: > Disclaimer(s): the author is nobody's pythonista. This could probably > be done more elegantly. > The driver for the effort is to get PyMacs to work with new-style > classes. > This rendering stage stands alone, and might be used for other > purposes. >

Re: Going past the float size limits?

2007-10-26 Thread Guilherme Polo
2007/10/26, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Hello all > It would be great if I could make a number that can go beyond current > size limitations. Is there any sort of external library that can have > infinitely huge numbers? Way way way way beyond say 5x10^350 or > whatever it is? Check t

Re: Insane crazy question - printing commands

2007-11-06 Thread Guilherme Polo
2007/11/6, Donn Ingle <[EMAIL PROTECTED]>: > Hi, > I'm doing something odd with pycairo and friends and I want to see what > commands are coming out of my objects. > > Here's some code: > > class Box: > def draw() > self.context.set_source_rgb(1, 0, 0) > self.context.rectangle(0, 00, 50, 50) >

Re: Insane crazy question - printing commands

2007-11-06 Thread Guilherme Polo
2007/11/6, Donn <[EMAIL PROTECTED]>: > > import inspect > > > > class Box: > > def draw(self): > > print "hi" > > return 3 > > > > x = Box() > > print inspect.getsource(x.draw) > > Tried that, but get this error. I did a dir(inspect) in the command env. and > getsource it definitely there... > > Tr

Re: Using Python To Change The World :)

2007-11-13 Thread Guilherme Polo
2007/11/14, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Hello, I'm a teen trying to do my part in improving the world, and me > and my pal came up with some concepts to improve the transportation > system. > > I have googled up and down for examples of using python to create a > city street but I can

Re: python safe scripting

2007-11-21 Thread Guilherme Polo
2007/11/21, Vladimir Rusinov <[EMAIL PROTECTED]>: > Hello! > > In one my project (it's logfile manager) I want to implement 'smart' > configuration files, e.g. > > logfile("/var/log/messages") > if (size() > 10*1024*1024) and (lavg() < 5): > execute("my_log_alerter") >rotate(save=10, compre

Re: why it is invalid syntax?

2007-11-22 Thread Guilherme Polo
2007/11/22, Stef Mientki <[EMAIL PROTECTED]>: > alf wrote: > > Hi, > > > > I wonder why it is an invalid syntax: > > > > > > >>> if 1: if 1: if 1: print 1 > > File "", line 1 > > if 1: if 1: if 1: print 1 > > > > > > or > > > > >>> if 1: for i in range(10): print i > > File "", line 1 > >

Re: [Python-3000] Possible Duck Typing Problem in Python 2.5?

2007-12-09 Thread Guilherme Polo
2007/12/9, hashcollision <[EMAIL PROTECTED]>: > From http://ivory.idyll.org/blog/dec-07/conversions.html: > class X: > internal = [5,6,7,8] > def __getitem__(self, i): > return self.internal[i] > > x = X() > > l = [1,2,3] > print l + x > > > > fails withTypeError: can only concatenate list (not

Re: Is anyone happy with csv module?

2007-12-11 Thread Guilherme Polo
2007/12/11, massimo s. <[EMAIL PROTECTED]>: > Hi, > > I'm struggling to use the python in-built csv module, and I must say > I'm less than satisfied. Apart from being rather poorly documented, I > find it especially cumbersome to use, and also rather limited. What I > dislike more is that it seems

Re: Inter-process communication, how? Part 2

2007-12-23 Thread Guilherme Polo
2007/12/22, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Hello, > > just to recap: last time I asked how to do an interprocess > communitation, between one Manager process (graphical beckend) and > some Worker processes. > > I decided to go with sockets, thanks for replies, once more. > > However, I wo

Re: Inter-process communication, how? Part 2

2007-12-24 Thread Guilherme Polo
2007/12/24, Bjoern Schliessmann <[EMAIL PROTECTED]>: > Hendrik van Rooyen wrote: > > <[EMAIL PROTECTED]> wrote: > > >> What I don't like about FIFO, is that on Unix they are persistent > >> files. So whatever happens to Manager they would stay there... > >> I was just wondering if there's another w

Re: Bug writing/reading to file.

2007-12-24 Thread Guilherme Polo
2007/12/24, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Hi! :) > > Im new to python, and I have made a electronic diary - its just a > task. Here is the code: > http://pastebin.com/m49391798 > > The bug is (feel free to download and test it) that i can't see what i > wrote in the diary without restart

Re: Damn error!

2007-12-24 Thread Guilherme Polo
Em 24/12/07, Vaurdan<[EMAIL PROTECTED]> escreveu: > Hello, > I've this code: > def print_tabela(tabela): > print "Tabela 1 | Tabela 2" > for linha in tabela: > tmp = linha.split(":") > print tmp[0] + " | " + tmp[1], > > But give me thi

Re: python syntax

2008-01-07 Thread Guilherme Polo
2008/1/7, mpho raborife <[EMAIL PROTECTED]>: > Please help me get this syntax right: > > os.system("HCopy -T 1 -C" 'os.path.join(conf_dir, "/hcopy.conf")' "-S" > 'os.path.join(list_dir, "hcopy_list.txt")') > import os import subprocess subprocess.Popen(["HCopy", "-T", "1", "-C", os.path.join(con

Re: How to refer to the current module?

2008-01-07 Thread Guilherme Polo
2008/1/7, Mike <[EMAIL PROTECTED]>: > I want to do something like the following (let's pretend that this is > in file 'driver.py'): > > #!/bin/env python > > import sys > > def foo(): > print 'foo' > > def bar(arg): > print 'bar with %r' % arg > > def main(): > getattr(driver, sys.argv[

Re: python syntax

2008-01-07 Thread Guilherme Polo
vfloor, "-n", number, "-r", results]) Only if you tell the problem. But I guess that you maybe passed arguments that aren't strings, so be sure to convert those arguments to strings. os.path.join in the previous situation didn't need any conversion because it already r

Re: I'm searching for Python style guidelines

2008-01-07 Thread Guilherme Polo
2008/1/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > There's a lot of dumb stuff out there. "Algorithms should be coded > efficiently ..." Thanks, I'll keep that in mind. > > van Rossum's guidelines tend toward "pick something and stick to it" > which is OK if you have enough experience to pick somet

Re: Launching a wx GUI from within our python framework

2008-01-07 Thread Guilherme Polo
2008/1/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Hi, > > At my work we have a framework writen in python which allows us to > test our equipment. This framework is quite large and uses a Singelton > called frameworkExec which we pass around between objects in order to > share functionailty. For e

Re: code doesn't reference immutables?

2008-01-07 Thread Guilherme Polo
2008/1/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > >From the manual: > > "code objects are immutable and contain no references (directly or > indirectly) to mutable objects" (3.2) > > I thought my code worked with both mutable and immutable objects. > Whassup? > What was your intention quoting thi

Re: dealing with binary files

2008-01-07 Thread Guilherme Polo
2008/1/7, Gerardo Herzig <[EMAIL PROTECTED]>: > Hi all. Im trying to read a binary data from an postgres WAL archive. > If i make a > xfile = open('filename', 'rb').xreadlines() > line = xfile.next() > > i see this sort of thing: > ']\xd0\x03\x00\x01\x00\x00\x00\r\x00\x00\x00\x00\x00\x00JM//DI+,D\x

Re: introspection question

2008-01-07 Thread Guilherme Polo
2008/1/7, Alex K <[EMAIL PROTECTED]>: > Nice thank you. But anyway to make it look pretty? > pprint.pprint(inspect.getmembers(someobject)) > On 07/01/2008, Peter Otten <[EMAIL PROTECTED]> wrote: > > Alex K wrote: > > > > > What would be the simplest way of enumerating all methods and members > >

Re: introspection question

2008-01-07 Thread Guilherme Polo
2008/1/7, Alex K <[EMAIL PROTECTED]>: > Hi Guys, > > What would be the simplest way of enumerating all methods and members > (including inherited) of a given object? Thank you. > > Alex > -- > http://mail.python.org/mailman/listinfo/python-list > import inspect inspect.getmembers(yourobject) --

Re: I'm searching for Python style guidelines

2008-01-07 Thread Guilherme Polo
2008/1/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Thank you both. > > Stupid me, went to Python.org and found Style Guidelines and thought > that was the last word. Oh well. > > PEP 8 reminds me a lot of Sun's Java conventions, in ways I wish it > didn't. The overall structure seems like a random

Re: any() and all() shorthand

2008-01-07 Thread Guilherme Polo
2008/1/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > any( iterab ) and all( iterab ) > > as shorthand for reduce( operator.or_, iterab ) and > reduce( operator.and_, iterab ). > > What do you think? > -- > http://mail.python.org/mailman/listinfo/python-list > You are too late, any and all are built-

Re: Does Python cache the startup module?

2008-01-07 Thread Guilherme Polo
2008/1/7, Baz Walter <[EMAIL PROTECTED]>: > Hello > > I remember reading somewhere (probably this list) that python may cache the > module that starts a program (e.g. 'main.py'). Something like mod_python will do caching. > I'm asking because I have found > that this can sometimes cause problems

Re: any() and all() shorthand

2008-01-07 Thread Guilherme Polo
2008/1/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > You are too late, any and all are built-in into python 2.5 > > Hi, excellent. Now how about something more generic, possibly: > > [ x.y() for x or _next_ in c ] > > where the context of _next_ is limited in complexity, and/or can only > occur in

Re: New Tk look (aka Ttk or Tile widgets)

2008-01-10 Thread Guilherme Polo
2008/1/10, Robert Hicks <[EMAIL PROTECTED]>: > Do I have to install something extra to use the new look? > > Robert > -- > http://mail.python.org/mailman/listinfo/python-list > Tk 8.5 -- -- Guilherme H. Polo Goncalves -- http://mail.python.org/mailman/listinfo/python-list

Re: list classes in package

2008-01-16 Thread Guilherme Polo
2008/1/16, Diez B. Roggisch <[EMAIL PROTECTED]>: > Dmitry wrote: > > > Hi All, > > > > I've trying to develop one Python application, and > > neet to solve one problem. I need to list all classes defined in one > > package (not module!). > > > > Could anybody please show me more convinient (correct

Re: paramiko

2008-01-16 Thread Guilherme Polo
2008/1/16, Tarun Kapoor <[EMAIL PROTECTED]>: > > > > > I am using paramiko to do an SFTP file transfer… I was able to connect to > the remote server using an SFTP client I have just to make sure that > username and password are working.. This is the code. > > > > # now, connect and use paramiko

Re: paramiko

2008-01-16 Thread Guilherme Polo
; > output: > not authenticated > This is a different problem I guess, now you are usin get_remote_server_key. And why are you creating event after calling start_client without specifying it ? > > > > On Jan 16, 11:11 am, "Guilherme Polo" <[EMAIL PROTECTED]> wro

Re: paramiko

2008-01-16 Thread Guilherme Polo
2008/1/16, Tarun Kapoor <[EMAIL PROTECTED]>: > On Jan 16, 11:38 am, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > > 2008/1/16, Tarun Kapoor <[EMAIL PROTECTED]>: > > > > > > > > > # now, connect and use paramiko Transp

Re: paramiko

2008-01-16 Thread Guilherme Polo
2008/1/16, Tarun Kapoor <[EMAIL PROTECTED]>: > On Jan 16, 12:22 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > > 2008/1/16, Tarun Kapoor <[EMAIL PROTECTED]>: > > > > > > > > > On Jan 16, 11:38 am, "Guilherme Polo" &l

Re: paramiko

2008-01-16 Thread Guilherme Polo
2008/1/16, Tarun Kapoor <[EMAIL PROTECTED]>: > On Jan 16, 1:56 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > > 2008/1/16, Tarun Kapoor <[EMAIL PROTECTED]>: > > > > > > > > > On Jan 16, 12:22 pm, "Guilherme Polo" &l

Re: how django discovers changed sources

2008-01-17 Thread Guilherme Polo
2008/1/17, alf <[EMAIL PROTECTED]>: > Jeff wrote: > > That is the behavior of the development server. When you are writing > > your application, you don't want to have to manually restart the > > server every time you change a file. On apache it obviously doesn't > > do that. > > thx for clarific

Re: Q: paramiko/SSH/ how to get a remote host_key

2008-01-21 Thread Guilherme Polo
2008/1/21, DHR <[EMAIL PROTECTED]>: > I'm trying to run the simpliest example form paramiko readme(Homepage: > http://www.lag.net/paramiko/), and > cannot find out how to get the remote SSH server host_key. > > > This is the code. It is supposed to connect to a remote SSH host and > execute an 'ls'

Re: Q: paramiko/SSH/ how to get a remote host_key

2008-01-21 Thread Guilherme Polo
s used. The default policy is to reject the key and raise an SSHException, but you can change that default policy to AutoAddPolicy > > > Guilherme Polo wrote: > > 2008/1/21, DHR <[EMAIL PROTECTED]>: > > > I'm trying to run the simpliest example form paramiko readme

Re: Q: paramiko/SSH/ how to get a remote host_key

2008-01-21 Thread Guilherme Polo
u dont need to import base64. Method decode of strings allows you to specify encoding as 'base64' to perform needed operations. > > On Jan 21, 3:10 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > > 2008/1/21, DHR <[EMAIL PROTECTED]>: > >

Re: UDP Client/Server

2008-01-22 Thread Guilherme Polo
2008/1/22, Martin Marcher <[EMAIL PROTECTED]>: > Hello, > > I created a really simple udp server and protocol but I only get every 2nd > request (and thus answer just every second request). > > Maybe someone could shed some light, I'm lost in the dark(tm), sorry if this > is a bit oververbose but t

Re: UDP Client/Server

2008-01-23 Thread Guilherme Polo
2008/1/23, Martin Marcher <[EMAIL PROTECTED]>: > Guilherme Polo wrote: > >> >>> class FooRequestHandler(BaseRequestHandler): > >> ... def handle(self): > >> ... data, addr_info = self.request[1].recvfrom(65534) > > > > Your

Re: A GUI framework for running simulations

2008-01-23 Thread Guilherme Polo
2008/1/23, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Hello! I am currently working on writing a simulation engine for > special relativity physics. I'm writing it in Python, of course. I'm > doing fine with the engine, but I want a GUI framework in which I > could use it conveniently, and test diffe

Creating new types and invoking super

2008-01-23 Thread Guilherme Polo
Hello, Before starting, let me show some sample codes so I can explain: class A(object): def __init__(self): super(A, self).__init__() x = type("X", (A, ), {})() This works fine, but suppose I have several classes like A and I would like to create a decorator to call super. First I

Re: Creating new types and invoking super

2008-01-23 Thread Guilherme Polo
2008/1/23, Arnaud Delobelle <[EMAIL PROTECTED]>: > On Jan 23, 8:55 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > > Hello, > > Hi > [...] > > First I tried this: > > > > def init(func): > > def _init(inst): > >

Re: Creating new types and invoking super

2008-01-23 Thread Guilherme Polo
2008/1/23, Guilherme Polo <[EMAIL PROTECTED]>: > 2008/1/23, Arnaud Delobelle <[EMAIL PROTECTED]>: > > On Jan 23, 8:55 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > > > Hello, > > > > Hi > > [...] > > >

Re: Creating new types and invoking super

2008-01-23 Thread Guilherme Polo
2008/1/23, Arnaud Delobelle <[EMAIL PROTECTED]>: > On Jan 23, 10:18 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > > 2008/1/23, Arnaud Delobelle <[EMAIL PROTECTED]>: > > > > > The only way I can think of would be to create a metaclass,

Re: object vs class oriented -- xotcl

2008-01-24 Thread Guilherme Polo
2008/1/24, William Pursell <[EMAIL PROTECTED]>: > > I've been away from Python for at least a year, and in the interim > have spent a little time looking at the XOTcl object framework for > Tcl. One of the interesting features of XOTcl is the ability for an > object to change class dynamically. T

Re: Q: paramiko/SSH/ how to get a remote host_key

2008-01-30 Thread Guilherme Polo
O failing such as non-existent file. Be sure to check if '~/.ssh/known_hosts' exists, if the first try fails, check if "~/ssh/known_hosts" exists then (since you are trying to access that file). Cheers, > > by Guilherme Polo Jan 21, 2008; 09:08am : > > 2008/1/21, DH

Re: python modules collection

2008-01-30 Thread Guilherme Polo
2008/1/30, J. Peng <[EMAIL PROTECTED]>: > Hello, > > Is there a site for python,which collects most kinds of python modules? > like CPAN for Perl. > Sometime I want to use a module,like the time/date modules,don't know > where I should search from. > Sorry if I have repeated this question on t

Re: Strange sqlite3 library behavior

2008-02-02 Thread Guilherme Polo
2008/2/2, Roel Schroeven <[EMAIL PROTECTED]>: > Victor Lin schreef: > > > Now I am now developing a program that base on sqlite3 in python. > > But there is a strange problem. > > That is, all data I insert into sqlite database do not goes into file > > in disk. > > It is really strange >

Re: GUI definition for web and desktop

2008-02-03 Thread Guilherme Polo
2008/2/3, Daniel Fetchinson <[EMAIL PROTECTED]>: > Hi pythoneans, > > I'm looking for a simple text based GUI definition format and > associated python modules to work with it that is capable of defining > simple GUI's for *both* the web and the desktop. I have an application > that is accessib

Re: GUI definition for web and desktop

2008-02-03 Thread Guilherme Polo
2008/2/3, Steve Holden <[EMAIL PROTECTED]>: > Daniel Fetchinson wrote: > > Hi pythoneans, > > > > I'm looking for a simple text based GUI definition format and > > associated python modules to work with it that is capable of defining > > simple GUI's for *both* the web and the desktop. I have

Re: scope

2008-02-03 Thread Guilherme Polo
2008/2/3, Navid Parvini <[EMAIL PROTECTED]>: > Dear All, > > I have the following two methods in a module. I cannot put them in a class, > as the code is a complicated one. > > def a(num): > found = num in Numlist > print found > > def b(): > scop = {} > scop['Numlist'] = [1,2,3] >

Re: GUI definition for web and desktop

2008-02-03 Thread Guilherme Polo
2008/2/3, Steve Holden <[EMAIL PROTECTED]>: > Guilherme Polo wrote: > > 2008/2/3, Steve Holden <[EMAIL PROTECTED]>: > >> Daniel Fetchinson wrote: > >> > Hi pythoneans, > >> > > >> > I'm looking for a simple text based

Re: Python GUI toolkit

2008-02-03 Thread Guilherme Polo
2008/2/3, Christian Heimes <[EMAIL PROTECTED]>: > Jorge Godoy wrote: > > Qt is a the best choice, IMHO. Nice support, free if you write free > > software, very nice API, nice tools to develop with and the best looking > > widget system for *nix and mobile phones. > > > PyQt4 forces you to eithe

Re: Python GUI toolkit

2008-02-03 Thread Guilherme Polo
2008/2/3, Thomas Pani <[EMAIL PROTECTED]>: > Guilherme Polo wrote: > > PyQt follows same licensing as Qt, so what licenses does Qt4 supports > > besides GPL and Qt commercial license ? > > Qt4 has a special exception to the GPL, allowing the use of free > softwar

Re: Python GUI toolkit

2008-02-03 Thread Guilherme Polo
2008/2/3, Guilherme Polo <[EMAIL PROTECTED]>: > 2008/2/3, Thomas Pani <[EMAIL PROTECTED]>: > > > Guilherme Polo wrote: > > > PyQt follows same licensing as Qt, so what licenses does Qt4 supports > > > besides GPL and Qt commercial license ? >

Re: beginners help

2008-02-07 Thread Guilherme Polo
2008/2/7, Guido van Brakel <[EMAIL PROTECTED]>: > Hello > > I totally new to python and i'm doing a python course now. Maybe someone > could help me a little bit here: > > I need to create this script. > > If i enter a center digit like 5 for example i need to create two > vertical and horzito

Re: Looking for library to estimate likeness of two strings

2008-02-07 Thread Guilherme Polo
2008/2/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > On Feb 7, 2:37 am, "Daniel Fetchinson" <[EMAIL PROTECTED]> > wrote: > > > Hi folks, just went through this thread and a related one from 2006 > > and I was wondering what the best solution is for using these string > > metrics in a database sear

Re: Microsoft's challenger to Python

2008-02-07 Thread Guilherme Polo
2008/2/7, Dotan Cohen <[EMAIL PROTECTED]>: > On 08/02/2008, Peter Dilley <[EMAIL PROTECTED]> wrote: > > I am not, however, an in depth language nutter, so would > > appreciate any of our more learned readers comments. > > > Looks like MS forgot E and E and went straight for E this time. > I coul

Re: multi-Singleton-like using __new__

2008-02-08 Thread Guilherme Polo
2008/2/8, Freek Dijkstra <[EMAIL PROTECTED]>: > Is there a best practice on how to override __new__? > > I have a base class, RDFObject, which is instantiated using a unique > identifier (a URI in this case). If an object with a given identifier > already exists, I want to return the existing ob

Re: Edit Python code programmatically

2008-02-09 Thread Guilherme Polo
2008/2/9, Alex <[EMAIL PROTECTED]>: > Which library could you recommend to perform simple editing of Python > code (from Python program)? For example, open *.py file, find specific > function definition, add another function call inside, find existing > call and change parameter value, etc. > Y

Re: Edit Python code programmatically

2008-02-09 Thread Guilherme Polo
2008/2/9, Alex <[EMAIL PROTECTED]>: > Guilherme Polo wrote: > > 2008/2/9, Alex <[EMAIL PROTECTED]>: > > > >> Which library could you recommend to perform simple editing of Python > >> code (from Python program)? For example, open *.py file,

Re: Edit Python code programmatically

2008-02-09 Thread Guilherme Polo
2008/2/9, Arnaud Delobelle <[EMAIL PROTECTED]>: > On Feb 9, 12:32 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > > 2008/2/9, Alex <[EMAIL PROTECTED]>: > > > > > Guilherme Polo wrote: > > > > 2008/2/9, Alex <[EMAIL PROTECT

Re: Edit Python code programmatically

2008-02-09 Thread Guilherme Polo
2008/2/9, Alex <[EMAIL PROTECTED]>: > Guilherme Polo wrote: > > 2008/2/9, Arnaud Delobelle <[EMAIL PROTECTED]>: > > > >> On Feb 9, 12:32 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > >> > 2008/2/9, Alex <[EMAIL PROTECTED]

Re: Edit Python code programmatically

2008-02-09 Thread Guilherme Polo
2008/2/9, Alex <[EMAIL PROTECTED]>: > Guilherme Polo wrote: > > 2008/2/9, Alex <[EMAIL PROTECTED]>: > > > >> Guilherme Polo wrote: > >> > 2008/2/9, Arnaud Delobelle <[EMAIL PROTECTED]>: > >> > > >> >> On F

Re: wxpython file dialog

2008-02-09 Thread Guilherme Polo
2008/2/9, Janwillem <[EMAIL PROTECTED]>: > Is there a way to force the wx.FileDialog to show as default the > thumbnails vie in stead of list view? > thanks, janwillem > > -- > http://mail.python.org/mailman/listinfo/python-list > You should be using wx.lib.imagebrowser.ImageDialog instead of w

Re: wxpython file dialog

2008-02-10 Thread Guilherme Polo
2008/2/10, Janwillem <[EMAIL PROTECTED]>: > Guilherme Polo wrote: > > 2008/2/9, Janwillem <[EMAIL PROTECTED]>: > > >> Is there a way to force the wx.FileDialog to show as default the > >> thumbnails vie in stead of list view? > >> thanks, jan

Re: wxpython file dialog

2008-02-11 Thread Guilherme Polo
2008/2/11, Mike Driscoll <[EMAIL PROTECTED]>: > On Feb 10, 6:41 am, Janwillem <[EMAIL PROTECTED]> wrote: > > Guilherme Polo wrote: > > > 2008/2/10, Janwillem <[EMAIL PROTECTED]>: > > >> Guilherme Polo wrote: > > >> > 2008/2/9, Janw

Re: wxpython file dialog

2008-02-11 Thread Guilherme Polo
2008/2/11, Mike Driscoll <[EMAIL PROTECTED]>: > On Feb 11, 2008 12:14 PM, Guilherme Polo <[EMAIL PROTECTED]> wrote: > > 2008/2/11, Mike Driscoll <[EMAIL PROTECTED]>: > > > On Feb 10, 6:41 am, Janwillem <[EMAIL PROTECTED]> wrote: > > > > Guilhe

Re: 2to3.py download

2008-02-12 Thread Guilherme Polo
2008/2/12, Robin Becker <[EMAIL PROTECTED]>: > Can anyone say how to go about obtaining 2to3.py the Python-3.0 conversion > utility? There is a copy in the 3.0a2 Tools folder, but it lacks some of the > sub > folders. I tried various svn ls commands, but couldn't locate the actual > repository.

Re: Python not finding modules

2008-02-13 Thread Guilherme Polo
2008/2/13, Mani Chandra <[EMAIL PROTECTED]>: > Hey! > I installed a few python modules through the freebsd ports, but when I > try to import them in the interpreter it says "module xxx not found". This > seems to happen for some modules and not for the others. ex:- I installed > psyco and pa

Re: Python not finding modules

2008-02-13 Thread Guilherme Polo
you would need to include "/usr/local/lib/python2.4/site-packages/". Also, the path you add is a "starting point" for finding packages and modules, so can consider it recursive. > Thanks > Mani chandra > > > --- On Wed, 13/2/08, Guilherme Polo <[EMAIL PROT

Re: Basic question

2008-02-13 Thread Guilherme Polo
2008/2/13, WILLIAM SCHMIDT <[EMAIL PROTECTED]>: > In several places in the Python documentation I have run across an extra "r" > that I can not explain: > > > * > In sys.path after the open bracket: >sys.path = [r'd:\temp'] > > In the on line help in the DATA

Re: Write ooxml .ods (spreadsheat) from python?

2008-02-13 Thread Guilherme Polo
2008/2/13, Neal Becker <[EMAIL PROTECTED]>: > I'd like to output some data directly in .ods format. Do you want to output data from .ods file or do you want to input data into an ods ? > This format appears > to be quite complex. Is there any python software available to do this? I > did look

Re: Write ooxml .ods (spreadsheat) from python?

2008-02-13 Thread Guilherme Polo
2008/2/13, Neal Becker <[EMAIL PROTECTED]>: > Guilherme Polo wrote: > > > 2008/2/13, Neal Becker <[EMAIL PROTECTED]>: > >> I'd like to output some data directly in .ods format. > > > > Do you want to output data from .ods file or do you wan

Re: Email Directly from python

2008-02-13 Thread Guilherme Polo
2008/2/13, brad <[EMAIL PROTECTED]>: > I'd like to send email directly from within python without having to > rely on an external smtp server. You know, something like the good, old > Unix... > > echo My_message | mail -s Subject [EMAIL PROTECTED] I hope to not disappoint you, but mail will inv

Re: Time line for OJS migration

2008-02-14 Thread Guilherme Polo
2008/2/14, Maurice Ling <[EMAIL PROTECTED]>: > Hi Guilherme > > I've seen the site, it looks pretty good. > > Just wondering if you foresee any problems in moving the whole > installation to another server? If not, perhaps you can try to migrate > the documents (instructions for authors etc) to

Re: scary thought for consideration

2008-02-15 Thread Guilherme Polo
2008/2/15, Blubaugh, David A. <[EMAIL PROTECTED]>: > > > > To All, > > > I am wondering as far as the integration of MyHDL with Python 2.5, if there > might be any potential version incompatibility issues? What I mean is will > MyHDL not operate correctly, if it is executed with a Python 2.5 versi

Re: how to finish a while loop...

2008-02-19 Thread Guilherme Polo
2008/2/19, icarus <[EMAIL PROTECTED]>: > Hi all, i'm new to python. Learning on my own how to ask a user to > finish a loop or not. > For some reason, it behaves as infinite loop although I changed its > condition. Please tell me what I'm doing wrong. Thanks in advance. > > > condition = True

Re: macro in python

2008-02-27 Thread Guilherme Polo
2008/2/27, bharath venkatesh <[EMAIL PROTECTED]>: > hi .. > how to create macro in python for set of instruction that is done > frequently but too less in number to ignore the overhead of function call > ... > > -- > http://mail.python.org/mailman/listinfo/python-list > There is lambda, not e

Re: Official IRC channel for Python?

2008-02-27 Thread Guilherme Polo
2008/2/27, js <[EMAIL PROTECTED]>: > > You can't join #python on freenode without identifying with nickserv > > first. > > > Why is that? > I can join #perl, #php, #ruby, #mysql, #postgres without registration. > What advantage does it have? and the advantage really worth? > The direct benefit

Re: Official IRC channel for Python?

2008-02-27 Thread Guilherme Polo
27 Feb 2008 11:34:54 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid>: > "Guilherme Polo" <[EMAIL PROTECTED]> writes: > > > I can join #perl, #php, #ruby, #mysql, #postgres without registration. > > > What advantage does it have? and the

Re: Timed execution in eval

2008-03-08 Thread Guilherme Polo
2008/3/7, Steven D'Aprano <[EMAIL PROTECTED]>: > On Fri, 07 Mar 2008 08:12:38 -0800, alex.pedwysocki wrote: > > > I have various bits of code I want to interpret and run at runtime in > > eval ... > > > I hope that code doesn't contain any data coming from an untrusted user. > > > > > I want to

Re: Exctract GIF comment from image

2008-03-11 Thread Guilherme Polo
2008/3/11, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Hi, > > simple question: The PIL does not support reading the optional > description in GIF Images. > > http://www.pythonware.com/library/pil/handbook/format-gif.htm > > After some reasearch I could not find a python solution for this, any >

Re: Removal of tkinter from python 3.0? [was: Fate of the repr module in Py3.0]

2008-03-23 Thread Guilherme Polo
2008/3/21, "Martin v. Löwis" <[EMAIL PROTECTED]>: > > I've been thinking of volunteering to "port" Tkinter to Python 3.0, I > > hadn't noticed that there was any discussion of removing it. It would > > be a shame IMHO. > > > I don't think Tkinter will be removed. It works just fine in 3k. > > O

Re: python library to manipulate PALM documents ?

2008-03-24 Thread Guilherme Polo
24 Mar 2008 13:36:13 GMT, Francesco Bochicchio <[EMAIL PROTECTED]>: > Hi all, > > anybody knows a python equivalent of the perl PALM::Doc module (and > eventually other PALM::). > > I have a e-book device wich reads mobi-pocket format (among others). I > have downloaded from a forum a set of pe

Re: what does ^ do in python

2008-03-25 Thread Guilherme Polo
2008/3/25, Dark Wind <[EMAIL PROTECTED]>: > Hi, > > In most of the languages ^ is used for 'to the power of'. In python we have > ** for that. But what does ^ do? It is bitwise xor. Some more information can be found at http://docs.python.org/ref/bitwise.html > I could not get it just by using it

Re: GUI toolkits with Tkinter's .pack() alternative

2008-03-26 Thread Guilherme Polo
2008/3/26, Alex9968 <[EMAIL PROTECTED]>: > Hi all, > > I use Tkinter's Pack widget geometry manager (I really prefer it over > using visual GUI designers), so my question is which other GUI toolkits > have similar functionality. The geometry manager isn't related to using GUI designers tools at

Re: Tkinter menus from keyboard

2008-03-26 Thread Guilherme Polo
2008/3/26, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Tkinter defaults to, for example, Alt+f = File (if File is your first > menu name starting with "f"). > > I'd like to assign my own letters and have them underscored, per the > universal standard. Can this be done? > Set the underline option t

Re: GUI toolkits with Tkinter's .pack() alternative

2008-03-27 Thread Guilherme Polo
2008/3/27, Alex9968 <[EMAIL PROTECTED]>: > Guilherme Polo wrote: > > 2008/3/26, Alex9968 <[EMAIL PROTECTED]>: > > > >> Hi all, > >> > >> I use Tkinter's Pack widget geometry manager (I really prefer it over > >> usi

Re: GUI toolkits with Tkinter's .pack() alternative

2008-03-27 Thread Guilherme Polo
2008/3/27, Alex9968 <[EMAIL PROTECTED]>: > Guilherme Polo wrote: > > 2008/3/27, Alex9968 <[EMAIL PROTECTED]>: > > > >> Guilherme Polo wrote: > >> > 2008/3/26, Alex9968 <[EMAIL PROTECTED]>: > >> > > >> >> Hi

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread Guilherme Polo
2008/3/27, Skip Montanaro <[EMAIL PROTECTED]>: > I am trying to replace os.system calls with subprocess.Popen. This simple > example fails miserably: > > >>> proc = subprocess.Popen ("ls /tmp") proc = subprocess.Popen ("ls /tmp", shell=True) or proc = subprocess.Popen (["ls", "/tmp"]) should

Re: Tkinter menus made easy

2008-03-27 Thread Guilherme Polo
2008/3/27, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Writing Tkinter menu code used to be rather tedious, uninspiring work. > I figured that I could delegate the job to a program: > I didn't look at it yet, but just in case you weren't aware there is a gui designer tool for tkinter called GUI Desi

Re: Is subprocess.Popen completely broken?

2008-03-27 Thread Guilherme Polo
2008/3/27, Skip Montanaro <[EMAIL PROTECTED]>: > > > >>> proc = subprocess.Popen ("ls /tmp") > > > > proc = subprocess.Popen ("ls /tmp", shell=True) > > > > or > > > > proc = subprocess.Popen (["ls", "/tmp"]) > > > > should work. > > > Why should I need to set shell=True? The default is s

Re: Python 2.5 + sqlite full text search possible?

2008-10-28 Thread Guilherme Polo
On 10/28/08, Guillermo <[EMAIL PROTECTED]> wrote: > Hi! > > Is it possible to use the full-text module of SQLite with the sqlite3 > module? I've done a bit of investigation and it seems the stand-alone > distribution of SQLite is compiled without it, and so does the version > bundled with Pytho

  1   2   >