Re: setuptools without unexpected downloads

2007-09-26 Thread Diez B. Roggisch
> I think most of the evolution has been in the surrounding tools, > although stuff like the new Debian Python policy could be complicating > factors. But I don't think the dependency stuff has changed that much > over the years. It might be, yet one thing is for sure: there have been various time

Re: Test-driven development and code size

2007-09-26 Thread Diez B. Roggisch
Joel Hedlund wrote: >> test-driven development merely means that you take that test case and >> *keep it* in your unit test. Then, once you're assured that you will >> find the bug again any time it reappears, go ahead and fix it. > > My presumption has been that in order to do proper test-driven

Re: Packaging and dependencies

2007-09-26 Thread Diez B. Roggisch
> Agreed, but until we reach the ideal situation where everybody is using > the same package dependency system what's your practical solution? > "Self-contained" has the merit that nobody else's changes are going to > bugger about with my application on a customer's system. The extra disk > space i

Re: "No backend servers available" using httplib

2007-09-27 Thread Diez B. Roggisch
Henrik Lied wrote: > On Sep 27, 11:56 am, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: >> Henrik Lied a écrit : >> >> > Hi there! >> >> > I'm using a recipe found on ASPN [1] to upload some data to an >> > external server. >> >> > The request fails, and all I get in response is "No backend serve

Re: Confusion regarding constructor as default value

2007-09-27 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Why are the following different? > > def AddRow(self, rowName, tableRow=TableRow(ReleaseDate(""), > ExpiryDate(""))): > # check to see if the row already exists, if not add it to the > container > > if not self.dict.has_key(rowName): > self.dict[rowName] = tableRow >

Re: Implement file download using python

2007-09-27 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hello, > > I want to implement file downloads inside an authenticated web page, > such that when a user clicks a link, the server side python code > connects to a ftp server, downloads a relevant file and then streams > the file to the browser for the user to open it w

Re: Python 3.0 migration plans?

2007-09-28 Thread Diez B. Roggisch
TheFlyingDutchman schrieb: >> - Abstract Base Classes >> http://www.python.org/dev/peps/pep-3119/> >> > > I like how someone here characterized decorators - those silly @ > things. They remind me of Perl. Not adding keywords for abstract and > static is like Perl not adding a keyword for cla

Re: Python 3.0 migration plans?

2007-09-28 Thread Diez B. Roggisch
> You said it was a most basic language feature. I still haven't heard > anything that leads me to believe that statement is correct. What > languages implemented decorators as a most basic language feature? I was talking about Python, the programming language that is discussed in this NG. > Pyt

Re: Python 3.0 migration plans?

2007-09-28 Thread Diez B. Roggisch
TheFlyingDutchman wrote: > >> >> The fact that you compare and criticise the simple annotations like >> static or abstract with the much more powerful decorator concept shows >> that, despite being the maintainer of a >> soon-to-be-ruling-the-python-world Python 3 fork, lack understanding of >> e

Re: Python 3.0 migration plans?

2007-09-28 Thread Diez B. Roggisch
Paul Rubin wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: >> All serious languages are turing-complete. So can we put away with this >> non-sense argument right away, please? > > Actually the so called "total" languages aren't Turi

Re: Python 3.0 migration plans?

2007-09-28 Thread Diez B. Roggisch
TheFlyingDutchman wrote: > On Sep 28, 11:16 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> On Fri, 28 Sep 2007 11:04:39 -0700, TheFlyingDutchman <[EMAIL PROTECTED]> >> wrote: >> > [snip] >> >> >In this case I asked it as part of the original question and it was >> >ignored. I have programme

Re: C Source Code Generator For Test Cases

2007-09-28 Thread Diez B. Roggisch
gamename wrote: > Hi, > > Can anyone recommend a good method of using python to generate c > source code? I have tables of test cases to use as input to a > process which would generate the test's source code. The Cheetah tool > looks interesting. Has anyone used it? Any other suggestions? H

Re: Python 3.0 migration plans?

2007-09-28 Thread Diez B. Roggisch
TheFlyingDutchman wrote: > >> >> Or bind resources of these pocket protectors that otherwise would lead to >> answers for people that do seek enlightment... > > I don't think it would be correct to characterize my posts as not > seeking enlightenment. I do also happen to voice my opinion which >

Re: How popular is Django ?

2007-10-01 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi! > > I was surprised when I did a google-groups search for python, > ( > http://groups.google.com/groups/search?q=python&qt_s=Search+Groups > ) > it shows these groups: > comp.lang.python with about 11000 users, > and second, > Django users > Discussion group for D

Re: Select as dictionary...

2007-10-01 Thread Diez B. Roggisch
Abandoned wrote: > Also if i need a list id what can i do ? > > aia.execute("SELECT id, w from list") > links=aia.fetchall() > > I want to.. > > idlist=[1, 2, 3] ( I don't want to use FOR and APPEND because the > query have 2 million result and i want to speed) It will always return a list of

Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-02 Thread Diez B. Roggisch
> Maybe a better question is, how has Tk managed to keep beating up the > newer, more modern, more featureful, better documented toolkits > encroaching on his territory? What's Tk's secret weapon? There is no secret weapon. It's a question about dependencies, maintenance, stability and supported p

Re: Inheriting from int or long

2007-10-02 Thread Diez B. Roggisch
x >>= 1 > return s > > My thought was this will act like a Long, and so should act like an > array of bits with arbitrary precision, supporting the standard > bitwise operations, along with others I may add. > >>>> import bits >>>>

Re: I earn $36800 a month with google adsense

2007-10-02 Thread Diez B. Roggisch
> > Wow ! I have a question though. > > If you really make $38600 a month, how come you even bother to spam > us? Please, don't reply - and especially, don't reply quoting the spammer's site, so his page-rank inncreases... diez -- http://mail.python.org/mailman/listinfo/python-list

Re: enumerate overflow

2007-10-03 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Hello all, > > in python2.4, i read lines from a file with > > for lineNum, line in enumerate(f): ... > > However, lineNum soon overflows and starts counting backwards. How do > i force enumerate to return long integer? Most probably you can't, because it is a C-wri

Re: A total bullshit (was : A Must Read!!!)

2007-10-03 Thread Diez B. Roggisch
Bruno Desthuilliers schrieb: > [EMAIL PROTECTED] a écrit : >> I have found an excellent resource on Object Oriented Programming. >> >> > (url snipped to protect the innocents) > > Let's see: > > "An object has methods, properties and events." > > Hem... > > "oriented programming probably existe

Re: Is there a nicer way to do this?

2007-10-04 Thread Victor B. Gonzalez
he dictionary is unnecessary but I may be wrong. anyhow, I keep getting "SyntaxError: Non-ASCII character '\xc2'..." on line 5. anyone know what this is? I couldn't run the script but from looking at it, it appears you're making some pointless keys when indexes may b

Re: WebBased Vector 2D Graphics

2007-10-05 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi there > > I currently have a Python program outputing to the command line, > durations of 'completed Steps' and 'data items' in relation to time > i.e. > > > --jfh > -kl//kl started after jfh finished > % D

Re: "SyntaxError: Non-ASCII character '\xc2'...", was Re: Is there a nicer way to do this?

2007-10-05 Thread Victor B. Gonzalez
On Friday 05 October 2007 3:33:43 am Peter Otten wrote: > Victor B. Gonzalez wrote: > > anyhow, I keep getting "SyntaxError: Non-ASCII character '\xc2'..." on > > line 5. anyone know what this is? > > I too had that problem with KNode. Leading space consist

Re: picture filter

2007-10-05 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > hii my friends > ı want to a filter for porn picture > if you know , please help me :S:S > how do ı separate porn form not porn > I don't want my web site porn;) > (my english bad I hope understant it. very very thans ) If anybody know how to do that, he or she would

Re: Starting a thread before wxPython bootup ... interesting.

2007-10-05 Thread Diez B. Roggisch
> > The real goal is to start the gui in a different thread, and have the > main thread regain control. That seems like a feasible thing to be > able to do, though I have been unsuccessful ... if anyone would like > to suggest something without being covertly insulting, I'm all ears. AFAIK some t

Re: ANN: Pyrex 0.9.6

2007-10-07 Thread Diez B. Roggisch
Colin J. Williams schrieb: > Greg Ewing wrote: >> Pyrex 0.9.6 is now available: >> >>http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/ >> >> There is a *lot* of new stuff in this version, too much >> to fit into this announcement. Read all about it here: >> >> >> http://www.cosc.canterbu

Re: Override 'and' and 'or'

2007-10-07 Thread Diez B. Roggisch
Kay Schluehr schrieb: > On Oct 7, 4:48 pm, Dekker <[EMAIL PROTECTED]> wrote: >> On 7 Okt., 16:19, Steven D'Aprano <[EMAIL PROTECTED] >> >> cybersource.com.au> wrote: >>> On Sun, 07 Oct 2007 13:52:15 +, Dekker wrote: Is it possible to override 'and' and/or 'or'? >>> Not without hacking the

Re: pytz has so many timezones!

2007-10-08 Thread Diez B. Roggisch
Sanjay wrote: > Hi All, > > I am using pytz.common_timezones to populate the timezone combo box of > some user registration form. But as it has so many timezones (around > 400), it is a bit confusing to the users. Is there a smaller and more > practical set? If not, some suggestions on how to han

Re: Pil image module, "mode" bug..

2007-10-08 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > On Oct 7, 8:17 pm, Michal Bozon <[EMAIL PROTECTED]> wrote: >> On Sun, 07 Oct 2007 09:02:09 -0700, Abandoned wrote: >> > On Oct 7, 4:47 pm, Michal Bozon <[EMAIL PROTECTED]> wrote: >> >> On Sun, 07 Oct 2007 06:03:06 -0700, Abandoned wrote: >> >> > Hi.. >> >> > I find the p

Re: Don't use __slots__ (was Re: Problem of Readability of Python)

2007-10-08 Thread Diez B. Roggisch
Steven D'Aprano wrote: > On Sun, 07 Oct 2007 21:27:31 -0700, Aahz wrote: > >> In article <[EMAIL PROTECTED]>, Steven >> Bethard <[EMAIL PROTECTED]> wrote: >>> >>>You can use __slots__ [...] >> >> Aaaugh! Don't use __slots__! >> >> Seriously, __slots__ are for wizards writing applications wit

Re: Don't use __slots__ (was Re: Problem of Readability of Python)

2007-10-08 Thread Diez B. Roggisch
Steven D'Aprano wrote: > On Mon, 08 Oct 2007 15:15:36 +0200, Diez B. Roggisch wrote: > >>> Well, I've read the thread, and I've read the thread it links to, and >>> for the life of me I'm still no clearer as to why __slots__ shouldn't >&

Re: Variable scoping rules in Python?

2007-10-08 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Ok, I'm relatively new to Python (coming from C, C++ and Java). I'm > working on a program that outputs text that may be arbitrarily long, > but should still line up, so I want to split the output on a specific > column boundary. Since I might want to change the lengt

Re: Really basic problem

2007-10-08 Thread Diez B. Roggisch
Zentrader wrote: > You can use Python's decimal class if floating point arithmetic is not > exact enough This is a misleading statement. While it's true that decimal can be more precise in the sense that smaller fractions are representable, the underlying problem of certain values not being repre

Re: Convert obejct string repr to actual object

2007-10-08 Thread Diez B. Roggisch
Tor Erik Sønvisen schrieb: > Hi, > > I've tried locating some code that can recreate an object from it's > string representation... > The object in question is really a dictionary containing other > dictionaries, lists, unicode strings, floats, ints, None, and > booleans. > > I don't want to use

Re: Accessing 'Package Data'

2007-10-09 Thread Diez B. Roggisch
Stefan Arentz wrote: > > At http://docs.python.org/dist/node12.html it is described how to add > package data to a module. This was pretty easy to do, but now how do I > access this data from my module? Is there an API to load a 'package > resource' ala Java's classloader? You can always use os.

Re: how to get rgbdata

2007-10-09 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi i am a newbie to python and PIL. can anyone tell me how to get > rgbdata from a jpeg image using PIL > as a double[] . is there an equiv method to java's > BufferedImage.getRGB(0,0,width,height,rgbdata,0,width) ? The docs of PIL are quite good. And there you find th

Re: The fundamental concept of continuations

2007-10-09 Thread Diez B. Roggisch
Tim Bradshaw wrote: > On Oct 9, 7:34 am, [EMAIL PROTECTED] wrote: > >> which lambda paper ? > > Are you Ilias? I think you probably are. He certainly isn't, but you are right that he smells like he's been living under a bridge for quite a time... Diez -- http://mail.python.org/mailman/listin

Re: Python and UML

2007-10-09 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi, > > I'm working with Python2.5 and pythonWin. > > I'd like to start working with and learning more with UML. Can anyone > suggest any freeware design software that I might use to do this? I > also have > Visio installed on my computer if thats of any use... ArgoU

Re: Python and UML

2007-10-09 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > On 9 Okt, 12:15, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >> > Hi, >> >> > I'm working with Python2.5 and pythonWin. >> >> > I'd like to start working wi

Re: pytz has so many timezones!

2007-10-09 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > On Oct 8, 1:03 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: >> On Mon, 2007-10-08 at 10:41 -0700, [EMAIL PROTECTED] wrote: >> > For example, Windows has seperate listings for >> >> > Central America >> > Central Time (US & Canada) >> > Guadalahara, Mexico City, Monterry

Re: Problem with argument parsing

2007-10-09 Thread Diez B. Roggisch
lgwe wrote: > I have a python-script: myscript, used to start a program on another > computer and I use OptionParser in optpars. > I use it like this: myscript -H host arg1 -x -y zzz > I would like OptionParser to ignore all arguments after arg1, because > these are options that should be used by

Re: Native class methods

2007-10-09 Thread Diez B. Roggisch
Stefan Arentz wrote: > > Is there an easy way to implement a specific method of a Python class > in C? Like a native method in Java? I would really like to do the > majority of my class code in Python and just do one or two methods > in C. ctypes or subclassing C-implemented classes. Diez -- h

Re: Static variable vs Class variable

2007-10-09 Thread Diez B. Roggisch
return "__add__" def __iadd__(self, o): return "__iadd__" a = Foo() a += 1 print a a = Foo() b = Foo() c = a + b print c So you see, the first += overrides a with the returned value of __iadd__. The reason for the difference though is most probably wh

Re: Static variable vs Class variable

2007-10-09 Thread Diez B. Roggisch
Steven D'Aprano schrieb: > On Tue, 09 Oct 2007 19:23:37 +0200, Diez B. Roggisch wrote: > >> Your believes aside, this is simply wrong. The statement >> >> a += x >> >> always leads to a rebinding of a to the result of the operation +. > >

Re: pytz has so many timezones!

2007-10-09 Thread Diez B. Roggisch
>> who says that timezones have to be separated by one hour each? > > The Earth says. It takes 24 hours to revolve. Wrong >> Why aren't they separated by 30minutes, or 20, or 10? Or 2 hours? > > Why isn't an hour defined to be 30 minutes? > >> Or why don't we have a global time? > > Like UTC?

Re: pytz has so many timezones!

2007-10-09 Thread Diez B. Roggisch
>> who says that timezones have to be separated by one hour each? > > The Earth says. It takes 24 hours to revolve. Your kidding me, aren't you? Beside the fact that the earth does not revolve in 24h (leap seconds, if you like to google), even the 24 hours of a day are as arbitrary as you prefe

Re: Unexpected behaviour with HTMLParser...

2007-10-09 Thread Diez B. Roggisch
Just Another Victim of the Ambient Morality schrieb: > HTMLParser is behaving in, what I find to be, strange ways and I would > like to better understand what it is doing and why. > > First, it doesn't appear to translate HTML escape characters. I don't > know the actual terminology but

Re: Unexpected behaviour with HTMLParser...

2007-10-09 Thread Diez B. Roggisch
Just Another Victim of the Ambient Morality schrieb: > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Just Another Victim of the Ambient Morality schrieb: >>> HTMLParser is behaving in, what I find to be, strange

Re: Static variable vs Class variable

2007-10-09 Thread Diez B. Roggisch
to the > result of the operation +". The + operator for lists creates a new list. > += for lists does an in-place modification: It still is true. a += b rebinds a. Period. Which is the _essential_ thing in my post, because this rebinding semantics are what confused the OP. >>&

Re: Static variable vs Class variable

2007-10-09 Thread Diez B. Roggisch
Diez B. Roggisch schrieb: >>> Yes, it is. >> >> I'm afraid not. >> >> As I admitted in my reply to Marc, I overstated my case by saying that >> L isn't rebound at all. Of course it is rebound, but to itself. >> >> However, it is not tru

Re: Problem with argument parsing

2007-10-10 Thread Diez B. Roggisch
lgwe wrote: > On 9 Okt, 17:18, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> lgwe wrote: >> > I have a python-script: myscript, used to start a program on another >> > computer and I use OptionParser in optpars. >> > I use it like thi

Re: Singleton

2007-10-10 Thread Diez B. Roggisch
Steven D'Aprano wrote: > On Wed, 10 Oct 2007 06:57:15 -0700, Carl Banks wrote: > >> On Oct 10, 9:39 am, Steven D'Aprano <[EMAIL PROTECTED] >> cybersource.com.au> wrote: >>> On Wed, 10 Oct 2007 09:36:56 +, pythoncurious wrote: >>> > So how do people solve this? Is there an obvious way that I m

Re: Building Binary Packages

2007-10-10 Thread Jim B. Wilson
On Wed, 10 Oct 2007 14:35:35 +, kyosohma wrote: > I am trying to figure out how to build binaries for Python packages and > I've done it with MinGW. Apparently, you still can: http://tinyurl.com/yb4bps -- http://mail.python.org/mailman/listinfo/python-list

Re: RMI with Pyro et al

2007-10-10 Thread Diez B. Roggisch
Sells, Fred schrieb: > I need a simple client/server architecture with clients on linux and servers > on windows. There is no UI in this part, just business rules and access > control. > > Pyro seems pretty cool for this due to it's simplicity. I'm just starting > with it and have not been ab

Re: PYTHONPATH on OS X

2007-10-10 Thread Diez B. Roggisch
mhearne808[insert-at-sign-here]gmail[insert-dot-here]com schrieb: > I'm missing something major here. I'm trying to add a directory to my > python path using the PYTHONPATH environment variable, and it's being > ignored by the Python interactive shell. > > Below is a capture of what I did. Note

Re: "".join(string_generator()) fails to be magic

2007-10-11 Thread Diez B. Roggisch
Matt Mackal schrieb: > I have an application that occassionally is called upon to process > strings that are a substantial portion of the size of memory. For > various reasons, the resultant strings must fit completely in RAM. > Occassionally, I need to join some large strings to build some even >

Re: Accessing Function Variables from Sub-functions

2007-10-11 Thread Diez B. Roggisch
Licheng Fang wrote: > On Apr 14 2003, 10:30 pm, Alex Martelli <[EMAIL PROTECTED]> wrote: >> Sebastian Wilhelmi wrote: >> > Hi, >> >> > I would like to do the following: >> >> > ---8<---8<---8<---8<--- >> > def test (): >> > count = 0 >> > def inc_count (): >> >

RE: RMI with Pyro et al

2007-10-11 Thread Diez B. Roggisch
Sells, Fred wrote: > Diez B. Roggisch wrote > . Why do you want that (hot deploy) >> anyway? Does startuptime of a script really bother you? >> shouldn't take >> more than a few seconds. > > My primary need is development/debug. I'm a Pyro newbie and I

Re: Python module for making Quicktime or mpeg movies from images

2007-10-11 Thread Diez B. Roggisch
jeremito wrote: > My Python script makes a bunch of images that I want to use as frames > in a movie. I've tried searching for a module that will take these > images and put them together in a Quicktime or mpeg movie, but haven't > found anything. My images are currently pdfs, but I could make t

Re: Finding Peoples' Names in Files

2007-10-11 Thread Diez B. Roggisch
brad wrote: > [EMAIL PROTECTED] wrote: >> On Oct 11, 5:22 pm, brad <[EMAIL PROTECTED]> wrote: >>> Crazy question, but has anyone attempted this or seen Python code that >>> does? For example, if a text file contained 'Guido' and or 'Robert' and >>> or 'Susan', then we should return True, otherwise

Re: RMI with Pyro et al

2007-10-12 Thread Diez B. Roggisch
Irmen de Jong schrieb: > Diez B. Roggisch wrote: > >> Go install cygwin (but not it's included python-interpreter, or at least >> make sure you have your python path properly under control) and then >> simply >> start the script from the command-line. And

Re: Last iteration?

2007-10-12 Thread Diez B. Roggisch
Florian Lindner wrote: > Hello, > can I determine somehow if the iteration on a list of values is the last > iteration? > > Example: > > for i in [1, 2, 3]: >if last_iteration: > print i*i >else: > print i > > that would print > > 1 > 2 > 9 > > > Can this be acomplished s

Re: Problem with MySQL cursor

2007-10-12 Thread Diez B. Roggisch
Florian Lindner wrote: > Carsten Haese wrote: > >> On Thu, 2007-10-11 at 15:14 +0200, Florian Lindner wrote: >>> Hello, >>> I have a function that executes a SQL statement with MySQLdb: >>> >>> def executeSQL(sql, *args): >>> print sql % args >>> cursor = conn.cursor() >>> cursor.ex

Re: Python module for making Quicktime or mpeg movies from images

2007-10-13 Thread Diez B. Roggisch
>- The Mac version of Python includes wrappers for a number of Carbon > APIs, including QuickTime. One for brave souls only; QT's C APIs are > notoriously complex, AMEN. I tried to work with that stuff, and it was close to a totally failure & desaster... Diez -- http://mail.python.org/mailman/

Re: how to create a pointer, or is there a better solution ?

2007-10-13 Thread Diez B. Roggisch
stef mientki schrieb: > hello, > > I've a program where users can make modules, > by just dumping them in a certain directory, > then they will dynamically link into the program if needed. > > One of the communication channels I use, > is a general global file, which should be imported by all use

Re: email libraries and threads

2007-10-13 Thread Diez B. Roggisch
rodmc schrieb: > Hi, > > I am writing a threaded application, part of which relies on sending > messages to users. However I cannot get the smtplib and some other > email related libraries to work inside threads (they work ok when not > in threads). Is there a problem with using threads and email?

Re: Cross-platform GUI development

2007-10-13 Thread Diez B. Roggisch
David Tremouilles schrieb: > No issue with pygtk on mac! > Actually I develop on this platform everyday. Macport take care of the > installation for me http://www.macports.org/ (Fink should do the work > too). > Of course native GTK on OSX could be nice but definitely not needed at > this point in

Re: Declarative properties

2007-10-13 Thread Diez B. Roggisch
Dan Stromberg schrieb: > On Thu, 11 Oct 2007 18:42:16 +, Marc 'BlackJack' Rintsch wrote: > > >>> The "baggage" of possibly fixing (AKA "generalizing") how your attributes >>> are accessed is something you lug around while your deadline looms. >> Sorry I don't get it. If I want to customize t

Re: Entering username & password automatically using urllib.urlopen

2007-10-14 Thread Diez B. Roggisch
rodrigo schrieb: > I am trying to retrieve a password protected page using: > > get = urllib.urlopen('http://password.protected.url";').read() > > While doing this interactively, I'm asked for the username, then the > password at the terminal. > Is there any way to do this non-interactively? To

Re: Last iteration?

2007-10-14 Thread Diez B. Roggisch
Peter Otten schrieb: > Diez B. Roggisch wrote: > >> Florian Lindner wrote: > >>> can I determine somehow if the iteration on a list of values is the >>> last iteration? > >> def last_iter(iterable): >> it = iter(iterable

Re: pydev code completion problem

2007-10-14 Thread Diez B. Roggisch
gt; Thank you for replay, but I'm still not sure what to think about it... > Marc 'BlackJack' Rintsch in his replay to my post says that it would be to > complicated for IDE to keep track of all objects... isn't he right? He is right. What would you expect from this piece

Re: Newbi Q: Recursively reverse lists but NOT strings?

2007-10-14 Thread Victor B. Gonzalez
be wrong but from a quick glance you'll need to end it for sure when dealing with recursion. maybe also trying to reverse using the iterator function reversed() or this shortcut may help e.g, 'abc'[::-1] -> 'cba'. good luck! -- Best Regards Victor B. Gonzalez -- http://mail.python.org/mailman/listinfo/python-list

Re: Twisted (or for loops ?) madness

2007-10-15 Thread Diez B. Roggisch
looping wrote: > On Oct 15, 9:46 am, looping <[EMAIL PROTECTED]> wrote: >> l = [ct1, ct2, ct3] >> for c in l: >> d.addCallback(lambda result: c.compile()) >> >> reactor.callLater(20, reactor.stop) >> reactor.run() >> >> Output: >> >> Compile : *OBJECT 1* >> <__main__.CompilerThread object at 0

Re: Cross-platform GUI development

2007-10-15 Thread Diez B. Roggisch
David Tremouilles wrote: > "crappy", "waaay better" > I will not feed the troll... > Pygtk on mac just do the work for me on a more than satisfying way. I should have worded more carefully, it wasn't intended as trolling. Sorry for that. But the point I wanted to make still stands - the native

Re: View XMLRPC Requests/Responses?

2007-10-15 Thread Diez B. Roggisch
xkenneth wrote: > Hi, > > I'm working on developing an XML-RPC interface from LabVIEW to > python and I would really like to see how python is forming it's XML- > RPC requests/responses. Is there any way I can force these to a log or > print them to the screen? Thanks. I've utilized the apac

Re: A Python way to get MS Access table column information?

2007-10-15 Thread Diez B. Roggisch
goldtech wrote: > Using Python and OBDC in MS-Access DBs. So, I'm able to run SQL > statements from Python on an Access DB. > > Is there an SQL statement that will give me column information? For a > table I want to know the data type and of course colum/Attribute name > for each column. > > So

Python's coming... from unexpected angles.

2007-10-16 Thread Diez B. Roggisch
Just found this: http://feeds.feedburner.com/~r/boingboing/iBag/~3/170523979/french-lady-finds-py.html I do believe that Python should be somewhat more upfront to brandish it's merits - but then, sneaky ways are ok with me to... Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: confused on calculating date difference in days.

2007-10-16 Thread Diez B. Roggisch
krishnakant Mane wrote: > hello, > thanks all of you for providing valuable help. > right now I am confused about the delta object. > how can I extract the difference between two dates in terms of day > using the delta object? > I tried reading the python docs but did not understand the concept of

Re: best way of dealing with currency?

2007-10-16 Thread Diez B. Roggisch
Paul Miller schrieb: > I'm looking at doing some currency calculations in some Python code > integrated with a C++ application. I want to be able to come up with the > same values I get in an Excel spreadsheet. > > I've been poking around for a couple of days and haven't come across a > definit

Re: Dynamic and lazy import

2007-10-17 Thread Diez B. Roggisch
between a version and an other, there isn't > always a very good backward compatibility (I know, it's very ugly, but > it's like that...). > > Moreover some library use the version 1.1 and some the version 1.2 of > lib A and version 2.1 and version 2.0 of lib B ... yo

Re: Order by value in dictionary

2007-10-17 Thread Diez B. Roggisch
Abandoned wrote: > Hi.. > I have a dictionary like these: > a={'a': '1000', 'b': '18000', 'c':'40', 'd': '600'} .. 100.000 > element > I want to sort this by value and i want to first 100 eleme

Re: Order by value in dictionary

2007-10-17 Thread Diez B. Roggisch
Diez B. Roggisch wrote: > Abandoned wrote: > >> Hi.. >> I have a dictionary like these: >> a={'a': '1000', 'b': '18000', 'c':'40', 'd': '600'} .. 100.000 >> element >> I want

Re: Write by logging.FileHandler to one file by many processess

2007-10-17 Thread Diez B. Roggisch
Alexandre Badez wrote: > On Oct 17, 3:33 pm, Rafa Zawadzki <[EMAIL PROTECTED]> wrote: >> Hello. >> >> As I saw in logging source - there is no lock per file during making >> emit() (only lock per thread). >> >> So, my question is - is it safe to log into one file using many >> processess uses log

Re: Dynamic and lazy import

2007-10-17 Thread Diez B. Roggisch
>> Diez > > Well, I would like to be able to use "setuptools", but the problem is > that I can't. > Cause the administrator do not want us to be able to add lib in python > dir. > So we have to create our own library directory... That doesn't matter, setuptools is capable of installing anywhere -

Re: Order by value in dictionary

2007-10-17 Thread Diez B. Roggisch
George Sakkis wrote: > On Oct 17, 10:06 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> Diez B. Roggisch wrote: >> > Abandoned wrote: >> >> >> Hi.. >> >> I have a dictionary like these: >> >> a={'a': &#

Re: pymssql - insert NULL to int

2007-10-17 Thread Diez B. Roggisch
rc wrote: > How to insert NULL values in to int field using params. > > I'm trying to use pymssql.execute, passing the operation and list of > params. One of the values in the params is a NULL value going to int > field. The pymssql._quote() puts ' around the NULL which causes an > exception to

Re: if instance exists problem ..

2007-10-17 Thread Diez B. Roggisch
stef mientki schrieb: > hello, > > I've written a convenience wrapper around ConfigObj (which is a imporved > ConfigParser). > > Now if I use an instance of the base class, I can easily test is the > instance exists by " if ini:", > like in this example > >ini = None >if ini: >

Re: if instance exists problem ..

2007-10-18 Thread Diez B. Roggisch
Ben Finney wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > >> stef mientki schrieb: >> > What should I do to the same simple test for existance ? >> >> Use isinstance(obj, type). > > No, that's *far* more specific than &qu

Re: Convert string to command..

2007-10-18 Thread Diez B. Roggisch
Abandoned wrote: > I want to convert a string to command.. > For example i have a string: > a="['1']" > I want to do this list.. > How can i do ? The correct wording here would be expression. To evaluate expressions, there is the function eval: a = eval("['1']") But beware: if the expression co

Re: Convert string to command..

2007-10-18 Thread Diez B. Roggisch
Abandoned wrote: > Thanks you all answer.. > But "eval" is very slow at very big dictionary {2:3,4:5,6:19} > (100.000 elements) > Is there any easy alternative ? How big? How slow? For me, a 1-element list takes 0.04 seconds to be parsed. Which I find fast. Diez -- http://mail.python.o

Re: pymssql - insert NULL to int

2007-10-18 Thread Diez B. Roggisch
rc wrote: > On Oct 17, 11:07 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> rc wrote: >> > How to insert NULL values in to int field using params. >> >> > I'm trying to use pymssql.execute, passing the operation and list of >> >

Re: Convert string to command..

2007-10-18 Thread Diez B. Roggisch
Abandoned wrote: > On Oct 18, 6:14 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> Abandoned wrote: >> > Thanks you all answer.. >> > But "eval" is very slow at very big dictionary {2:3,4:5,6:19} >> > (100.000 elements) >&g

Re: Convert string to command..

2007-10-18 Thread Diez B. Roggisch
Abandoned wrote: > On Oct 18, 6:35 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> Abandoned wrote: >> > On Oct 18, 6:14 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> >> Abandoned wrote: >> >> > Thanks you a

Re: dynamic invoke

2007-10-19 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > On 19 Oct, 11:45, Jarek Zgoda <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] napisa³(a): >> >> > Is there any way (other then eval) to invoke a method by passing >> > method name in a string. >> > It's very simple in php: >> > $oFoo = new Foo(); >> > $dynamiMethod = "b

Re: dynamic invoke

2007-10-19 Thread Diez B. Roggisch
Sushant wrote: > Python will not allow string to be used a function pointer. It is type > unsafe. Best way is to convert string into function pointers manually. > > if dynamicMethod == 'bar': > method = oFoo->bar > else: > method = oFoo->default > method() Sorry to say so, but that answe

Re: dynamic invoke

2007-10-19 Thread Diez B. Roggisch
Nils wrote: > On Oct 19, 12:39 pm, [EMAIL PROTECTED] wrote: >> Hello, >> >> Is there any way (other then eval) to invoke a method by passing >> method name in a string. >> It's very simple in php: >> $oFoo = new Foo(); >> $dynamiMethod = "bar"; >> $oFoo->$dynamiMethod(); >> >> Unfortunately I can'

Re: SQLObject - Connect to established DB with non-int 'id' field

2007-10-19 Thread Diez B. Roggisch
Sean DiZazzo schrieb: > Hi all, > > I am just beginning with TurboGears and have run into a problem with > SQLObject. > > I'm trying to connect to an established mysql DB, and use TurboGears > to display results from the DB only. The problem is that the DB > already has an 'id' field that is a s

Re: How can i store pickle dumps data ?

2007-10-20 Thread Diez B. Roggisch
Abandoned schrieb: > Hi.. > I have some dictionary as {2:3, 4:6, 5:7.} > I want to pickle to these dictionary and save to database but i > couldn't.. > > My code for adding.. > a=eval(dict) > a=pickle.dumps(a, -1) > cursor2.execute("INSERT INTO cache VALUES ('%s', %s)", (x[0],a)) > conn2.c

Re: Dealing with "funny" characters

2007-10-20 Thread Diez B. Roggisch
>No, no, that's wrong. MySQL and the Python interface to it understand > Unicode. You don't want to convert data to UTF-8 before putting it in a > database; the database indexing won't work. I doubt that indexing has anything to do with it whatsoever. >Here's how to do it right. > >

Re: Noob: Loops and the 'else' construct

2007-10-20 Thread Diez B. Roggisch
MRAB schrieb: > On Oct 19, 4:11 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> En Thu, 18 Oct 2007 23:44:27 -0300, Ixiaus <[EMAIL PROTECTED]> >> escribió: >> >>> I have just come across a site that discusses Python's 'for' and >>> 'while' loops as having an (optional) 'else' structure. >>>

<    15   16   17   18   19   20   21   22   23   24   >