Re: A lib to build query string...

2007-10-27 Thread Lawrence Oluyede
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Is anybody knows about a function that can build query string from > parameter list? I very need that! urllib.urlencode? -- Lawrence, oluyede.org - neropercaso.it "It is difficult to get a

Re: What Data is Available With a Pickled Object Over a Socket?

2007-10-19 Thread Lawrence Oluyede
milan_sanremo <[EMAIL PROTECTED]> wrote: > I've read the library entry for pickle a couple of times, and I'm > still not > sure what data is maintained when an item is pickled and sent over a > socket. I would not do that if I were you: Unless you do

Re: Cross platform way of finding number of processors on a machine?

2007-10-08 Thread Lawrence Oluyede
Nicholas Bastin <[EMAIL PROTECTED]> wrote: > This is really bad on linux. You really want to parse /proc/cpuinfo > because HT 'cpus' are almost useless, and can be bad in situations > where you try to treat them as general purpose cpus. I'm not the author of the library. I think you should addres

Re: Override 'and' and 'or'

2007-10-07 Thread Lawrence Oluyede
Dekker <[EMAIL PROTECTED]> wrote: > Is it possible to override 'and' and/or 'or'? I cannot find a special > method for it... __and__ and __rand__ and __or__ and __ror__ are for > binary manipulation... any proposals? If you want to customize the truth value testing you have to implement __nonzero_

Re: Yet another comparison of Python Web Frameworks

2007-10-06 Thread Lawrence Oluyede
Tim Chase <[EMAIL PROTECTED]> wrote: > Any respectable comparison of Python web frameworks should > include evaluation of at least Django and TG. Or at least give > good reason why the comparison excludes them. I think you didn't read the foreword of the comparison. That is by no means a comprehe

Re: Yet another comparison of Python Web Frameworks

2007-10-06 Thread Lawrence Oluyede
Jorge Godoy <[EMAIL PROTECTED]> wrote: > What is good, since a lot of good things from Pylons will work with TG and a > lot of good TG things will remain (and possibly be compatible with Pylons). > If you take a better look at "the next version", you'll also see that the > major concern was with WS

Re: Cross platform way of finding number of processors on a machine?

2007-10-06 Thread Lawrence Oluyede
Paul Boddie <[EMAIL PROTECTED]> wrote: > From the experiments I've done with pprocess [1], pretending that a > hyperthreading "virtual CPU" is as good as a real CPU (or CPU core) > tends to be counter-productive: the performance benefits in moving > from the utilisation of one to two "virtual CPUs"

Re: Yet another comparison of Python Web Frameworks

2007-10-06 Thread Lawrence Oluyede
Thomas Wittek <[EMAIL PROTECTED]> wrote: > At least, you missed Turbo Gears :) > http://turbogears.org/ > For me, it feels more integrated than Pylons. Yeah, so integrated that the next version will be based upon Pylons ;-) ? -- Lawrence, oluyede.org - neropercaso.it "It is difficult to get a ma

Re: Cross platform way of finding number of processors on a machine?

2007-10-06 Thread Lawrence Oluyede
John <[EMAIL PROTECTED]> wrote: > Is there a way to find the number of processors on a machine (on linux/ > windows/macos/cygwin) using python code (using the same code/cross > platform code)? >From processing : def cpuCount(): ''' Retur

Re: A question about subprocess

2007-10-03 Thread Lawrence Oluyede
JD <[EMAIL PROTECTED]> wrote: > How can I do it with the subprocess? You can't. Subprocess is a library to spawn new processes on the local machine. If you want to handle external machines you need something like parallel python: -- Lawrence, oluyede.org - nerope

Re: newb: Question regarding custom exception

2007-09-23 Thread Lawrence Oluyede
crybaby <[EMAIL PROTECTED]> wrote: > Why you specify type and name of the exception in your custom > exceptions, It's up to you, if you're interested in the actual exception object you catch it, otherwise not. Take a look at this: -- Law

Re: TypeError: 'module object is not callable'

2007-09-03 Thread Lawrence Oluyede
On Sep 3, 10:48 am, [EMAIL PROTECTED] wrote: > Hi > > I am new to Python and have recieved this error message when trying to > instantiate an object from a class from another file within the same > directory and wondered what I have done wrong. > > I have a Step.py class: > class Step(object) >

Re: Gmane's been quiet ...

2007-08-29 Thread Lawrence Oluyede
Grant Edwards <[EMAIL PROTECTED]> wrote: > Posting that were made to mailing lists via gmane? That, I do not know -- Lawrence, oluyede.org - neropercaso.it "It is difficult to get a man to understand something when his salary depends on not understanding it" - Upton Sinclair -- http://mail.pyt

Re: Gmane's been quiet ...

2007-08-28 Thread Lawrence Oluyede
Steve Holden <[EMAIL PROTECTED]> wrote: > ... so I was wondering if it's just me who hasn't seen any postings today? I think so, through my usenet server I saw the usual lot of postings -- Lawrence, oluyede.org - neropercaso.it "It is difficult to get a man to understand something when his sala

Re: New UI Toolkit

2007-08-26 Thread Lawrence Oluyede
Gerdus van Zyl <[EMAIL PROTECTED]> wrote: > Please reply and let your thoughts be known. Is there a need for a new > GUI library for python? I think there's no real point in answering this question. You developed a new toolkit because, I'm guessing, you are not fully satisfied by the current ones.

Re: How to make a module function visible only inside the module?

2007-08-18 Thread Lawrence Oluyede
beginner <[EMAIL PROTECTED]> wrote: > Is there any equivalent version of C's static function in Python. I > know I can make a class function private by starting a function name > with two underscores, but it does not work with module functions. The trick for the name mangling does not work at modu

Re: How to call module functions inside class instance functions?

2007-08-18 Thread Lawrence Oluyede
beginner <[EMAIL PROTECTED]> wrote: > I have encountered a small problems. How to call module functions > inside class instance functions? For example, calling func1 in func2 > resulted in a compiling error. > > "my module here" > > def func1(): > print "hello" > > class MyClass: >def

Re: how to pass a custom object to re.search?

2007-08-17 Thread Lawrence Oluyede
<[EMAIL PROTECTED]> wrote: > and I'm also curious to know if it is possible to do that... :-) Only if re.search() doesn't check for the type of the argument, which it seems it does. -- Lawrence, oluyede.org - neropercaso.it "It is difficult to get a man to understand something when his salary

Re: how to pass a custom object to re.search?

2007-08-17 Thread Lawrence Oluyede
<[EMAIL PROTECTED]> wrote: > Is it possible to make what I want (to pass a custom object to > re.search)? Try to implement __str__() for your object and provide a string representation for it. re.search(str(custom_object)) -- Lawrence, oluyede.org - neropercaso.it "It is difficult to get a man

Re: How to say $a=$b->{"A"} ||={} in Python?

2007-08-16 Thread Lawrence Oluyede
beginner <[EMAIL PROTECTED]> wrote: > I'd like to do the following in more succint code: > > if k in b: > a=b[k] > else: > a={} > b[k]=a b.setdefault(k, a) -- Lawrence, oluyede.org - neropercaso.it "It is difficult to get a man to understand something when his salary depends on not

Re: All names in the current module

2007-08-15 Thread Lawrence Oluyede
Fabio Z Tessitore <[EMAIL PROTECTED]> wrote: > to get names' list you can simply call globals() Not strictly true. globals() returns the current's scope global vars. If you import a module in the current scope globals() won't display the names inside it. -- Lawrence, oluyede.org - neropercaso.it

Re: All names in the current module

2007-08-15 Thread Lawrence Oluyede
Torsten Bronger <[EMAIL PROTECTED]> wrote: > How can I get a list with all classes defined in the current module? > Thank you! [EMAIL PROTECTED] ~ % cat > t.py class A: pass [EMAIL PROTECTED] ~ % python Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)

Re: make images with python

2007-08-14 Thread Lawrence Oluyede
stefano <[EMAIL PROTECTED]> wrote: > I need make some images using python but i'm lost :P -- Lawrence, oluyede.org - neropercaso.it "It is difficult to get a man to understand something when his salary depends on not understanding it" - Upton Sinclair -

Re: Simple python iteration question

2007-08-14 Thread Lawrence Oluyede
Bryan <[EMAIL PROTECTED]> wrote: > How do I do this? for i, item in enumerate(l): print i, item -- Lawrence, oluyede.org - neropercaso.it "It is difficult to get a man to understand something when his salary depends on not understanding it" - Upton Sinclair -- http://mail.python.org/mailm

Re: chmod g+ Equivalent

2007-08-13 Thread Lawrence Oluyede
milan_sanremo <[EMAIL PROTECTED]> wrote: > I understand that for setting the standard rwx permissions, but how do > these affect the ability to change the setgid bit? Under Solaris you > cannot do it from the command line in absolute mode, so perhaps it is > not possible in python > > I'm trying

Re: chmod g+ Equivalent

2007-08-13 Thread Lawrence Oluyede
milan_sanremo <[EMAIL PROTECTED]> wrote: > I've read the documentation on os.chmod() and can implement all the > standard commands, but what is the syntax for the equivalent of chmod g > + to set the group id? chmod() [1] takes as the second parameter a bitwise or-ed combination of a series of val

Re: check if var is dict

2007-08-13 Thread Lawrence Oluyede
Astan Chee <[EMAIL PROTECTED]> wrote: > I have a variable, I want to check if it is a dictionary or a string. > Is there any better way to do this than I've done. How I did it is by > doing a .items() and catching a AttributeError that it raises if its not > a dictionary. > How do i properly do it?

Re: retrieving ATOM/FSS feeds

2007-08-13 Thread Lawrence Oluyede
_spitFIRE <[EMAIL PROTECTED]> wrote: > For the same feed (where the content producer doesn't provide the full > article!) I was able to see the complete post in other RSS aggregators (like > Blam). I wanted to know how they were able to collect the feed! Perhaps in the feed itself there's the link

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

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: 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: 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: 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: 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: 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: 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: 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: 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: __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: 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: 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: 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: Prevent Modification of Script?

2007-04-05 Thread Lawrence Oluyede
<[EMAIL PROTECTED]> wrote: > Just throw out the .py files and let it run on the .pyc's alone. Which are very easily decompilable. :-) -- Lawrence, oluyede.org - neropercaso.it "It is difficult to get a man to understand something when his salary depends on not understanding it" - Upton Sinclair

Re: How can I get the content of a web site using http library

2007-03-30 Thread Lawrence Oluyede
<[EMAIL PROTECTED]> wrote: > http://www.python.org/doc/current/lib/module-urllib2.html > > Look into urlopen's data parameter. I add also this tutorial to the plate: http://www.voidspace.org.uk/python/articles/urllib2.shtml -- Lawrence, oluyede.org - neropercaso.it "It is difficult to get a ma

Re: Question about extending tuple

2007-03-28 Thread Lawrence Oluyede
abcd <[EMAIL PROTECTED]> wrote: > I wanted to extend tuple but ran into a problem. Here is what I > thought would work I think you should take a look at this to do it properly from the Python devs: http://svn.python.org/view/python/trunk/Lib/collections.py Look for NamedTuple -- Lawrence, oluy

Re: ZSI, SOAP and .NET web services - problem

2007-03-22 Thread Lawrence Oluyede
Jaroslaw Zabiello <[EMAIL PROTECTED]> wrote: > Why nobody wants to add SOAP to standard Python library? XML-RPC was added > and it works without any problems. I think because SOAP is kinda crappy :-) Did you try soaplib? I've never used it (nor SOAP in a whi

Re: read a web page using python

2007-03-17 Thread Lawrence Oluyede
<[EMAIL PROTECTED]> wrote: > Kindly, could you someone tell me how to read a page(any web site) > using Python, what method to be used ? import urllib2 res = urllib2.urlopen(url) page = res.read() See: http://www.voidspace.org.uk/python/articles/urllib2.shtml -- Lawrence, oluyede.org - neroperc

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

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

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's regular expression?

2006-05-08 Thread Lawrence Oluyede
"Davy" <[EMAIL PROTECTED]> writes: > Does Python support robust regular expression like Perl? Yep, Python regular expression is robust. Have a look at the Regex Howto: http://www.amk.ca/python/howto/regex/ and the re module: http://docs.python.org/lib/module-re.html -- Lawrence - http://www.oluy

Re: Why list.sort() don't return the list reference instead of None?

2006-05-08 Thread Lawrence Oluyede
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > However, I wonder why L.sort() don't return the reference L, the > performance of return L and None may be the same. It's not "the same". sort() does not return anything. > Why? I've just explained to you and so the others: by default operation

Re: Why list.sort() don't return the list reference instead of None?

2006-05-07 Thread Lawrence Oluyede
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I want to ask why the designer of Python do so? I'm not a Python core developer nor a designer but I've always known that sort() is a in-place sort and since the list is a mutable object it mutates the list sending the "sort()" message. If you wan

Re: Should I learn Python instead?

2006-04-16 Thread Lawrence Oluyede
"fyleow" <[EMAIL PROTECTED]> writes: > I'm a student/hobbyist programmer interested in creating a web project. I'm a student too and I've done a little Python web related stuff long ago. > It's nothing too complicated, I would like to get data from an RSS > feed and store that into a database.

Re: Upgrading and modules

2006-04-16 Thread Lawrence Oluyede
Brian Elmegaard <[EMAIL PROTECTED]> writes: > I don't it includes every possible module, e.g., py2exe, ctypes, > mysqldb, wxpython... Right but since Python doesn't have a full-integrated central packaging (despite the ongoing Pypi project and Eby's efforts in setuptools) you have to do it manual

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

  1   2   >