Removing the Close, Min, Maximize and frame with ANY gui toolkit

2008-02-05 Thread Daniel Folkes
of a window. Thanks, Daniel Folkes http://danfolkes.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for library to estimate likeness of two strings

2008-02-06 Thread Daniel Fetchinson
with SQLObject as the ORM what would be the most effective way of doing such a query? Cheers, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Microsoft's challenger to Python

2008-02-07 Thread Daniel Fetchinson
> > > I am not, however, an in depth language nutter, so would > > > appreciate any of our more learned readers comments. Maybe I'm missing the obvious here, but what does Cobra have to do with Microsoft? (Apart from being .NET oriented.) It seems it's an open source project of a guy who doesn't

Re: Dear David

2008-02-08 Thread Daniel Fetchinson
> I have discontinued the use of ?? a long time ago. Why is this > still a problem? Welcome to bewildering yet joyful world of usenet! It seems you are already having quite some fun! -- http://mail.python.org/mailman/listinfo/python-list

Re: Email Directly from python

2008-02-15 Thread Daniel Folkes
You could always just set up a gmail account and use that SMTP. Thats what I do. Then all you have to do is google search for "gmail smtp python" and get some easy code. You can even send attatchments really easy. -Daniel Folkes brad wrote: > I'd like to send email directly

Re: ROUNDING???

2008-02-18 Thread Daniel Fetchinson
> in python im doing the problem 255/494 Try this: >>> 255.0/494.0 0.51619433198380571 >>> float(255)/float(494) 0.51619433198380571 > it keeps giving me 0 instead of .51 > what am i doing wrong? Nothing, integer division is not wrong :) > please help me I have been looking for hours

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-18 Thread Daniel Fetchinson
1.5 or higher > - wxPython 2.6 or higher > - pyexiv2 (optional) > - python nautilus bindings (optional) This is pretty cool! I have one question about the equally cool website: what tool did you use for creating this image: http://photobatch.wikidot.com/local--files/start/Screenshot-Phatch3d.jpg Cheers, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-19 Thread Daniel Fetchinson
ch on three screenshots I have to put them in perspective > with rounded corners and perspective. I let Phatch save them as a png > so transparency is preserved. Afterwards I opened Gimp and put the > three together on the background of a radial gradient. > > Let me know if it works for you. Yep, I indeed missed the tutorial :) Now it's clear, thanks a lot! Cheers, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for up to date documentation for Python/Tkinter

2008-02-21 Thread Daniel Mahoney
On Thu, 21 Feb 2008 07:47:35 -0800, Kintaro wrote: > Oh wise usenet users, > > Please speak unto me the URL which contain the latest documentation on > Python/Tkinter programming. > > I have seen Fredrik Lundh's introduction to tkinter (and others) and > it appears to be for an earlier version o

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-24 Thread Daniel Fetchinson
; - python nautilus bindings (optional) Now that we are at image manipulation does anyone know of a good, possibly python based, image manipulation tool that can do the same as the windows tool andrea mosaic? http://www.andreaplanet.com/andreamosaic/samples/ Stani, if this is a good place for feature requests I would like to add it :) Cheers, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: most loved template engine on python is?

2008-02-24 Thread Daniel Fetchinson
> After deciding choosing python as my future killer application language > for writing web applications, I need from you guys still some support, > if you apologize. > > Question: > Which is the most loved template engine for python? AFAIK, there is no single blessed template system. If you're up

Re: SQLLITE

2008-03-02 Thread Daniel Fetchinson
> > > I am having a minor problem when I try and do this: > > > c.execute("insert into [tblTranscripts] (MovieID,Transcript) > > > Values(" + movieID + ",'" + formatText + "');") (don't even bother > > > commenting of the sql style I know its bad form but this is a simple > > > script). Whenever I

Re: Snackages [Re: is there enough information?]

2008-03-03 Thread Daniel Fetchinson
> >> Speak not of Wendy's -- they moved into town in my college days... > >> The "hot and juicy" was commonly taken to mean: patty dipped in pan > >> drippings, then nuked in microwave... And any CompSci person could > >> figure out that the "256 different ways" meant one had access to a tray > >>

Re: metaclasses

2008-03-03 Thread Daniel Fetchinson
> What are metaclasses? http://www.google.com/search?q=python+metaclass HTH, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a class?

2008-03-05 Thread Daniel Fetchinson
> > Where to begin? > > What does exec( open( 'modA.py' ).read() ) do? The most appropriate list to ask those questions is: http://mail.python.org/mailman/listinfo/tutor -- http://mail.python.org/mailman/listinfo/python-list

Re: Python GDB Wrapper

2008-03-06 Thread Daniel Bonekeeper
On Fri, Mar 7, 2008 at 4:01 AM, Raja <[EMAIL PROTECTED]> wrote: > Hi, > I am trying to develop a a GDB wrapper script in python which is > able to extract a stack trace and all relevant data. > > Has anyone does this before ? Even some basic idea or code as to how > to proceed would be grea

Re: Green's Function

2008-03-08 Thread Daniel Fetchinson
> I am new to Python and trying to solve the Hamiltonian of a linear chair > of atoms using green's function. > Does anyone know any pre-existing library functions and literature that > could be helpful? You might find this helpful: http://scipy.org/ HTH, Daniel -- http:

image matching algorithms

2008-03-09 Thread Daniel Fetchinson
ateful! Cheers, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: image matching algorithms

2008-03-10 Thread Daniel Fetchinson
> > There are a number of free tools for image matching but it's not very > > easy to decipher the actual algorithm from the code that includes db > > management, GUI, etc, etc. I have my own image database and GUI so all > > I need is the actual algorithm preferably in pseudo code and not in > > t

Re: image matching algorithms

2008-03-10 Thread Daniel Fetchinson
> >>> There are a number of free tools for image matching but it's not very > >>> easy to decipher the actual algorithm from the code that includes db > >>> management, GUI, etc, etc. I have my own image database and GUI so all > >>> I need is the actual algorithm preferably in pseudo code and not

Re: image matching algorithms

2008-03-10 Thread Daniel Fetchinson
a multiresolution querying algorithm and best of all, it has pseudo code for the various steps. I don't know yet how difficult the implementation will be but so far this looks the most promising. Cheers, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: image matching algorithms

2008-03-11 Thread Daniel Fetchinson
> The second thing I'll try (after trying > your suggestion) is based on this paper which I found in the meantime: > http://salesin.cs.washington.edu/abstracts.html#MultiresQuery > In case anyone is interested, it describes a multiresolution querying > algorithm and best of all, it has pseudo code

Re: image matching algorithms

2008-03-12 Thread Daniel Fetchinson
> > Thanks for the info! SIFT really looks like a heavy weight solution, > > but do you think the whole concept can be simplified if all I needed > > was: given a photo, find similar ones? I mean SIFT first detects > > objects on the image and find similarities, but I don't need the > > detection p

Re: image matching algorithms

2008-03-12 Thread Daniel Fetchinson
e database for similar photos. There is even a python implementation for it here: http://members.tripod.com/~edcjones/pycode.html On the histogram method I agree that it won't work partly because of what you say and partly because it is terribly slow since it's comparing every single pixel. Thanks, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: image matching algorithms

2008-03-13 Thread Daniel Fetchinson
> > Since you seem to know quite a bit about this topic, what is your > > opinion on the apparently 'generic' algorithm described here: > > http://grail.cs.washington.edu/projects/query/ ? > > So far it seems to me that it does what I'm asking for, it does even > > more because it can take a hand d

Re: First Program Bug (Newbie)

2008-03-17 Thread Daniel Fetchinson
> P.S. What is the chance I'll get spam for using my real email address? Exactly 1. > I currently don't get any so... ... you will get now. Sorry to disappoint you, but it's better to be prepared in advance than be shocked later :) Cheers, Daniel -- http://mail.python

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

2008-03-20 Thread Daniel Fetchinson
eople have. Sure, for fancy GUI stuff there are better options but for quick and simple things tkinter is just great. And last time I checked python comes with batteries included so why sould I need to search and download a third party package for such a common use case? Thoughts anyone? Chee

pep 3108

2008-03-20 Thread Daniel Fetchinson
are they willing to do it? are they able to do it? do they think it's a hassle?). I've brought up the issue on c.l.p and people seem to agree, please see the thread for additional detail: http://tinyurl.com/2v4mh3 Cheers, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: python3.0 MySQLdb

2009-01-12 Thread Daniel Fetchinson
> I need something to connect to a database, preferably mysql, that > works in python3.0 please. And your question is? -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: python3.0 MySQLdb

2009-01-13 Thread Daniel Fetchinson
P. Exactly. One could think about 3-4 different potentially useful answers to the OP but when one sees 3-4 immediately right after reading the post then probably there are a couple more still after some thinking. So if the OP specifies exactly what he/she wants, he/she will get more signal

Re: python3.0 MySQLdb

2009-01-14 Thread Daniel Fetchinson
u" > > So the final questions was, is there anything els on the menu besides > PostgreSQL, like MySql for example ? If not I will take PostgreSQL > please. The 3.x branch just as the 2.x branch contains bindings to sqlite. This you can use from day 1, the 3.0 release contains it. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: python3.0 MySQLdb

2009-01-14 Thread Daniel Fetchinson
> Daniel> Well, this actually is the case: MySql has not been ported. As > Daniel> far as I can see the mysql python module in general (meaning for > Daniel> the 2.x branch) is not as well maintained as some others and > Daniel> questions about windows vs. l

How do I say "two classes up in the inheritance chain" in python?

2009-01-26 Thread Daniel Fetchinson
uch a way that it works in both child1 and child2 and bypasses both parent1 and parent2. How would I do that? Notes: (1) of course child1 and child2 have all sorts of methods which are different, only meth is almost the same. (2) I can't modify the grandfather class. Cheers, Daniel -- Psss,

Re: How do I say "two classes up in the inheritance chain" in python?

2009-01-27 Thread Daniel Fetchinson
e solution is quite simple : just define it outside the class > statements, and adds it afterward: > > def do_something_children(self): > # code here > > class Child1(Parent1): > # code here > > Child1.do_something = do_something_children > > class Chi

Re: "Super()" confusion

2009-02-09 Thread Daniel Fetchinson
s still alive, it grew to be a mature internet meme like the dancing hamster or star wars kid :) See (among tons of other writings): http://mail.python.org/pipermail/python-dev/2005-January/thread.html Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: "Super()" confusion

2009-02-09 Thread Daniel Fetchinson
to learn to use super. It will certainly not be helpful to anyone trying to learn the usage of super. The person who wrote that essay is simply misunderstanding the concept, as has been explained countless times by the python dev team. Hence, it only increases confusion, adds to the noise and sprea

python-list

2009-02-09 Thread Daniel Zhou
python-list -- http://mail.python.org/mailman/listinfo/python-list

Re: "Super()" confusion

2009-02-10 Thread Daniel Fetchinson
On 2/9/09, Gabriel Genellina wrote: > En Mon, 09 Feb 2009 23:34:05 -0200, Daniel Fetchinson > escribió: > >>>>>> Hello. I've been scouring the web looking for something to clear up a >>>>>> little confusion about the use of "super()"

Re: "Super()" confusion

2009-02-10 Thread Daniel Fetchinson
> Consider whether you really need to use super(). > > http://fuhm.net/super-harmful/ Did you actually read that article, understood it, went through the tons of responses from python-dev team members, including Guido > > "Tons" of responses? This was mentioned already, bu

Re: "Super()" confusion

2009-02-10 Thread Daniel Fetchinson
t; and J.K.'s articles. Last time I checked (perhaps one or two years ago), > the "harmful" article was almost the only relevant source of info about > super(). > > [1] > http://groups.google.com/group/comp.lang.python/search?q=super+harmful&start=0&scoring=d&; > [2] http://www.google.com/search?q=python+super Okay, I think we converged to a common denominator. I agree with you that the documentation needs additions about super and I also agree with you that referring to both MS and JK articles is appropriate when a question about super comes up. It's good to have a discussion when views actually converge and not diverge at the end :) Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Easier to wrap C or C++ libraries?

2009-02-13 Thread Daniel Fetchinson
also be staightforward... Are there many pitfalls when > having to map C++'s notion of OO to Python? There is no question about it in my mind that wrapping C is easier. Reason being that python is written in C and not C++. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepr

Anyone heard of a good Voice Stress Analysis program

2008-11-25 Thread Daniel Folkes
Anyone heard of a good voice stress analysis program that was either: a) Written in python b) can be used by python? It would be a great help to me. Thanks, Dan Folkes http://danfolkes.com -- http://mail.python.org/mailman/listinfo/python-list

Re: RELEASED Python 3.0 final

2008-12-03 Thread Daniel Fetchinson
> [EMAIL PROTECTED] > Python 2.6/3.0 Release Manager > (on behalf of the entire python-dev team) uname -a Linux fetch 2.6.23.1-42.fc8 #1 SMP Tue Oct 30 13:18:33 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux tar xzvf Python-3.0.tgz cd Python-3.0 ./configure make Failed to find the necessary bits

Re: RELEASED Python 3.0 final

2008-12-03 Thread Daniel Fetchinson
; >> Linux fetch 2.6.23.1-42.fc8 #1 SMP Tue Oct 30 13:18:33 EDT 2007 x86_64 >> x86_64 x86_64 GNU/Linux >> >> tar xzvf Python-3.0.tgz >> cd Python-3.0 >> ./configure >> make >> >> Failed to find the necessary bits to build these modules: >> _tkinter

Re: RELEASED Python 3.0 final

2008-12-04 Thread Daniel Fetchinson
>> As you have probably guessed: nothing changed here. >> Also see:http://www.python.org/dev/peps/pep-0666/ > > What? Do you mean it's possible to mix tabs and spaces still? Why? Why not? Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown --

Guido's new method definition idea

2008-12-05 Thread Daniel Fetchinson
compatible, and can be evolved into a PEP with a reference implementation without too much effort." shows that the proposal is viable. I'd like this new way of defining methods, what do you guys think? Anyone ready for writing a PEP? Cheers, Daniel -- Psss, psss, put it down! -

Re: Guido's new method definition idea

2008-12-06 Thread Daniel Fetchinson
>> Hi folks, >> >> The story of the explicit self in method definitions has been >> discussed to death and we all know it will stay. However, Guido >> himself acknowledged that an alternative syntax makes perfect sense >> and having both (old and new) in a future version of python is a >> possibili

Re: Guido's new method definition idea

2008-12-06 Thread Daniel Fetchinson
> Bad idea having two ways to do this. Pick one or the other! Maybe only this alternative syntax for python 4000? -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido's new method definition idea

2008-12-06 Thread Daniel Fetchinson
>> Hi folks, >> >> The story of the explicit self in method definitions has been >> discussed to death and we all know it will stay. However, Guido >> himself acknowledged that an alternative syntax makes perfect sense >> and having both (old and new) in a future version of python is a >> possibili

Re: Guido's new method definition idea

2008-12-07 Thread Daniel Fetchinson
his context might be misconstrued as the class object and thus `def > self.foo` might be misunderstood (through the intuitive equivalence > you mention) as a defining a classmethod rather than an instance > method. This is actually a real counter argument, I think. Self, the instance, doesn't exist until it is created and certainly doesn't exist during class creation. So something like class C: def self.meth( arg ): return arg can be confusing since 'self' appears as if it was defined in the scope of C but clearly it isn't yet. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido's new method definition idea

2008-12-07 Thread Daniel Fetchinson
is having a less confusing >> situation for newbies > > Once again: how is adding "magical" syntax going to reduce confusion ? > >> (confusing the number of arguments to a method >> call). > > This is only confusing the first time. The correct solution to this > problem is IMHO to better document Python's object model, specially how > the descriptor protocol turns functions into methods. As I've said in another reply the argument that "def self.meth( arg )" is confusing because "self" doesn't exist in the current scope as an instance is convincing to me. So I no longer like the alternate syntax mentioned by Guido. Still, improved error messages would be desirable (concerning the number of arguments passed to an instance method). Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

html codes

2008-12-08 Thread Daniel Fetchinson
script library uses stuff like '%3A' for the ':' for example. The conversion is here: http://www.ascii.cl/htmlcodes.htm Is there a python package/module/whatever that does the conversion for me or do I have to write a little wrapper myself (and introduce bugs while doing so :))?

Re: html codes

2008-12-09 Thread Daniel Fetchinson
x27;L\xc3\xb6blich \xc3\xa4hnlich \xc3\xbcblich' >>>> print _ > Löblich ähnlich üblich > > If you care about the encoding you have to encode/decode explicitly: > >>>> urllib.quote(u"Löblich ähnlich üblich".encode("latin1")) > 'L%F6bli

Re: looking up function's doc in emacs

2008-12-10 Thread Daniel Fetchinson
-f functionName", and in php it's php.net/functionName. Both > of which i have a elisp command with a shortcut that let me jump to > the doc) Why can't you do the same with pydoc (the command line tool, ususally installed in /usr/local/bin/pydoc or somewhere else if python shipped w

Re: Mathematica 7 compares to other languages

2008-12-10 Thread Daniel Fetchinson
> for (int i=0; i il += in[i] * in[i]; > il = 1.0 / sqrt(il); > for (int i=0; i out[i] = il * in[i]; > > Try computing the Fourier transform of: > > 0.007 + 0.01 I, -0.002 - 0.0024 I Funniest thread ever! Actual real money changing hands, did this happen ever in a newsgroup? Xah Lee rulez! Xah Lee for president! (No kidding, I like the guy.) Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

why doesn't pop/clear call __delitem__ on a dict?

2008-12-10 Thread Daniel Fetchinson
print 'deleted' super( mydict, self ).__delitem__( key ) Why is this? There might other gotchas too I suppose. My intention is clear from the above, what other methods do I have to overload so that I get what I expect for all dict operations? Cheers, Daniel -- Psss, pss

Re: why doesn't pop/clear call __delitem__ on a dict?

2008-12-11 Thread Daniel Fetchinson
>> I just found out that if I want to have a custom dict it's not enough >> to overload __getitem__, __setitem__ and __delitem__ because, for >> example, pop and clear don't call __delitem__. I.e. an instance of the >> following will not print 'deleted' upon instance.pop( 'key' ): >> >> class mydic

1 or 1/0 doesn't raise an exception

2008-12-13 Thread Daniel Fetchinson
Is it a feature that 1 or 1/0 returns 1 and doesn't raise a ZeroDivisionError? If so, what's the rationale? -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: 1 or 1/0 doesn't raise an exception

2008-12-13 Thread Daniel Fetchinson
>> Is it a feature that >> >> 1 or 1/0 >> >> returns 1 and doesn't raise a ZeroDivisionError? If so, what's the >> rationale? > > Yes, it's a feature: > > http://en.wikipedia.org/wiki/Short-circuit_evaluation > > When you have "True or False", you know it's true by the time > you've got the first p

changing string encoding to different charset?

2008-12-14 Thread Daniel Woodhouse
Is it possible to re-encode a string to a different character set in python? To be more specific, I want to change a text file encoded in windows-1251 to UTF-8. I've tried using string.encode, but get the error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 0: ordinal not in

Re: something else instead of PIL?

2008-12-17 Thread Daniel Fetchinson
eventually. That's actually an interesting question. Does anybody know if PIL is being ported to 3.0? Are there such plans? Maybe even code? Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

PIL on 3.x?

2008-12-19 Thread Daniel Fetchinson
Does anyone know if PIL will be ported to the 3.x branch? Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: mod_python resources

2008-12-19 Thread Daniel Fetchinson
w.modpython.org/live/current/doc-html/pyapi-psp.html The spyce project you may also find helpful: http://spyce.sourceforge.net/ Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL on 3.x?

2008-12-20 Thread Daniel Fetchinson
m the answers too. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Are Django/Turbogears too specific?

2008-12-22 Thread Daniel Fetchinson
d has been for years while the 2.x branch is in beta but will be released soon as a stable, production version. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy-to-use Python GUI

2008-12-24 Thread Daniel Fetchinson
he GUI builder. Still, it's quite powerful, since it supports all the > common > GUI elements (text, group boxes, checkboxes, drop-down lists, text boxes, > buttons, etc.). This is about the level of sophistication I'm looking for. > > Anything like this for Python? How about the Tcl/Tk GUI that comes bundled with python? http://docs.python.org/library/tk.html Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

C API: array of floats/ints from python to C and back

2008-12-27 Thread Daniel Fetchinson
s is a frequent operation I'd think there are some shortcuts, aren't there? Or what's the simplest way of doing this? Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: C API: array of floats/ints from python to C and back

2008-12-27 Thread Daniel Fetchinson
ys that would be too slow using array.array and numpy.array (I've verified this claim by benchmarking a numpy.array based solution). > I'd just use numpy, myself: > import numpy > total = numpy.array([1, 2, 3]) + numpy.array([2, 3, 4]) What makes you think I want to add two arr

Re: C API: array of floats/ints from python to C and back

2008-12-27 Thread Daniel Fetchinson
to an array.array and passing that to the C function doesn't make any difference in terms of speed since the operation itself will be done in the C function anyway. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: C API: array of floats/ints from python to C and back

2008-12-27 Thread Daniel Fetchinson
y.array to C anyway I don't see any advantage to (1) although (2) can be useful. Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: C API: array of floats/ints from python to C and back

2008-12-27 Thread Daniel Fetchinson
On 12/27/08, Robert Kern wrote: > Daniel Fetchinson wrote: > >> I agree that array.array is more efficient than a list but the input >> for my function will come from PIL and PIL returns a list. So I have a >> list to begin with which will be passed to the C function. >

Re: C API: array of floats/ints from python to C and back

2008-12-27 Thread Daniel Fetchinson
nd PyErr_Occurred() > is true) > To fill the resulting tuple, use PyTuple_SET_ITEM instead. BTW, why return > a tuple and not a list? No particular reason, other than the fact that I won't need to modify these lists/tuples from python so whenever something will not change, I use a tuple because it's immutable. Or this is not a very good practice? There is no difference between lists and tuples in terms of speed I suppose (getitem, setitem, etc). Thanks a lot, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: C API: array of floats/ints from python to C and back

2008-12-27 Thread Daniel Fetchinson
must be an array of ints"); > goto fail; > } Yes, the dependency on numpy is my main concern. If it will help with my problem I don't mind the dependency actually, so I'll do more detailed benchmarks first. Thank you, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: C API: array of floats/ints from python to C and back

2008-12-27 Thread Daniel Fetchinson
and even easier - the C code gets a pointer to an array > of integers, as usual). I looked for this in the C API docs but couldn't find anything on how to make an array.array python object appear as a pointer to integers (or floats, etc) in C code. On http://docs.python.org/c-api/concrete.html#sequence-objects There is only list and tuple or maybe you mean byte array? That has only been introduced in python 2.6 and I'm working on 2.5. Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: C API: array of floats/ints from python to C and back

2008-12-27 Thread Daniel Fetchinson
e free to use whatever structure you > feel adequate. > > Once the list/tuple is created and filled, there is no speed difference > accessing the individual items. Creating an empty list that grows one > element at a time is slow for large lists (the memory block has to be > re-allocated and copied over evry time it gets full) but this doesn't > happen if you provide the final size when creating the list. All right, this is clear then too, I'll probably use a list. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: C API: array of floats/ints from python to C and back

2008-12-27 Thread Daniel Fetchinson
return NULL; > nitems = nbytes/sizeof(long); > for (i=0; i/* do something with vec[i] */ > } > return ret; > } > > From Python you can get "vec" and "nitems" using the buffer_info() method > of array objects. Thanks very much, this was very helpful! Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL on 3.x?

2008-12-31 Thread Daniel Fetchinson
> Does anyone know if PIL will be ported to the 3.x branch? Actually, Guilherme Polo has ported PIL 1.1.6 to python 3.0: http://mail.python.org/pipermail/image-sig/2008-December/005338.html Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- h

Upgrading from 2.5 to 2.6

2008-10-12 Thread Daniel Klein
Are there any guidelines for upgrading from 2.5 to 2.6? Do you have to uninstall 2.5, or does the installer do that for you? I have wxPython, mod_python and Django installed. Will these have to reinstalled/reconfigured for 2.6? Platform: Windows XP Pro SP3 Daniel Klein -- http

Re: How to Implement an XMLRPC Server in Python?

2008-10-29 Thread Daniel Fetchinson
rpcserver.html http://code.activestate.com/recipes/81549/ http://code.activestate.com/recipes/496786/ http://www.google.com/search?q=python+xmlrpc+server+example Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: What's your choice when handle complicated C structures.

2008-11-04 Thread Daniel Fetchinson
res. > > What will be your choice when handling binary structures? I would write a couple of wrapper functions around unpack of struct so that the actual unpacking is less annoying but otherwise would continue using the same approach as what you describe. Cheers, Daniel -- Psss, psss, put i

(Windows) "Dropping" stuff onto a Python script

2008-11-06 Thread daniel . haude
Hello people, I'd like to have the functionality known from "real" executables that if I drag-drop a file icon on top of the app, the app starts and has the file's path as command-line argument. However, this doesn't seem to work with Python scripts because Windows sees those just as files, not a

Re: Django or TurboGears or Pylons? for python web framework.

2008-11-07 Thread Daniel Fetchinson
t. For the javascript library I would strongly recommend extjs: http://extjs.com/ It makes javascript work VERY easy including event handling, GUI building, ajax calls, etc, etc. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-URL! - weekly Python news and links (Nov 17)

2008-11-19 Thread Daniel Fetchinson
n this thread :-), I posted my response as > a reply to your most recent message in the "Official > definition of call-by-value..." thread. > -- > http://mail.python.org/mailman/listinfo/python-list And this thread has a good chance of becoming the "Longest and

[mod_python] Knowing the encoding of the URI

2009-03-03 Thread Daniel Chiaramello
the is coded? Is there a better way to determine the encoding? I noticed the "content_encoding" member of the request, but it is always set to None... Thanks for your attention, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Dao, the official 1.0 version is released

2009-03-06 Thread Daniel Fetchinson
No need for any hatred or hostility towards people who write a new programming language, I bet many people on this list are interested in this kind of stuff. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Dao, the official 1.0 version is released

2009-03-06 Thread Daniel Fetchinson
r hostility towards people who write a new >> programming language, > > I did not see any such thing. The mild hostility was directed at the > act of blind spamming, which we have had more than enough of. Well, there are lots of OT postings but in my estimation those that men

Re: ANN: Dao, the official 1.0 version is released

2009-03-06 Thread Daniel Fetchinson
sion” out of the tent to avoid the whole > camel coming in. Are you seriously worried that c.l.p will be overtaken by zealous dao fans? Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

help with printing to stdout...

2009-03-08 Thread Daniel Dalton
removed and my new text added (talking about the one line of the screen here)... This is a command line program, under linux... Thanks, Daniel. -- http://mail.python.org/mailman/listinfo/python-list

Re: help with printing to stdout...

2009-03-08 Thread Daniel Dalton
> or like this: > > print '\r'+str(percent), > > Then make sure it gets sent out, like this: > > sys.stdout.flush() Hey! Thanks very much, that did the trick! Thanks to everyone that replied, I discovered converting to str was crutial to actually print anythin

Re: NEWB: dividing numbers

2009-03-08 Thread Daniel Dalton
x27;s called, this should work, and does just tested with the python interactive shell: 2.0/3 Cheers, Daniel. -- http://mail.python.org/mailman/listinfo/python-list

searching strings

2009-03-09 Thread Daniel Dalton
" j="ab" i in j should return true... How do I do this? Thanks, Daniel. -- http://mail.python.org/mailman/listinfo/python-list

Re: searching strings

2009-03-09 Thread Daniel Dalton
On Mon, Mar 09, 2009 at 06:24:24PM -0700, Chris Rebert wrote: > Normalize the case of the strings: > > i.lower() in j.lower() Too easy, thanks very much! Cheers, Daniel. -- http://mail.python.org/mailman/listinfo/python-list

Why is lambda allowed as a key in a dict?

2009-03-09 Thread Daniel Fetchinson
Traceback (most recent call last): File "", line 1, in KeyError: at 0x2abaab18> Is this a case of "we are all adults here"? I should only blame myself for making an unnamed function a dictionary key or should it be forbidden? Or am I missing something completely?

Re: Why is lambda allowed as a key in a dict?

2009-03-09 Thread Daniel Fetchinson
On 3/9/09, bearophileh...@lycos.com wrote: > See here Daniel Fetchinson: > > http://groups.google.com/group/comp.lang.python/browse_thread/thread/a973de8f3562675c > > But be quite careful in using that stuff, it has some traps. Thanks a lot for all the helpful replies! Yes, I

Re: Invalid syntax with print "Hello World"

2009-03-12 Thread Daniel Fetchinson
t; Can someone explain my mistake? Are you using python 3.0? In this case please see: http://docs.python.org/3.0/whatsnew/3.0.html#print-is-a-function HTH, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: unbiased benchmark

2009-03-12 Thread Daniel Fetchinson
> Dear sir, > > I would like to share a benchmark I did. The computer used was a > 2160MHz Intel Core Duo w/ 2000MB of 667MHz DDR2 SDRAM running MAC OS > 10.5.6 and a lots of software running (a typical developer > workstation). > > Python benchmark: > HAMBURGUESA:benchmark sam$ echo 1+1 > bench.py

Quadratic equation

2009-03-13 Thread Daniel Sidorowicz
main(): print "\n\n" print "Daniel Sidorowicz \n", "325 \n", "MCS 260, Spring 2009 \n", "mp1id325" print "For instructions open file named README" print "E

Re: Get pixel colors from images in Python 3

2009-03-13 Thread Daniel Fetchinson
ere I was told that some work already has started on porting PIL to python 3. I'm guessing if you ask again at least it will be viewed as a +1 vote on the project and that will probably not hurt :) Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: how to repeat function definitions less

2009-03-14 Thread Daniel Neuhäuser
I would suggest using functools.partial like this from functools import partial class Foo(object): #... red = partial(color='red') -- http://mail.python.org/mailman/listinfo/python-list

Re: Disable automatic interning

2009-03-18 Thread Daniel Fetchinson
ay the string 'x' then you surely consider this an error anyway, don't you? What's the point of identifying two different nodes by the same string? If you use different strings (or numbers, even small ones) for different nodes the whole problem will not arise. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

<    7   8   9   10   11   12   13   14   15   16   >