Re: FOSS projects exhibiting clean/good OOP?

2008-07-09 Thread Daniel Fetchinson
developers who don't want to know about them but exposing it to advanced developers who do want to know about them. IMHO FormEncode is not a good example of this. But PIL definitely is! Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: sort(cmp=func)

2008-07-09 Thread Daniel Fetchinson
particular definition of "<" is transitive. I.e. a < b and b < c should imply a < c. If this is not satisfied, it doesn't make sense to sort according to your "<" definition. It's just not a well-defined operation and no trick will make it work. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: python scalability

2008-07-09 Thread Daniel Fetchinson
n the desktop app scene but web apps then probably it is also suitable for desktop apps. You can probably convince your manager that the previous statement is true. Once that is done you can point to youtube and google who are heavy python users without scalability issues. Cheers, Daniel -- Psss,

Re: Python with Ecmascript

2008-07-10 Thread Daniel Fetchinson
>> Is there a way to do similar things on linux? > > NJSModule? > http://en.wikipedia.org/wiki/NJS This seems to be very good indeed. Just downloaded njs but the only njsmodule version I could find was for python 2.1. Does anyone have a recent copy? Cheers, Daniel -- Psss, ps

Re: Bypassing WebFilter security

2008-07-10 Thread Daniel Fetchinson
ugh the web. But if I were you I would use an ssh client to ssh to a remote machine on which I have an account, download the file there to that machine and scp it to the local machine. Assuming of course port 21 is not blocked. In fact, this is something I do regularly for similar reasons :) Good

Re: Python with Ecmascript

2008-07-11 Thread Daniel Fetchinson
ists.njs-javascript.org/cgi-bin/mailman/listinfo/users > > 2. Did you try to compile it? > Is there anything obviously 2.5 incompatible? Well, so far I couldn't even compile njs (./configure complains about HOST setting or some such) so haven't looked at njsmodule yet. Tha

Re: Bypassing WebFilter security

2008-07-12 Thread Daniel Fetchinson
download the file there to that >> machine and scp it to the local machine. Assuming of course port 21 is >> not blocked. >> >> In fact, this is something I do regularly for similar reasons :) >> >> Good luck, >> Daniel >> -- >> Psss, psss, put it down!

Re: How to create a timer/scheduler in Python?

2008-07-12 Thread Daniel Fetchinson
hich is exactly the tool you describe and luckily is 99.99% independent of turbogears. I'd think you need to modify 1-2 lines: http://svn.turbogears.org/tags/1.0.4.4/turbogears/scheduler.py Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Keg - A python web framework

2008-08-04 Thread Daniel Fetchinson
eful one in the open source world. You can expect exactly 0 users and no appreciation for your efforts which will/can lead to frustration and bad health. Contributing to an already existing and mature framework like django and turbogears can/will be on the other hand rewarding. Cheers, Daniel --

Re: How to round a floating point to nearest 10?

2008-08-09 Thread Daniel Klein
On Sat, 9 Aug 2008 04:31:38 -0700 (PDT), Will Rocisky <[EMAIL PROTECTED]> wrote: >I want my 76.1 to be rounded to decimal 80 and 74.9 to decimal 70. >How can I achieve that? >>> for n in (74.9, 76.1): print int((n+5)/10)*10 70 80 Dan -- http://mail.python.org/mailman/listinfo/python-lis

Re: Perl to Python using MqSQLdb

2008-08-12 Thread Daniel Mahoney
On Tue, 12 Aug 2008 05:51:19 -0700, Mike P wrote: > Hi All, > > I've been given a Perl script that i'm trying to convert into python. > The aim of the script links to MqSQL database, but i'm stuck on one > part > >my $sth = $dbh->prepare($sql)|| >die "Could not prepare SQL statement

Using unittest for benchmarking / speed improvements

2008-03-29 Thread Daniel Abel
(which is also handy, but I would only need unittest-level timing, i.e. not as granular as profile creates.) So, is there such a complete framework (i.e. which can compare speed across revisions) or do I have to hack one together myself? (And would others be interested in it?) Thanks in advanc

[OT] troll poll

2008-03-31 Thread Daniel Fetchinson
[Heavily off-topic fun stuff] Hi folks, This is a quick poll to have scientific data on our beloved troll community: Whose trolling behaviour is more professional? (check one) [ ] - Xah Lee [ ] - castironpi More specifically, who can create a bigger mess on c.l.py? (check one) [ ] - Xah Le

Re: ANN: cubictemp template engine

2008-04-01 Thread Daniel Fetchinson
port the Buffet API? Do you have any benchmarks to compare it with other template systems (in terms of speed)? Cheers, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: developing web spider

2008-04-01 Thread Daniel Fetchinson
) If you are less ambitious have a look at http://nikitathespider.com/ which is also a spider in python. Cheers, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing HTML?

2008-04-02 Thread Daniel Fetchinson
m/search?q=python+html+parser ? HTH, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: id functions of ints, floats and strings

2008-04-03 Thread Daniel Fetchinson
s of the same element > (of type int, string and sometimes even float), imply that the tuple a > = (1,) takes (nearly) the same storage space as a = 1*(1,)? (What > about a list, where elements can be changed at will?) I'm not sure about tuples but for lists the storage space needed for 1*(1,) is roughly 1 times more than for (1,). > Would appreciate your responses... HTH, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: @x.setter property implementation

2008-04-06 Thread Daniel Fetchinson
> I found out about the new methods on properties, .setter() > and .deleter(), in python 2.6. Obviously that's a very tempting > syntax and I don't want to wait for 2.6... > > It would seem this can be implemented entirely in python code, and I > have seen hints in this directrion. So before I go

Re: Google App Engine

2008-04-09 Thread Daniel Fetchinson
> > > The backend data store, while it has a vaguely SQLish query language is an > > object database not a relational database, i.e. more like ZODB than MySQL. > > It uses similar concepts to django's data api but isn't the same. It > should > > be possible to write something simple to replace it,

Re: Python conventions

2008-04-10 Thread Daniel Fetchinson
atement > expression > variable > > Is this a good outer-level organization? > > For each topic, cover: > > documentation > naming convention(s) > format > > Second question: are the above the items we cover for each topic? > Others? I'm sorry t

Re: Python conventions

2008-04-10 Thread Daniel Fetchinson
> > I'm sorry to disappoint you but this project has already been completed: > > > > http://www.python.org/dev/peps/pep-0008/ > > Daniel, PEP 8 is anything but complete. How much of the following > simple question can you answer from there: > > Given that

matplotlib in fedora 8, png format and easy_instal failure on 64bit machine

2008-04-11 Thread Daniel Fetchinson
the reason was that it tried to use the 32bit libraries instead of the 64bit ones (my machine is a core 2 duo). Does anyone of you use matplotlib on a 64bit machine for writing png's? Which version do you use? Cheers, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Recommendation for Web Framework

2008-04-13 Thread Daniel Fetchinson
n > ramp up quickly to get this project out of the door fast. I'm also a > framework newbie, so I know there's a learning curve. > > Any input is appreciated, thank you. > > - james > > -- > http://mail.python.org/mailman/listinfo/python-list > Have you looked at http://code.google.com/p/dbsprockets/ and/or http://code.google.com/p/dbsprockets/wiki/DBMechanic ? HTH, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: mod_python

2008-04-14 Thread Daniel Fetchinson
p://modpython.org/live/current/doc-html/ HTH, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Interesting timing issue I noticed

2008-04-14 Thread Daniel Fetchinson
al version of your code that still shows the above behaviour. Most probably you are not computationally bound and the majority of the execution time is spent on memory read/write. For example it might happen that the version of your code that has less number of FLOPS accesses the memory more often. HTH, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Interesting timing issue I noticed

2008-04-15 Thread Daniel Fetchinson
he > (ostensibly smaller) first loop is actually equal to or LARGER than the > second? First of all, your method of timing is not the best. Use the timeit module instead: http://docs.python.org/lib/module-timeit.html Second of all the number of subtractions is not that different between the two variants of your functions. back_diff_one does 75360 subtractions per call while back_diff_two does 76800, these two numbers are almost the same. It's true that back_diff_one first only calculates a part of the arrays but after "# tracks object" you do a bunch of more substractions that will make up the total count. HTH, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Interesting timing issue I noticed

2008-04-15 Thread Daniel Fetchinson
ent. > > On Tue, Apr 15, 2008 at 11:04 PM, Daniel Fetchinson < > [EMAIL PROTECTED]> wrote: > > > > I've written up a stripped down version of the code. I apologize for > > the bad > > > coding; I am in a bit of a hurry. > > > > >

Re: Interesting timing issue I noticed

2008-04-15 Thread Daniel Fetchinson
On 4/15/08, Daniel Fetchinson <[EMAIL PROTECTED]> wrote: > > Can I then simply ignore the time data then? I do see better performance > > obviously the smaller the box is, but I guess my issues is how seriously > to > > take all this data. Because I can't claim &quo

Re: Finally had to plonk google gorups.

2008-04-16 Thread Daniel Fetchinson
c to Python and Linux (or any Open Source > product), they shouldn't be used either (since I'm not paying for > them). > > Mike Mike, Steve did not say you (or anyone) should not use google groups. He said you get what you paid for, which is certainly the case. Some open source products are good and some are worse, that's all. Full disclosure: I'm using google groups for both reading and writing. Cheers, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: python beginer

2008-04-16 Thread Daniel Fetchinson
ions http://wiki.python.org/moin/WebFrameworks http://www.modpython.org/ http://turbogears.org/ http://djangoproject.com/ You need be prepared to evaluate a bunch of options before deciding which way you go. Unfortunately this can not be avoided and can be quite a lengthy process. HTH, Daniel -- http://mail.p

index of list of lists

2008-04-16 Thread Daniel NL
yes, there's a thread with the same title, but I believe mine is more appropriate title. so, as much as I search on the web, read manuals, tutorials, mail-lists (including this one) I cannot figure it out how to search a string in a list of lists. like this one: someList = [['somestring', 1, 2]

Re: I just killed GIL!!!

2008-04-16 Thread Daniel Fetchinson
> Hello Guys... > > I just had one moment of exceptional clarity, during which realized > how I could get the GIL out of my way... It's so simple, I cannot help > wondering why nobody has thought of it before. Duh! Now I am going to > sit and and marvel at my creation for a while, and then go to be

Re: index of list of lists

2008-04-16 Thread Daniel Fetchinson
rong approach? > should I use numpy, numarray, something else? > can anyone, be kind and help me with this? someList = [['somestring', 1, 2], ['oneother', 2, 4]] for alist in someList: if alist[0] == 'somestring': print "Found it at index %

Re: ???Python Memory Management S***s???

2008-04-20 Thread Daniel Fetchinson
# You can try: nothing is freed by this > """ > ??? How do you people control python to free the memory in python 2.5 or > python 2.4 ??? > Cheers!!! I don't know about the others, I personally let the garbage collector take care of it. HTH, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: cherrypy-webapp-code?

2008-04-20 Thread Daniel Fetchinson
> anyone have a small cherrypy-webapp and are willing to post the code. > could be a nonsense-app just wanna see some code. > -- > http://mail.python.org/mailman/listinfo/python-list > Did you try google? And the cherrypy website? -- http://mail.python.org/mailman/listinfo/python-list

Re: I would like to learn scripting in Python too!

2008-04-20 Thread Daniel Fetchinson
ing point: http://wiki.python.org/moin/BeginnersGuide HTH, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Does Python 2.5.2's embedded SQLite support full text searching?

2008-04-21 Thread Daniel Fetchinson
he python sqlite wrapper (that is part of the stdlib) and if it doesn't then not. This is true for any sqlite feature though. So if you need an sqlite feature just go ahead and build your own sqlite with that feature enabled and use that feature with the stock python sqlite wrapper that comes

Re: Does Python 2.5.2's embedded SQLite support full text searching?

2008-04-21 Thread Daniel Fetchinson
tself separately) and I assumed on windows you have to install sqlite separately too. My apologies for the misinformation. Cheers, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Does Python 2.5 include or not include SQLite engine?

2008-04-22 Thread Daniel Fetchinson
> > While reading feedback to my post "Does Python 2.5.2's embedded SQLite > > support full text searching?" I noticed that there appears to be some > > confusion regarding whether Python 2.5 includes the SQLite engine. > > > > My Windows 2.5.2 binary download includes SQLite. > > > > But other pos

Re: Does Python 2.5.2's embedded SQLite support full text searching?

2008-04-22 Thread Daniel Fetchinson
a query from python through the db api it will travel to the part of the wrapper that is implemented in python then to the C wrapper (_sqlite3.so) and then to your new libsqlite3.so which interprets the new keyword correctly. Of course you can not change the sqlite C api in this way for that you woul

Re: Can you recommend a book?

2008-04-25 Thread Daniel Folkes
On Apr 25, 6:28 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hello all, I learned Python with the book "Programming Python" by John > Zelle. But today this book is a little bit old. My Python is some kind > old. I need a book that will help me brush my style and keep me up to > date. I woul

Re: MESSAGE RESPONSE

2008-04-25 Thread Daniel Fetchinson
> >> And as such, I find it hard to believe you could lose your job > >> over it. > > > > Me too. That is, until I tried to Google Belcan and Blubaugh > > together. May I suggest a new thread to clear that ugly > > results? :D > > I know it's not nice to laugh at things like that, but I can't > hel

Re: So you think PythonCard is old? Here's new wine in an old bottle.

2008-05-05 Thread Daniel Fetchinson
tp://test.powersystemadvisors.com/desktopHelloWorld.jpg > > It shouldn't be long before I can fill in the gaps and have the GUI > builder maps the rest of the Pythoncard widgets to Qooxdoo widgets. > Once I've done that, I can have the same application running from the > de

Re: psycopg2 ReferenceManual

2008-05-05 Thread Daniel Fetchinson
> Hi all, where can I find the reference manual from the psycopg2 or the > dbapi2.0 because in their official pages I could'nt find > thx > > Once you have the source of any package you can create a reference manual using e.g. epydoc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Idea for P3K

2008-05-07 Thread Daniel Fetchinson
> > I don't often feel like using this word > > Look at languages like OCAML or F # > I looked at OCAML and F#. Now what? Cheers, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Is using range() in for loops really Pythonic?

2008-05-10 Thread Daniel Fetchinson
it. Maybe you can switch to xrange( ) which doesn't return a list but an iterator. Note that in python 3.0 xrange will cease to exist and range( ) will return an iterator instead. Cheers, Daniel -- http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Don´t find HTMLgen

2008-08-14 Thread Daniel Fetchinson
e for my help. Since gentoo and debian (I think) were packaging it you can get it from their package repositories. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: mod_python and updated files

2008-08-18 Thread Daniel Klein
On Mon, 18 Aug 2008 09:16:13 -0700 (PDT), Aaron Scott <[EMAIL PROTECTED]> wrote: >I have mod_python running on my server, but when I chance a Python >file on the server, Apache needs to be restarted in order to have the >changes take effect. I assume this is so mod_python can run >persistently, bu

Prevalent Python/Django academic software

2008-08-20 Thread Daniel Bickett
Is anyone working on any software at present, using django or python in general, which serves various academic/course functions, or else that of student-instructor arbitration? A popular example which my university uses is the "Blackboard Academic Suite" (wpedia:Blackboard Inc.), which offers a wid

Re: Prevalent Python/Django academic software

2008-08-21 Thread Daniel Bickett
On Aug 21, 7:39 am, [EMAIL PROTECTED] (Cameron Laird) wrote: > I don't understand the question. YES, there are MANY > Python-based applications doing service in a variety > of academic contexts. No, there is no central index > of all such programs. Sorry if I was unclear. If there are many such

__eq__ problem with subclasses

2008-08-22 Thread Daniel Israel
.e., 'a==b+c' set 'a' equal to the sum of 'b' and 'c'. So 'a==b' is very different from 'b==a'. -- Daniel M. Israel [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: __eq__ problem with subclasses

2008-08-23 Thread Daniel Israel
Scott David Daniels wrote: Daniel Israel wrote: I am very confused by the following behavior. I have a base class which defines __eq__. I then have a subclass which does not. When I evaluate the expression a==b, where a and b are elements of these classes, __eq__ is always called with the

help to use "zc.sourcerelease "

2008-09-02 Thread daniel jeem
Hello every body, I want to use "zc.sourcerelease " for creating pakage. But I'm blocked because I have'nt understand how to use it. Then if you have some link or tutorial, share it for me. Help please. Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: Alternatives to traditional RDBMS

2008-09-10 Thread Daniel Fetchinson
>> Are there any known alternatives >> to the traditional RDBMS (MySQL, >> PostgreSQL, SQLite, Oracle, etc0 / >> >> I know of 3 written in Python: >> * buzhug >> * kirbybase >> * PyDbLite > > ZODB. Without any problems usable without ZOPE, clusterable, ACID-conform > and so forth. There is als

Re: PLEASE HELP ME WITH THIS ASSIGNMENT...PLEASE....

2008-09-10 Thread Daniel Fetchinson
versions of programs you wrote in > Part A and Part B. Use a combination of gettimeofday() system call and > inter-process synchronization to measure (1) the average hand-over time > between two consecutive processes in the ring and (b) the total > execution time to complete N turns. Plot the measured values as graphs > when varying number of processes P and number of turns N. Explain the > results you obtain. > Submission Guidelines > > Thanking you, > > Ms. Vaidehi Pawar How much do you pay? Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: PLEASE HELP ME WITH THIS ASSIGNMENT...PLEASE....

2008-09-11 Thread Daniel Fetchinson
unt you are willing to pay otherwise nobody will take it seriously. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

deriving from complex

2006-03-07 Thread Schüle Daniel
st): File "", line 1, in ? File "", line 3, in __init__ TypeError: readonly attribute >>> how can I work around this problem? Regards, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: deriving from complex

2006-03-07 Thread Schüle Daniel
.0/360*2*pi]) (1.0002+1j) >>> polar(1+1j) (1.4142135623730951, 0.78539816339744828) >>> btw I like how Ruby handles the creation of complex numbers c = Complex(1,1) p = Complex.polar(1,45.0/360*2*PI) Regards, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: deriving from complex

2006-03-07 Thread Schüle Daniel
thank you I will have to take a closer look on __new__ Regards, Daniel -- http://mail.python.org/mailman/listinfo/python-list

[exec cmd for cmd in cmds]

2006-03-08 Thread Schüle Daniel
;> p = "z%i = complex(1-1e-%i, 1-1e-%i);" >>> c = reduce(lambda x,y: x+y, [p % (i,i,i) for i in range(20,30)]) >>> exec c and one more :) >>> p = "z%i = complex(1-1e-%i, 1-1e-%i);" >>> c = "".join([ p % (i,i,i) for i in range(20,30) ]) >>> exec c Regards, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: [exec cmd for cmd in cmds]

2006-03-08 Thread Schüle Daniel
[...] > If you think so :) Ususally people go for dictionaries in such cases. you are right, I didn't think about dictionaries >>> p = "complex(1-1e-%i, 1-1e-%i)" >>> d={} >>> [d.update({i:eval(p % (i,i))}) for i in range(20,30)] [None, None, None, None, None, None, None, None, None, None] s

Re: Inter-module globals

2006-03-09 Thread Schüle Daniel
Anton81 wrote: > Hi, > > I want to use globals that are immediately visible in all modules. My > attempts to use "global" haven't worked. Suggestions? > > Anton I think a dictionary would work here as well as list but not strings and int's # module1 settings = { "release" : "1.0",

Re: A better RE?

2006-03-09 Thread Schüle Daniel
Magnus Lycka wrote: > I want an re that matches strings like "21MAR06 31APR06 1236", > where the last part is day numbers (1-7), i.e it can contain > the numbers 1-7, in order, only one of each, and at least one > digit. I want it as three groups. I was thinking of > > r"(\d\d[A-Z]\d\d) (\d\d[A-Z]

Re: output formatting for classes

2006-03-09 Thread Schüle Daniel
Russ wrote: > I'd like to get output formatting for my own classes that mimics the > built-in output formatting. For example, > > x = 4.54 print "%4.2f" % x > > 4.54 > > In other words, if I substitute a class instance for "x" above, I'd > like to make the format string apply to an elem

Re: Mutable complex numbers [was Re: output formatting for classes]

2006-03-11 Thread Schüle Daniel
Steven D'Aprano wrote: > On Fri, 10 Mar 2006 02:19:10 +0100, Schüle Daniel wrote: > > >>yeah, i miss some things in complex implementation >>for example c=complex() >>c.abs = 2**0.5 >>c.angle = pi/2 >> >>should result in 1+1j :) > > >

__slots__ in derived class

2006-03-15 Thread Schüle Daniel
>> z.y = 100 >>> z.z = 100 Traceback (most recent call last): File "", line 1, in ? AttributeError: 'Z' object has no attribute 'z' >>> here it works like expected Regards, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: global, globals(), _global ?

2006-03-15 Thread Daniel Dittmar
ld be shunned and > avoided. Solution: replace globals with Singletons ;-) Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: "pow" (power) function

2006-03-15 Thread Schüle Daniel
Russ wrote: > I have a couple of questions for the number crunchers out there: > > Does "pow(x,2)" simply square x, or does it first compute logarithms > (as would be necessary if the exponent were not an integer)? > > Does "x**0.5" use the same algorithm as "sqrt(x)", or does it use some > other

int <-> str asymmetric

2006-03-16 Thread Schüle Daniel
ror: str() takes at most 1 argument (2 given) >>> fails it would not break anything if str interface would be changed what do you think? Is this already proposed or maybe implemented in 2.5? Regards, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: what's going on here?

2006-03-16 Thread Schüle Daniel
gt;> lst [[1.0, 2.0, 3.0, 4.0]] >>> lst.append(map(float, line2.split())) >>> lst [[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]] >>> hth, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: My Generator Paradox!

2006-03-16 Thread Schüle Daniel
f1.next() (3, 5) >>> >>> >>> f2.next() (1, 2) >>> it's only natural that each objects starts it's own fibonaci serie hth, Daniel -- http://mail.python.org/mailman/listinfo/python-list

MPI implementations

2006-03-17 Thread Daniel Nogradi
I plan to use python parallel and -- fortunately or unfortunately -- there are several implementations. At the moment I'm aware of http://datamining.anu.edu.au/~ole/pypar/ http://pympi.sourceforge.net/ http://www.fysik.dtu.dk/~schiotz/comp/PythonAndSwig/pythonMPI.html and wondered if anyone had e

[ann] markup.py - HTML/XML generator

2006-03-19 Thread Daniel Nogradi
Just in case the thought of not having a millionth implementation of a HTML/XML generator for Python makes the world as we know it a miserable place, well then your suffering might be over soon since exactly the one millionth implementation is out. You can download markup.py from http://markup.sou

Re: markup.py - HTML/XML generator

2006-03-20 Thread Daniel Nogradi
> > Just in case the thought of not having a millionth implementation of a > > HTML/XML generator for Python makes the world as we know it a > > miserable place, well then your suffering might be over soon since > > exactly the one millionth implementation is out. You can download > > markup.py fro

Re: import random module

2006-03-22 Thread Daniel Dittmar
Just put a print random after the import random.py You'll probably see that Python is importing your main module instead of the one from the lib. Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrap a dictionary in a class?

2006-03-22 Thread Daniel Nogradi
> In another thread, it was recommended that I wrap a dictionary in a > class. > How do I do so? I guess this is what you want: http://vsbabu.org/mt/archives/2003/02/13/joy_of_python_classes_and_dictionaries.html HTH, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: How to determine an object is "scriptable"

2006-03-30 Thread Daniel Evers
Richard Brodie wrote: > subscriptable: supports an indexing operator, like a list does. Right. You can check this e.g. with hasattr(x, "__getitem__") because the __getitem__ method is used for indexing. Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Spawn/Kill Process

2006-03-31 Thread Daniel Nogradi
> I need to write a script that starts an exe and then continues through > the script. I am able to start the exe file but my script doesn't > continue because the process I start runs in the background of Windows > (as it is supposed to). I have tried using both os.system and os.popen > to get aro

Re: python tutorial: popular/informative Python sites ?

2006-04-02 Thread Daniel Bickett
I read c.l.py and (the Unofficial) Planet Python (and that's it), so perhaps that's an appropriate suggestion: http://www.planetpython.org/ (From the Starship: "If you want to join the crew, we only require your PSA membership....") -- Daniel Bickett dbickett a

[ANN] markup.py - 1.2 - an HTML/XML generator

2006-04-03 Thread Daniel Nogradi
A new release of markup.py is available at the sourceforge project page: http://sourceforge.net/projects/markup/ Markup.py is a set of classes that attempts to make it easier to generate HTML/XML from a Python program in an intuitive, light-weight, customizable and pythonic way. Full documentatio

Re: Python and microsoft outlook-using com, can I interact with msoutlook?

2006-04-04 Thread Daniel Dittmar
s.Inbox.Folders: if folder.Name == 'Junk': return folder See the Spambayes Outlook plugin (http://spambayes.sourceforge.net/) for a complex example. Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: markup.py - 1.2 - an HTML/XML generator

2006-04-04 Thread Daniel Nogradi
> > $ pwd > > /usr/lib/python2.4/site-packages > > $ grep -re klass . | wc -l > > 274 > > $ grep -re class_ . | wc -l > > 897 > > How many of those "class_" instances are really just substrings of > "__class__" and "class_name" and such? On my machine, I see a handful > in the standard library, an

Re: HTMLParser fragility

2006-04-05 Thread Daniel Dittmar
ons. You could try HTMLTidy (http://www.egenix.com/files/python/mxTidy.html) as a first step to get well formed HTML. Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: GUI issues in Python

2006-04-06 Thread Daniel Dittmar
wxPython has an interface to the OGL library (screenshot: http://www.wxpython.org/ss/wxPythonOSX.png, features: http://www.wxwindows.org/contrib/ogl/ogl.htm) Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: GUI issues in Python

2006-04-06 Thread Daniel Dittmar
[EMAIL PROTECTED] wrote: > Thanks Daniel, I really think that this should be the solution to my > problem. > > A quick Question...is wxPython Operating System dependent or it can be > used with anu OS like Linux, Windows and Mac ? > see http://www.wxpython.org/download.php#b

Re: passing argument to script

2006-04-07 Thread Daniel Nogradi
> hi > > if i have a string like this > > "ABCE-123456 ABC_DEF_Suggest(abc def ghi).txt" > > that needs to be passed to a python script > and i wanted to get the words inside the brackets after i passed this > string. I did a re > something like > > thestring = sys.argv[1:] > pat = re.compile(r".*

ANN: pyISBNdb 0.1

2006-04-07 Thread Daniel Bickett
Package: pyISBNdb Version: 0.1 Pre-Alpha Author: Daniel Bickett <[EMAIL PROTECTED]> Website: http://heureusement.org/programming/pyISBNdb/ ABOUT: pyISBNdb is a library that serves as a pythonic interface with the ISBNdb.com API, a service that provides a vast database of book infor

Re: how relevant is C today?

2006-04-08 Thread Daniel Nogradi
> "The Dice" (find tech jobs) has offerings > (last 7 days, U.S. + unrestricted) for: >*SQL 14,322 >C/C++11,968 >Java 10,143 >... >Perl 3,332 >PHP 730 > *Python* 503 >Fortran 119 >Ruby108 >open*gl 66 Can anyone she

Re: using vim as a python class/module/function etc.. browser

2006-04-11 Thread Daniel Nogradi
rtical window where you can easily jump to the file containing a chosen definition. This script is here: http://www.vim.org/scripts/script.php?script_id=273 HTH, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Help - strange behaviour from python list

2006-04-11 Thread Schüle Daniel
t;>> foo(3) [1, 2, 3] >>> foo(4,[0]) [0, 4] >>> here list lst is created and bound once compare with this one (which is what you really want) >>> def bar(val, lst=None): ... if lst is None: ... lst = [] ... lst.append(val) ... print lst

Re: setting up mod_python handlers on a server?

2006-04-11 Thread Daniel Nogradi
> > and I think what you want is: > > > > AddHandler mod_python .psp > > PythonHandler mod_python.psp > > This is what I have in my htaccess file (along with debugging). But > there is also an option in the control panel to set new handlers and > extensions on the server, but I'm not sure what to c

Re: Problem with spawning an external process

2006-04-12 Thread Daniel Nogradi
> > I want to execute a command (in this case, and it seems to be > > significant, a Java program) in a thread in Python. When I execute the > > java binary in the main python thread, everything runs correctly. But > > when I try and execute java in a thread, java segfaults. I am using > > Python 2

Re: Problem with spawning an external process

2006-04-12 Thread Daniel Nogradi
> > > I want to execute a command (in this case, and it seems to be > > > significant, a Java program) in a thread in Python. When I execute the > > > java binary in the main python thread, everything runs correctly. But > > > when I try and execute java in a thread, java segfaults. I am using > >

Re: Problem with spawning an external process

2006-04-12 Thread Daniel Nogradi
> Daniel, thanks for your input. What version of the JDK/JRE and Python > are you using? So the previous test was on python 2.4, java 1.4.2, suse 9.3 but now I ran it on python 2.3.5, java 1.4.2, gentoo 1.4.16 and your code still does what it supposed to do. I'm not sure if that is g

namespace issue

2006-04-13 Thread Daniel Nogradi
I would like to give the same name to a keyword argument of a class method as the name of a function, with the function and the class living in the same namespace and the class method using the aforementioned function. So far I've been unsuccesfully trying to go along these lines: def great_name(

Re: namespace issue

2006-04-13 Thread Daniel Nogradi
Ooops, there was a typo in my previous mail: > in the hope of the del statement only removing the local variable util ^ the above line should be: in the hope of the del statement only removing the lo

Re: namespace issue

2006-04-14 Thread Daniel Nogradi
> def _gn(x): > return x.upper() > > great_name = _gn > > class myclass: > def mymethod(self, great_name=False): > if great_name: > return _gn('something') > else: > return 'something' > >>> def great_name(x): > ... return x.upper() > ... > >>

Re: Calling Python from Matlab

2006-04-15 Thread Daniel Nogradi
> I am desperately looking for a way to call Python from Matlab. I have become > used to Python's rich syntax and large number of libraries, and feel > ridiculously clumsy being stuck with Matlab's rather restricted facilities > for doing other things than standard mathematical work. > > Does anyon

Re: Async Sleep?

2006-04-16 Thread Daniel Nogradi
> Hi all, > > Does a async sleep exist? > How to check this every 10 sec, but that the CPU is free? I would use a separate thread for this, perhaps even a completely detached daemon. You might want to check the docs for threading: http://docs.python.org/lib/module-threading.html and these recipe

Re: CGI scripts

2006-04-17 Thread Daniel Nogradi
> Can I use Python for CGI scripts. It is telling me to use Perl and I > don't know any > > To be honest I don't really no what CGI scripts are (soz) > > I have purchased a domain name of my ISP PIPEX and 100MB space > > And I don't know what I can do with it now Will your pages be served by your

<    9   10   11   12   13   14   15   16   17   18   >