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

<    1   2