Re: How to retrieve the filename of a module

2005-10-20 Thread Lawrence Oluyede
Il 2005-10-20, mku <[EMAIL PROTECTED]> ha scritto: > Hi, > > thereŽs a function inside a module. How can these function retrieve > the path+name of his module ? (The path is most important). > That should also work if the module is part of a package. [EMAIL PROTECTED]:~ $ cat > test.py print __

Re: How to retrieve the filename of a module

2005-10-20 Thread Lawrence Oluyede
Il 2005-10-20, Lawrence Oluyede <[EMAIL PROTECTED]> ha scritto: > Il 2005-10-20, mku <[EMAIL PROTECTED]> ha scritto: >> Hi, >> >> thereŽs a function inside a module. How can these function retrieve >> the path+name of his module ? (The path is most impo

Re: Python vs Ruby

2005-10-27 Thread Lawrence Oluyede
Il 2005-10-27, Andy Leszczynski ha scritto: > How Ruby solves the problem of global interpreter lock? AFAIK Ruby does not have those kind of problems, it does not have "real" threads but it emulates them via software -- Lawrence http://www.oluyede.org/blog -- http://mail.python.org/mailman/li

Re: SOAPpy module

2005-10-27 Thread Lawrence Oluyede
Il 2005-10-27, Alvin A. Delagon <[EMAIL PROTECTED]> ha scritto: > Has anyone experienced this? I'm googling like crazy these past few > weeks just to find a solution to this predicament. Thank you in advance! >:-) Don't know very much about it, but... did you ask on the mailing list? -- Lawre

Re: How to translate python into C

2005-10-28 Thread Lawrence Oluyede
Il 2005-10-28, Johnny Lee <[EMAIL PROTECTED]> ha scritto: > Thanks, Szabolcs. In fact, I want to reproduce a crush on cygwin. I > used a session of python code to produce the crush, and want to > translate it into C and reproduce it. Is the tools provided by you help > with these issues? Of coz, I'

Re: query a port

2005-10-30 Thread Lawrence Oluyede
Il 2005-10-30, [EMAIL PROTECTED] <[EMAIL PROTECTED]> ha scritto: > hi > in python, how do one query a port to see whether it's up or not? > thanks > Have a look at this: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286240 -- Lawrence http://www.oluyede.org/blog -- http://mail.python

Re: Object-Relational Mapping API for Python

2005-11-01 Thread Lawrence Oluyede
sIl 2005-11-01, Aquarius <[EMAIL PROTECTED]> ha scritto: > I explored Java's Hibernate a bit and I was intrigued by how you can > map entity objects to database tables, preserving all the relations and > constraits. I am interested if there is something like this for Python > - I noticed some APIs

Re: Python gui

2005-11-05 Thread Lawrence Oluyede
Il 2005-11-05, Philippe C. Martin <[EMAIL PROTECTED]> ha scritto: > Hi, > > Is wxWidget now part of python ? or will it be ? No it's not part of the official distribution of CPython, ad AFAIK it will not be anytime soon. -- Lawrence http://www.oluyede.org/blog -- http://mail.python.org/mailman/

Re: Shutdown hook

2005-11-15 Thread Lawrence Oluyede
Il 2005-11-15, Ben Finney <[EMAIL PROTECTED]> ha scritto: > Steve <[EMAIL PROTECTED]> wrote: >> Does any one know if python has the ability to run a shutdown hook. > > When the Python runtime system wants to exit, it raises a SystemExit > exception. > > Catch that exception at the top level of your

Wrapping method calls with metaclasses

2005-12-06 Thread Lawrence Oluyede
I've never used metaclasses in real life before and while searching through the online Cookbook I found this gorgeous example: "Wrapping method calls (meta-class example)" http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/198078 What I want to do in my app is to log all method calls and see

Re: Wrapping method calls with metaclasses

2005-12-07 Thread Lawrence Oluyede
Il 2005-12-07, Alex Martelli <[EMAIL PROTECTED]> ha scritto: > I can't reproduce the infinite recursion you observe, by merging said > recipe and your definition of class Test, w/Python 2.4.2 on Mac OS 10.4. It seemed that the problem arose because I was not using super() in a new style class base

Re: Wrapping method calls with metaclasses

2005-12-07 Thread Lawrence Oluyede
Il 2005-12-07, Lawrence Oluyede <[EMAIL PROTECTED]> ha scritto: > I don't get to fully work the metaclass anyway for other weird reasons > (using super() I lose an attribute around?!) I'm gonna fix this. It was a bug of one of the super() in the chain. Still suffer fro

Re: Developing a network protocol with Python

2005-12-13 Thread Lawrence Oluyede
Il 2005-12-12, Laszlo Zsolt Nagy <[EMAIL PROTECTED]> ha scritto: > > Hello, > > I would like to develop a new network protocol, where the server and the > clients are Python programs. You should use Twisted for this: Writing clients http://twistedmatrix.com/projects/core/documentation/howto/cl

Re: Developing a network protocol with Python

2005-12-13 Thread Lawrence Oluyede
Il 2005-12-13, Laszlo Zsolt Nagy <[EMAIL PROTECTED]> ha scritto: > I need to send Python objects too. They are too elaborate to convert > them to XML. (They are using cyclic weak references and other Python > specific stuff.) I can be sure that on both sides, there are Python > programs. Is ther

Re: Still Loving Python

2005-12-13 Thread Lawrence Oluyede
Il 2005-12-13, Kamilche <[EMAIL PROTECTED]> ha scritto: > Python still suffers from the lack of a good GUI, which I believe is > slowing its acceptance by the programming community at large. (I know > about tKinter, no need to post links to it, thanks.) Let me say I'm not agree, I'm developing a l

Re: Still Loving Python

2005-12-13 Thread Lawrence Oluyede
Il 2005-12-13, Ivan Voras <[EMAIL PROTECTED]> ha scritto: > More than 5 years ago, i programmed in Visual Basic and Delphi and I > still miss the wonderful ease of graphically creating the user interface > in WYSIWYG mode. If you haven't tried it, you don't know what you're > missing :) I used

Re: pyGTK gtk.Style obj

2005-12-13 Thread Lawrence Oluyede
Il 2005-12-13, ivan.dm <[EMAIL PROTECTED]> ha scritto: > Hi all. > > in this sentence: > self.area = gtk.DrawingArea() > self.style = self.area.get_style() > self.gc = self.style.fg_gc[gtk.STATE_NORMAL] > > where can I find about style and its property? In the tutorial: http://www.pygtk.org/pygtk2

Re: Still Loving Python

2005-12-14 Thread Lawrence Oluyede
Il 2005-12-14, Daniel Crespo <[EMAIL PROTECTED]> ha scritto: > PyGTK is crossplatform, that's true, but it looks very ugly under > Windows and don't know under MacOS (if it's supported). You can use themes. Under MacOSX you have to install X11, but a native version in on the way. > I couldn't fi

Re: Still Loving Python

2005-12-14 Thread Lawrence Oluyede
Il 2005-12-14, Daniel Crespo <[EMAIL PROTECTED]> ha scritto: > Under windows, only needs some dlls (they are its runtime), and works > perfect. The same exe works on Win98, ME, 2000, XP. Of course that > there are some differences between these OSs. It's the same for Gtk > I tried both a lot, and

Re: Threading in python

2005-12-14 Thread Lawrence Oluyede
Il 2005-12-14, Carl J. Van Arsdall <[EMAIL PROTECTED]> ha scritto: > This confuses me. What is CPython versus Jython and IronPython? I'm > using compiled source from python.org, would this be CPython? CPython is the official distribution, the one you find on python.org It's C and Python based.

Re: ?: in Python

2005-12-14 Thread Lawrence Oluyede
Il 2005-12-14, Andy Leszczynski <[EMAIL PROTECTED]> ha scritto: > How can do elegantly in Python: > > if condition: > a=1 > else: > a=2 > > like in C: > > a=condition?1:2 > There are tons of threads on this newsgroup and in the python-dev mailing list about a ternary operator. There's also

Re: how to get select label?

2005-12-14 Thread Lawrence Oluyede
Il 2005-12-14, [EMAIL PROTECTED] <[EMAIL PROTECTED]> ha scritto: > Hi Guys, > > I built a select in a form. My select is: > print '' > print 'ALL' > print 'AAA' > print 'BBB' > print '' Which web technology/framework are you using that re

Re: set & random.choice question

2005-12-14 Thread Lawrence Oluyede
Il 2005-12-14, [EMAIL PROTECTED] <[EMAIL PROTECTED]> ha scritto: > I want to do something like this: > > from random import choice > x = set(("jenny", "jacqui", "claire", "chris", "tracy")) > somebody = random.choice(x) import random x = set(("jenny", "jacqui", "claire", "chris", "tracy")) s

Re: how to get select label?

2005-12-14 Thread Lawrence Oluyede
Il 2005-12-14, [EMAIL PROTECTED] <[EMAIL PROTECTED]> ha scritto: > Sorry , I forget to say that. I use CGI, HTML and python. Why you need to get the text value, don't you have it when you create the page? ps. do you really need CGIs ? -- Lawrence - http://www.oluyede.org/blog "Anyone can freel

Re: how to get select label?

2005-12-14 Thread Lawrence Oluyede
Il 2005-12-14, [EMAIL PROTECTED] <[EMAIL PROTECTED]> ha scritto: > I build web application. So I use CGI. I need to show select text in > the html page. Now I can only display select value such as '001'. But I > need to display its text 'AAA'. There are tons of way to build web apps in Python and

Re: to write set of values to a file from python

2005-12-14 Thread Lawrence Oluyede
Il 2005-12-14, [EMAIL PROTECTED] <[EMAIL PROTECTED]> ha scritto: > I have tried with the following code > > import csv > file = open("some.csv","wb") > writer = csv.writer(file) > list = ["CompName", "IpAddr", "MacAddr","OpSys"] > for row in list: > writer.writerow(row) > > file.close() writer

Re: newbie to python

2005-12-15 Thread Lawrence Oluyede
Il 2005-12-15, [EMAIL PROTECTED] <[EMAIL PROTECTED]> ha scritto: > How do I find out what modules have been included in my python install? Look in site-packages directory > I am having issues with crypt functions not working on ubuntu or redhat > but they work on Slackware. Crypt functions? Are

Re: Adding methods to instances

2005-12-15 Thread Lawrence Oluyede
Il 2005-12-15, Ed Leafe <[EMAIL PROTECTED]> ha scritto: > Here's what I'm trying to do; please let me know if I'm nuts or > not. > > Given a string consisting of the code you would normally define > in a class's method, add that compiled code to an instance of that > class so that i

Re: CherryPy wiki not working

2005-12-15 Thread Lawrence Oluyede
Il 2005-12-15, [EMAIL PROTECTED] <[EMAIL PROTECTED]> ha scritto: > Has the CherryPy wiki been hacked ?. All pages seem to be re-directed > to some form of Amazon page. It works for me. -- Lawrence - http://www.oluyede.org/blog "Anyone can freely use whatever he wants but the light at the end of

Re: newbie to python

2005-12-15 Thread Lawrence Oluyede
Il 2005-12-15, Johhny <[EMAIL PROTECTED]> ha scritto: >>From a dpkg --list python* I have > > ii python2.4-crypto > 2.0+dp1-2ubuntu1 cryptographic > algorithms and protocols for Python > > Which means it should work. However Im not really getting anything from >

Re: Tuples

2005-12-15 Thread Lawrence Oluyede
Il 2005-12-15, Tuvas <[EMAIL PROTECTED]> ha scritto: First, these are lists not tuples > Let's say I make a program something like follows: > > x=[] > x.append([1,2,3]) > x.append([4,5,6]) > print x > print x[0] > print x[0][1] > x[0][1]=5 > > Okay, everything works here as expected except the la

Re: Changing a shell's current directory with python

2005-12-18 Thread Lawrence Oluyede
irIl 2005-12-18, Andy B. <[EMAIL PROTECTED]> ha scritto: > I've got a python utility that I want to change my shell's current > directory based on criteria it finds. I've scoured google and the > python cookbook and can't seem to figure out if this is even possible. > So far, all my attempts have

Re: Easiest way to calculate number of character in string

2005-12-21 Thread Lawrence Oluyede
Il 2005-12-21, P. Schmidt-Volkmar <[EMAIL PROTECTED]> ha scritto: > Hi there, > > I have a string in which I want to calculate how often the character ';' > occurs. If the character does not occur 42 times, the ";" should be added so > the 42 are reached. > > My solution is slow and wrong: >

Re: Detect File System changes

2005-12-23 Thread Lawrence Oluyede
Il 2005-12-23, Lukas Meyer <[EMAIL PROTECTED]> ha scritto: > Hello, > > I'm trying to detect changes in a directory. E.g if someone crates a > file, i'll execute another function on this file. pyinotify (wrapper of inotify) is for you (it's not portable however) http://pyinotify.sourceforge.net/

Re: Simple question on Parameters...

2005-12-28 Thread Lawrence Oluyede
Il 2005-12-28, KraftDiner <[EMAIL PROTECTED]> ha scritto: > I have defined a method as follows: > > def renderABezierPath(self, path, closePath=True, r=1.0, g=1.0, b=1.0, > a=1.0, fr=0.0, fg=0.0, fb=0.0, fa=.25): > > Now wouldn't it be simpler if it was: > > def renderABezierPath(self, path, closeP

Re: Pythonic wrappers for SQL?

2006-01-14 Thread Lawrence Oluyede
Il 2006-01-14, Kenneth McDonald <[EMAIL PROTECTED]> ha scritto: > I need to do some data manipulation, and SQLite is a nice little > product for it, except of course that I'd need to write SQL. Are > there any good libraries out there that let one write (basic) queries > in a Pythonic syntax,

Re: Numarray, numeric, NumPy, scpy_core ??!!

2006-01-22 Thread Lawrence Oluyede
"J" <[EMAIL PROTECTED]> writes: > I hope the title of this message indicates my question. I am looking > for basic > array functionality in Python and it turns out that there are all these > packages which > are somehow related. Some are allegedly discontinued but still seem to > get updated. It

Re: EuroPython 2006 and Py3.0

2006-07-14 Thread Lawrence Oluyede
Antoon Pardon <[EMAIL PROTECTED]> wrote: > These are just some ideas. Whether they fit into python or not I will > leave to the developers. I'm not a Python pro. but: > 1) Literal slices, in a sense we already have these, but they are >limited to indexing. You can't do something like fun(::)

Re: EuroPython 2006 and Py3.0

2006-07-14 Thread Lawrence Oluyede
Antoon Pardon <[EMAIL PROTECTED]> wrote: > I have a tree class, a tree acts like a dictionary, but when you > iterate over it, it always iterates over the keys in order. This > makes it usefull to iterate over a slice. So it would be usefull > if methods like keys, values and items could take a sl

Re: EuroPython 2006 and Py3.0

2006-07-14 Thread Lawrence Oluyede
A.M. Kuchling <[EMAIL PROTECTED]> wrote: > If Python 3000 turns into a let's-try-all-sorts-of-goofy-new-ideas > language, at least some of those ideas will turn out to have been > mistakes, and then we'll need a Python 3000++ to clean things up. And I also think "we" will lose some developers in

Re: New Martelli Nutshell Out

2006-07-19 Thread Lawrence Oluyede
BartlebyScrivener <[EMAIL PROTECTED]> wrote: > My preordered copy of Python In A Nutshell just arrived from Amazon. > > http://tinyurl.com/pkczm > > Looking forward. Me too :-) Mine has been shipped yesterday. -- Lawrence - http://www.oluyede.org/blog "Nothing is more dangerous than an idea i

Re: opposite of import

2006-08-03 Thread Lawrence Oluyede
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am new to python. I wanted to know if there is an opposite of "import" What do you mean? What are you trying to accomplish? -- Lawrence - http://www.oluyede.org/blog "Nothing is more dangerous than an idea if it's the only one you have" - E. A. C

Re: newbie question about import tools

2006-08-20 Thread Lawrence Oluyede
<[EMAIL PROTECTED]> wrote: > do i need to download tools.pyc ? Python doesn't have any "tools" module builtin. So, what tool is? -- Lawrence - http://www.oluyede.org/blog "Nothing is more dangerous than an idea if it's the only one you have" - E. A. Chartier -- http://mail.python.org/mailman/l

Re: HOST - Assembla Inc. Breakout - Copyright Violation by Mr. Andy Singleton

2006-10-06 Thread Lawrence Oluyede
Ilias Lazaridis <[EMAIL PROTECTED]> wrote: > and once more: this topic _is_ appropriate for a python / ruby / java > crosspost. > > really very important (if you don't look to much at the subject but the > message contents). I really don't understand why your public announcement should be in topi

Re: Where I can find

2006-10-15 Thread Lawrence Oluyede
<[EMAIL PROTECTED]> wrote: > Where I can find this files(modules): > > fcntl,FCNTL,tty,termios, TERMIOS import fcntl import tty import termios for start :-) -- Lawrence - http://www.oluyede.org/blog http://www.neropercaso.it "Nothing is more dangerous than an idea if it's the only one you have

Re: Sending Dictionary via Network

2006-10-25 Thread Lawrence Oluyede
Chris Mellon <[EMAIL PROTECTED]> wrote: > I would recommend against using pickle if you're going to push it over > a network - there are signifigant dangers in unpickling anything > untrusted. I confirm: http://jcalderone.livejournal.com/15864.html -- Lawrence - http://www.oluyede.org/blog http:

Re: Is it possible to split a class definition?

2006-06-21 Thread Lawrence Oluyede
<[EMAIL PROTECTED]> wrote: > Is it possible to split a Class definition over two or more text files? > (if so, how:) There's no partial types like in .NET 2.0 but since Python is dynamic you can add members at runtime :-) -- Lawrence - http://www.oluyede.org/blog "Nothing is more dangerous than

Re: Python on intel osx

2006-06-23 Thread Lawrence Oluyede
John Lockwood <[EMAIL PROTECTED]> wrote: > Can someone please suggest the most suitable python for mac osx 10.4.6 > Finding the right installs doesn't seem quite as cut and dried as it is for > linux or windows. open google, type "python osx" and go to the _second_ result. It's http://pythonmac.

mmap as a sequence behavior

2006-06-28 Thread Lawrence Oluyede
While wrapping mmap indexing/sequence emulation I noticed something "strange". The source code of this oddity is: static PyObject * mmap_item(mmap_object *self, Py_ssize_t i) { CHECK_VALID(NULL); if (i < 0 || (size_t)i >= self->size) { PyErr_SetString(PyExc_IndexError, "mmap index

Re: mmap as a sequence behavior

2006-06-29 Thread Lawrence Oluyede
Scott David Daniels <[EMAIL PROTECTED]> wrote: > That is sequence behavior. The convention of -1 for last, -2 for > second-to-last, ... is done before it gets to your C code. I suspect > if you don't define a __len__ method, you'd suppress this. I defined a __len__ method but I get the index "

Re: mmap as a sequence behavior

2006-06-29 Thread Lawrence Oluyede
Lawrence Oluyede <[EMAIL PROTECTED]> wrote: > What am I missing from the C API? Found. I edit abstract.c placing some printf here and there and discovered PyObject_GetItem is always called and in turn it call PySequence_GetItem so is there my index is translated. -- Lawren

Re: Controlling Windows Media Player from Python

2006-07-03 Thread Lawrence Oluyede
Jeffrey Barish <[EMAIL PROTECTED]> wrote: > Is there a way to interact with Windows Media Player from Python? I would > like to be able to do things like tell WMP to play a given sound file or to > ask WMP for metadata about a sound file. Take a look at pywinauto, I attended the today talk at EP

Re: Is there a Python __LINE__ ?

2006-07-06 Thread Lawrence Oluyede
Rolf Wester <[EMAIL PROTECTED]> wrote: > > is there a Python aquivalent to the C __LINE__? I found this in the archives: http://groups.google.it/group/comp.lang.python/browse_thread/thread/315e f9451067a320/87785edf569c1e96?q=current+line&rnum=2#87785edf569c1e96 -- Lawrence - http://www.oluyed

Re: Accessors in Python (getters and setters)

2006-07-10 Thread Lawrence Oluyede
mystilleef <[EMAIL PROTECTED]> wrote: > What is the Pythonic way of implementing getters and setters. Using public members and turning them into properties when needed > I've > heard > people say the use of accessors is not Pythonic. But why? Because there's no need to have them everywhere >

Re: Pros/Cons of Turbogears/Rails?

2006-08-31 Thread Lawrence Oluyede
Christophe <[EMAIL PROTECTED]> wrote: > Google doesn't find YARM and so, YARM does not exist. Care to provide an > URL or something? it's YARV - http://www.atdot.net/yarv/ -- Lawrence - http://www.oluyede.org/blog "Nothing is more dangerous than an idea if it's the only one you have" - E. A. Ch

Re: threading support in python

2006-09-05 Thread Lawrence Oluyede
Sandra-24 <[EMAIL PROTECTED]> wrote: > Oh I'm aware of that, but it's not what I'm looking for. Mod_mono just > lets you run ASP.NET on Apache. I'd much rather use Python :) Now if > there was a way to run IronPython on Apache I'd be interested. Take a look here: http://lists.ironpython.com/piper

Re: threading support in python

2006-09-05 Thread Lawrence Oluyede
Lawrence Oluyede <[EMAIL PROTECTED]> wrote: > Take a look here: > http://lists.ironpython.com/pipermail/users-ironpython.com/2006-March/00 > 2049.html > and this thread: > http://www.mail-archive.com/users@lists.ironpython.com/msg01826.html Also this: http://www.code

Re: How to build extensions on Windows?

2006-09-07 Thread Lawrence Oluyede
Kevin D. Smith <[EMAIL PROTECTED]> wrote: > Then there is Mike Fletcher's web page > (http://www.vrplumber.com/programming/mstoolkit/) that describes in > detail how to build extensions, but most of the links to external > software are no longer valid. I think it's safe to say that I am > comp

Re: [ANN] IronPython 1.0 released today!

2006-09-07 Thread Lawrence Oluyede
Felipe Almeida Lessa <[EMAIL PROTECTED]> wrote: > Does IronPython runs Twisted? I really don't think so. They don't have many needed modules, like select :-) -- Lawrence - http://www.oluyede.org/blog "Nothing is more dangerous than an idea if it's the only one you have" - E. A. Chartier -- http

Re: How to build extensions on Windows?

2006-09-07 Thread Lawrence Oluyede
Kevin D. Smith <[EMAIL PROTECTED]> wrote: > So in other words, what you're saying is that the only issue I have > left is the exact issue that I described in my initial post that you > claimed isn't a problem... Great! I guess I'l get right down to work > compiling that extension now. What I m

Re: How to build extensions on Windows?

2006-09-07 Thread Lawrence Oluyede
Jason <[EMAIL PROTECTED]> wrote: > I don't know about MinGW, but you can get the Microsoft compilers by > installing Visual C++ 2005 Express. I'm guessing the old toolkit is > deprecated. While you must register each Visual Studio Express module > that you download, I don't think the actual comma

Re: [ANN] IronPython 1.0 released today!

2006-09-07 Thread Lawrence Oluyede
Duncan Booth <[EMAIL PROTECTED]> wrote: > So? IronPython has a select module although it doesn't seem to be complete > yet. The IronPython mailing list has discussions about getting CherryPy to > run, and it sounds as though it isn't quite there yet, but it is getting > there. I don't think my ans

Re: Help with ctypes pointer return values

2006-09-08 Thread Lawrence Oluyede
<[EMAIL PROTECTED]> wrote: > Does anyone have a good idea how I should define recordList so that I > can retrieve the record pointers? POINTER(POINTER(c_void)) ? Maybe I misunderstood tough... -- Lawrence - http://www.oluyede.org/blog "Nothing is more dangerous than an idea if it's the only one

Re: python threading

2006-09-13 Thread Lawrence Oluyede
daniel <[EMAIL PROTECTED]> wrote: > can someone give me a good threading tutorial http://awaretek.com/tutorials.html#thread and http://www.google.com/search?q=python+threading+tutorial -- Lawrence - http://www.oluyede.org/blog "Nothing is more dangerous than an idea if it's the only one you have

Re: Why not event-driven packages in other than the main thread?

2006-09-14 Thread Lawrence Oluyede
Tor Erik <[EMAIL PROTECTED]> wrote: > I've developed an application were I've used Tkinter for the GUI. > When I ran the GUI in another thread than the main, it kept locking > up. That's because Tkinter is not thread safe AFAIK. > I experienced similar problems with Twisted. Neither Twisted is t

Re: Why not event-driven packages in other than the main thread?

2006-09-14 Thread Lawrence Oluyede
Tor Erik <[EMAIL PROTECTED]> wrote: > If you have two event-based frameworks, both needing to run in the main > thread, such as Tkinter and Twisted, you have a problem Twisted supports Tkinter: http://twistedmatrix.com/projects/core/documentation/howto/choosing-reac tor.html#auto14 It's better to

Re: Why not event-driven packages in other than the main thread?

2006-09-14 Thread Lawrence Oluyede
Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: > What's not real about Tkinter's? It's not a custom reactor as GTK's AFAIK -- Lawrence - http://www.oluyede.org/blog "Nothing is more dangerous than an idea if it's the only one you have" - E. A. Chartier -- http://mail.python.org/mailman/listinfo

Re: How to build extensions on Windows?

2006-09-14 Thread Lawrence Oluyede
"Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > That, of course, assumes that there is a VS 2007 release > sufficiently before Python 2.6. I just spoke with an MVP for .NET (so nothing official obviously) and he told me the next VS version will ship after Windows Vista for sure and that (he mention

Re: Looking for a python IDE

2006-09-16 Thread Lawrence Oluyede
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Any suggestions? Maybe BlackAdder http://www.thekompany.com/products/blackadder/ -- Lawrence - http://www.oluyede.org/blog "Nothing is more dangerous than an idea if it's the only one you have" - E. A. Chartier -- http://mail.python.org/mailman/lis

Re: Webbrowser written totally in Python

2006-09-17 Thread Lawrence Oluyede
Franz Steinhaeusler <[EMAIL PROTECTED]> wrote: > is there any (GUI) webbrowser written completly in Python? AFAIK Grail is the only attempt but it's _very_ old: http://grail.sourceforge.net/ Made in Python, Tkinter and supports HTML 2.0 (3.2 partially) -- Lawrence - http://www.oluyede.org/blog

Re: new string method in 2.5 (partition)

2006-09-19 Thread Lawrence Oluyede
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > What's the difference between this and string.split? >>> ('http://www.python.org').partition('://') ('http', '://', 'www.python.org') >>> ('http://www.python.org').split('://') ['http', 'www.python.org'] -- Lawrence - http://www.oluyede.org/blog

Re: How to get a Fix to an Abandoned Project?

2006-09-19 Thread Lawrence Oluyede
Gregory Piñero <[EMAIL PROTECTED]> wrote: > Otherwise any other advice is welcome. Should I just post > the code somewhere else, etc? Maybe you can fork and maintain it somewhere else... -- Lawrence - http://www.oluyede.org/blog "Nothing is more dangerous than an idea if it's the only one you h

Re: "what's new" missing

2006-09-23 Thread Lawrence Oluyede
David Isaac <[EMAIL PROTECTED]> wrote: > "What's New" document for Python 2.5? > http://docs.python.org/dev/whatsnew/whatsnew25.html > pretends to hold it, but the links are corrupt. It's without /dev/ -- Lawrence - http://www.oluyede.org/blog "Nothing is more dangerous than an idea if it's the

Re: ctypes question about call by reference

2006-09-24 Thread Lawrence Oluyede
Oliver Andrich <[EMAIL PROTECTED]> wrote: > - ExceptionType is an enum > - MagickWand is somewhat strange, but so far it works fine without any > type mangling. > > How would I wrap this thing using ctypes? Can anybody help me with that? First thing first: you have to identify how ExceptionType a

Re: ctypes question about call by reference

2006-09-24 Thread Lawrence Oluyede
Oliver Andrich <[EMAIL PROTECTED]> wrote: > Well, what I learned so far from the documentation, which I already > have read more then once today, is that there is no example for an > enum in this situation. But looking at pygame-sdl and another project, > it looks like the enum is just an c_int or

Re: newbie IronPython compiled scripts speed question

2006-09-24 Thread Lawrence Oluyede
dtlog <[EMAIL PROTECTED]> wrote: > I searched the faqs at python.org and didn't find an answer: > does using IronPython, instead of CPython, and compiling the > scripts into native windows executables (I heard IronPython > can do that) result in faster execution times? I don't know what you heard

Re: What value should be passed to make a function use the default argument value?

2006-10-03 Thread Lawrence Oluyede
LaundroMat <[EMAIL PROTECTED]> wrote: > What value do I have to pass to f() if I want it to evaluate var to 1? > I know that f() will return 2, but what if I absolutely want to pass a > value to f()? "None" doesn't seem to work.. I don't know if I understand correctly here but: def f(v=1): re

Re: wxPython or wxWidgets

2006-01-23 Thread Lawrence Oluyede
"py" <[EMAIL PROTECTED]> writes: > i need to design a GUI for my python app. i heard of wxWidgets and was > going to look into that, but then I saw wxPython. Why would I use > wxPython over wxWidgets? wxPython is the Python porting of wxWidgets. -- Lawrence - http://www.oluyede.org/blog "Anyo

Re: ftp: get list of files

2006-02-07 Thread Lawrence Oluyede
"eels" <[EMAIL PROTECTED]> writes: > With yyy = ftp.retrlines('LIST') I get this listing at stdout, but I > need this information at variable yyy. > How can I resolve this problem? As written in the doc retrlines has an optional parameter (a callback function) called on each line retrieved, so yo

Re: Yet another GUI toolkit question...

2006-02-11 Thread Lawrence Oluyede
Kevin Walzer <[EMAIL PROTECTED]> writes: > Unfortunately, PyGTK does not run natively on the Mac (it's X11 only). There's some work in progress: http://developer.imendio.com/wiki/Gtk_Mac_OS_X -- Lawrence - http://www.oluyede.org/blog "Anyone can freely use whatever he wants but the light at the

Re: PyAtom, a Python module for creating Atom syndication feeds

2006-02-23 Thread Lawrence Oluyede
"Steve R. Hastings" <[EMAIL PROTECTED]> writes: > I intend to donate this to the Python Software Foundation, so I have > released it under the terms of the Academic Free License 2.1. > > You can download it from here: > > http://www.blarg.net/~steveha/pyatom.tar.gz > > > The file includes a readme

Re: PyAtom, a Python module for creating Atom syndication feeds

2006-02-23 Thread Lawrence Oluyede
"Steve R. Hastings" <[EMAIL PROTECTED]> writes: > Why do you say this? I don't think the code is perfectly polished and > ready to be called version 1.0, but I think it follows PEP 8 more than not. docstrings of method are messed up (why you begin them from the column 0?) and " Function Na

Re: SyntaxError: can't assign to a function call

2006-02-26 Thread Lawrence Oluyede
"Fuzzyman" <[EMAIL PROTECTED]> writes: f() += [4] > SyntaxError: can't assign to function call It's obvious that that line gives you a syntax error. += is the increment operator overloaded for strings and lists and so on. It changes the lhs in place appending the rhs. In this case the

Re: PythonWin: any way to delete all objects without exiting and without doing it with "del"?

2006-03-01 Thread Lawrence Oluyede
[EMAIL PROTECTED] writes: > In PythonWin, is there any way to bulk-delete all objects without using > "del object" for each, and without having to exit out of PythonWin? PythonWin is just an IDE. For what reason you have to delete all objects by yourself? Garbage collector is there for that :) -

Re: white space in expressions and argument lists

2006-03-02 Thread Lawrence Oluyede
John Salerno <[EMAIL PROTECTED]> writes: > 1 + 2 or 1+2 > > func(1,2) or func(1, 2) I prefer and use 1 + 2 and func(1, 2) I don't do whitespaces only in argument defaults like func(foo=baz) -- Lawrence - http://www.oluyede.org/blog "Anyone can freely use whatever he wants but the light at

Re: glob.glob standardization

2007-06-27 Thread Lawrence Oluyede
billiejoex <[EMAIL PROTECTED]> wrote: > Don't you think it would be more convenient for glob.glob to return > file names only in any case, like os.listdir do? AFAIK it's a wanted behavior. The doc says: """ Notice how any leading components of the path are preserved. """ -- Lawrence, oluyede.o

Re: problem with pickle

2007-07-07 Thread Lawrence Oluyede
K Gaur <[EMAIL PROTECTED]> wrote: > this is what the python interpreter returns on giving the basic > command > > >>>pickle.dump(x,f) where x is a tuple and f is a file object > > Traceback (most recent call last): > File "", line 1, in ? > NameError: name 'pickle' is not defined > > k

Re: Timing a python program run

2007-07-07 Thread Lawrence Oluyede
David <[EMAIL PROTECTED]> wrote: > Is there some way to do this in python on a mac os x from the terminal > window? Or whatever? You can use: % time script.py from the command line of the terminal -- Lawrence, oluyede.org - neropercaso.it "It is difficult to get a man to understand something

Re: __unicode__ method for exception object

2007-07-08 Thread Lawrence Oluyede
Ben Finney <[EMAIL PROTECTED]> wrote: > Your terminal has been detected as using the 'ascii' encoding, so > while that's true no attempt to output non-ASCII characters will work. > > You'll need to change whatever settings are on your terminal emulator > so that it is using an encoding (such as 'u

Re: Dynamic method

2007-07-16 Thread Lawrence Oluyede
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > > I agree that in general the solution explained by Alex and you is better. > > They are not "better" - they are correct. Another way is to use the 'types' module: In [1]: class T(object): ...: pass ...: In [2]: t = T() In [3]: import

Re: Discover instance variables

2007-07-16 Thread Lawrence Oluyede
Gabriel Genellina <[EMAIL PROTECTED]> wrote: > The list keeps only the types explicitely enumerated. Other types are > excluded, as well as names starting with "_". Another criterion would be > `not attr.startswith('_') and not callable(getattr(obj,attr))` Why not: In [1]: class Foo(object): .

Re: Copy List

2007-07-18 Thread Lawrence Oluyede
Joe Riopel <[EMAIL PROTECTED]> wrote: > I am pretty new to python but this works: > > >>> list_one = [0,1,2,3,4,5,6,7,8,9] > >>> list_two = [i for i in list_one] > >>> print list_two > [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >> list_two = list_one[:] or >> list_two = list(list_one) are better :D --

Re: best SOAP module

2007-07-18 Thread Lawrence Oluyede
Sells, Fred <[EMAIL PROTECTED]> wrote: > I need to talk to a vendor side via SOAP, Googling is overwhelming and many > hits seem to point to older attempts. > > Can someone tell me which SOAP module is recommended. I'm using Python 2.4. Try soaplib: -- La

Re: Detecting __future__ features

2007-07-30 Thread Lawrence Oluyede
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > Is there any general mechanism? I'd just use the expected future feature and if the result is not what I expect (or Python raises any kind of exception, like using a keyword not present) I'd think I'm in the past :-) -- Lawrence, oluyede.org - nerope

Re: simple string backspace question

2007-07-31 Thread Lawrence Oluyede
<[EMAIL PROTECTED]> wrote: > >>> text="Hello\bworld" > >>> print text > "HelloBSworld" > > Should this character "\b" (backspace) in this text return this: > "Helloworld"? [EMAIL PROTECTED] ~ % python Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC

Re: simple string backspace question

2007-07-31 Thread Lawrence Oluyede
<[EMAIL PROTECTED]> wrote: > If you mean on operating system then unfortunately Windows XP. I don't know for sure but maybe it doesn't support all ASCII escapes codes. Why do you care about \b anyway :-) ? -- Lawrence, oluyede.org - neropercaso.it "It is difficult to get a man to understand so

Re: help with flexible decorators

2007-08-06 Thread Lawrence Oluyede
james_027 <[EMAIL PROTECTED]> wrote: > While the enhance decorator work with functions of 1 argument, how do > I make it to work with more than one arguments. Using *args. Something like this: def enhance(f): def _new(*args): return f(*args) + 1 return _new @enhance def f(*args):

Re: get wikipedia source failed (urrlib2)

2007-08-07 Thread Lawrence Oluyede
<[EMAIL PROTECTED]> wrote: > This source works fine for other site. the problem is in wikipedia. is > someone now any solution for this problem? Wikipedia, AFAIK, bans requests without a User Agent. http://www.voidspace.org.uk/python/articles/urllib2.shtml#headers -- Lawrence, oluyede.org - nero

Re: verify whether "str" is still callable in Python 2.5.1

2007-08-13 Thread Lawrence Oluyede
Ge Chunyuan <[EMAIL PROTECTED]> wrote: > Once use ActivePython latest version for Python 2.5.1. > I happened to find function "str" is not callable, but it is available > for Python 2.5. > Can anybody give some comments about it? I don't really understand what your asking. str is a callable, it ha

Re: retrieving ATOM/FSS feeds

2007-08-13 Thread Lawrence Oluyede
_spitFIRE <[EMAIL PROTECTED]> wrote: > I'm using feedparser library to parser ATOM/RSS feeds. However, I don't > get the entire post! but only summaries! How do I retrieve the entire feed? > I believe that the parser library should have support for doing that or the > specification should detail

  1   2   >