Re: Python and Tkinter Programming by John Grayson

2010-05-29 Thread Pradeep B
On Fri, Jan 22, 2010 at 6:48 AM, Ethan Furman wrote: > Peter wrote: >> >> On Jan 15, 9:12 am, Kevin Walzer wrote: On Jan 15, 6:24 am, Mark Roseman  wrote: > >  Peter  wrote: >> >> Besides, the book is mainly about using Python with Tkinter - and >> Tkinter hasn't cha

Tkinter library reference

2010-05-29 Thread Pradeep B
Do we have a standard reference library for Tkinter available? -- Pradeep -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter library reference

2010-05-31 Thread Pradeep B
On Mon, May 31, 2010 at 2:46 PM, eb303 wrote: > On May 29, 3:11 pm, Pradeep B wrote: >> Do we have a standard reference library for Tkinter available? >> >> -- >> Pradeep > > Short answer: no, at least not a complete one for Tkinter itself. > > However, t

Re: Python and Tkinter Programming by John Grayson

2010-05-31 Thread Pradeep B
On Sat, May 29, 2010 at 7:33 PM, Kevin Walzer wrote: > Tkinter doesn't wrap native printing API's. There are a few extensions that > do it, but they are platform specific and not complete. > > The usual ways of printing are like this: > > 1. If you're outputting data from the text widget, write t

Help choosing license for new projects

2010-07-12 Thread Jake b
I'm starting a new python code project. What license do you suggest? I am searching, but I'm not finding a simple comparison of licenses. So I don't know which to use. Maybe MIT or Apache or LGPL or BSD? Are there certain licenses to avoid using because of interaction problems between libraries us

NZEC what is it?

2010-08-15 Thread Mikael B
Hi I use, among other things, a site, http://www.codechef.com to learn python. I don't know what platform they use. I use linux. When I submit this little piece of code to them: import sys import math #main s=sys.stdin.read() int_list=s.split() for a in int_list[1:]: print mat

RE: NZEC what is it?

2010-08-15 Thread Mikael B
From: mba...@live.se To: pyt...@mrabarnett.plus.com Subject: RE: NZEC what is it? Date: Sun, 15 Aug 2010 19:58:44 +0200 > Date: Sun, 15 Aug 2010 18:22:54 +0100 > From: pyt...@mrabarnett.plus.com > To: python-list@python.org > Subject: Re: NZEC what is it? > > Mika

RE: NZEC what is it?

2010-08-15 Thread Mikael B
> From: ian.g.ke...@gmail.com > Date: Sun, 15 Aug 2010 17:39:57 -0400 > Subject: Re: NZEC what is it? > To: python-list@python.org > > On Sun, Aug 15, 2010 at 12:56 PM, Mikael B wrote: > > Hi > > I use, among other things, a site, http://www.codechef.com to

scope of variable

2010-08-20 Thread M B
Hi, I try to learn python. I don't understand this: (running in idle) >>> dept=0 >>> def mud(): print dept >>> mud() 0 >>> def mud(): dept+=1 print dept >>> mud() Traceback (most recent call last): File "", line 1, in mud() File "", line 2, in

Re: scope of variable

2010-08-20 Thread M B
fre 2010-08-20 klockan 13:19 -0600 skrev Burton Samograd: > M B writes: > > > Hi, > >>>> dept=0 > >>>> def mud(): > > print dept > > > > > >>>> mud() > > 0 > >>>> def mud(): > > d

Remoting over SSH

2009-07-08 Thread Hussein B
Hey, I want to perform commands on a remote server over SSH. What do I need? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

A little help with pexpect

2009-07-19 Thread Hussein B
Hey, I'm trying to execute a command over a remore server using pexpect + url = 'ssh internalserver' res = pexpect.spawn(url) print '1' res.expect('.*ssword:') print '2' res.sendline('mypasswd') print '3' res.sendline('ls -aslh') + What I want to do is to send a coup

Executing remote command with paramiko

2009-08-03 Thread Hussein B
Hey, I'm trying to run a sudo guarded command over SSH using paramiko +++ s = paramiko.SSHClient() s.load_system_host_keys() s.connect(hostname, port, username, passwd) stdin, stdout, stderr = s.exec_command('sudo -s') stdin.write('password\n') stdin.flush() print 'Flushing' stdin,

RE: is list comprehension necessary?

2010-10-26 Thread Mikael B
> > That's from the functional programming crowd. > > Python isn't a functional language. A noob question: what is a functional language? What does it meen? -- http://mail.python.org/mailman/listinfo/python-list

Re: "Decoding unicode is not supported" in unusual situation

2012-03-07 Thread Diez B. Roggisch
John Nagle writes: > I think that somewhere in "suds", they subclass the "unicode" type. > That's almost too cute. > > The proper test is > > isinstance(s,unicode) Woot, you finally discovered polymorphism - congratulations! Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: pypi and dependencies

2012-03-21 Thread Diez B. Roggisch
Andrea Crotti writes: > When I publish something on Pypi, is there a way to make it fetch the > list of dependencies needed by my project automatically? > > It would be nice to have it in the Pypi page, without having to look > at the actual code.. > Any other possible solution? I don't understa

Re: configobj validation

2012-03-21 Thread Diez B. Roggisch
Andrea Crotti writes: > On 03/19/2012 12:59 PM, Andrea Crotti wrote: >> I seemed to remember that type validation and type conversion worked >> out of the box, but now >> I can't get it working anymore. >> >> Shouldn't this simple example actually fail the parsing (instead it >> parses perfectly

Re: Python 2.7.3, C++ embed memory leak?

2012-06-02 Thread Diez B. Roggisch
Qi writes: > Hi guys, > > Is there any known memory leak problems, when embed Python 2.7.3 > in C++? > I Googled but only found some old posts. > > I tried to only call Py_Initialize() and Py_Finalize(), nothing else > between those functions, Valgrind still reports memory leaks > on Ubuntu? > >

Re: ctypes callback with char array

2012-06-02 Thread Diez B. Roggisch
ohlfsen writes: > Hello. > > Hoping that someone can shed some light on a tiny challenge of mine. > > Through ctypes I'm calling a c DLL which requires me to implement a callback > in Python/ctypes. > > The signature of the callback is something like > > void foo(int NoOfElements, char Elements[

Can you recommend an Experienced Python/SQL contract developer for this 6 - 12 month contract in NYC?

2011-02-25 Thread Ben B. Diamond
Experienced Python/SQL contract developer * 3+ years experience writing clean, concise Python * 3+ years experience tracing, debugging, and maintaining existing code * Experience working closely with a team in a fluid environment with evolving requirements * Strong CS fundamentals (algorithms & da

Re: Python in Perspective

2017-09-10 Thread Tristan B. Kildaire
On 2017-09-10 12:21 PM, Leam Hall wrote: y'all, My god-kids and their proginators lost most everything because of Harvey. I spent much of yesterday worrying about a friend who had gone quiet as he evacuated his family ahead of Irma. Please keep Python in perspective. Whether we use 1.5 or 4r

Vb6 type to python

2022-11-30 Thread luca72.b...@gmail.com
Hello i have a byte file, that fill a vb6 type like: Type prog_real codice As String * 12'hsg denom As String * 24'oo codprof As String * 12 'ljio note As String * 100 programmer As String * 11 Out As Integer b_out As Byte'TRUE = Se

is there somebody that have experince with python and canopen

2022-04-15 Thread luca72.b...@gmail.com
We are searching for someone that can develop a python program for use servomotor for automotive. -- https://mail.python.org/mailman/listinfo/python-list

Re: help on "from deen import *" vs. "import deen"

2016-11-20 Thread Tristan B. Kildaire
On Tue, 15 Nov 2016 22:16:07 +, Erik wrote: > On 15/11/16 14:43, Michael Torrie wrote: >> As you've been told several times, if you "import deen" then you can >> place a new object into the deen namespace using something like: >> >> deen.foo=bar >> >> Importing everything from an imported modu

Guido? Where are you?

2016-11-20 Thread Tristan B. Kildaire
Is Guido active on this newsgroup. Sorry for the off-topic ness. -- https://mail.python.org/mailman/listinfo/python-list

Weekly Python Patch/Bug Summary

2005-09-22 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 337 open ( -6) / 2941 closed (+14) / 3278 total ( +8) Bugs: 908 open ( +0) / 5262 closed (+17) / 6170 total (+17) RFE : 194 open ( +5) / 187 closed ( +2) / 381 total ( +7) New / Reopened Patches __ use LIST_

Re: Wrapping classes

2005-09-23 Thread Diez B. Roggisch
t;>what you're doing is a good idea. :-) ) > > > What I'd like to do precisely is to be able to evaluate an expression like > "a+2*b" (using eval) where a and b are objects which behave like numarray > arrays, but whose values aren't computed until their

Re: Productivity and economics at software development

2005-09-23 Thread Diez B. Roggisch
I get this: Mod_python error: "PythonHandler mod_python.publisher" Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in HandlerDispatch result = object(req) File "/usr/lib/python2.3/site-packages/mod_python/publisher.py", line 136

Re: [RFC] Parametric Polymorphism

2005-09-25 Thread Diez B. Roggisch
Catalin Marinas wrote: > Hi, > > Sorry if this was previously discussed but it's something I miss in > Python. I get around this using isinstance() but it would be cleaner > to have separate functions with the same name but different argument > types. I think the idea gets quite close to the Lisp/

Re: New-style classes questions

2005-09-25 Thread Diez B. Roggisch
> What is the reason for allowing both styles? (backwards compatibility??) yes. > > When I make my own classes should they always be new-style objects or are > there reasons for using old-style object? No, use new style if you can - except from the rare cases where above mentioned backwards

Re: Memory stats

2005-09-25 Thread Diez B. Roggisch
Tarek Ziadé wrote: > Hi list, > > I am trying to find a general memory profiler that can measure the > memory usage in Python program > and gather some stats about object usages, and things like that. > > I am trying to find a simple python module to be able to customize it > and integrates it to

Re: Example of signaling and creating a python daemon

2005-09-25 Thread Diez B. Roggisch
Jon Monteleone wrote: > What I dont understand about daemonizing a python script is whether or not it > requires the > daemon creation, ie the signal handling and forking of the process, to be > part of the > daemon code or is this code in a separate program that acts like a wrapper to > turn a

Re: unittest setup

2005-09-25 Thread Diez B. Roggisch
paul kölle wrote: > hi all, > > I noticed that setUp() and tearDown() is run before and after *earch* > test* method in my TestCase subclasses. I'd like to run them *once* for > each TestCase subclass. How do I do that. Create a global/test instance flag. Diez -- http://mail.python.org/mailman/

Re: Struggling with this concept please help

2005-09-26 Thread Diez B. Roggisch
George wrote: > Not allowed to use Beautiful Soup because of the very important built > ins that is provides that makes it very simple to complete this > problem. Not my choice . This is a review question for our final in two > months and I just want to get things going so I can try to understand >

Re: What is "self"?

2005-09-26 Thread Diez B. Roggisch
> This still seems not quite right to me... Or more likely seems to be > missing something still. > > (But it could be this migraine I've had the last couple of days > preventing me from being able to concentrate on things with more than a > few levels of complexity.) > > Playing around with

Re: Most direct way to strip unoprintable characters out of a string?

2005-09-26 Thread Diez B. Roggisch
Steve Bergman wrote: > Fredrik Lundh wrote: > >> ("sanitizing" HTML data by running filters over encoded 8-bit data is >> hardly >> ever the right thing to do...) >> >> >> >> > I'm very much open to suggestions as to the right way to do this. I'm > working on this primarily as a learning proj

Dr. Dobb's Python-URL! - weekly Python news and links (Sep 26)

2005-09-26 Thread Diez B. Roggisch
ythonology.com/success The Python Software Foundation (PSF) has replaced the Python Consortium as an independent nexus of activity. It has official responsibility for Python's development and maintenance. http://www.python.org/psf/ Among the ways you can support

Dr. Dobb's Python-URL! - weekly Python news and links (Sep 26)

2005-09-27 Thread Diez B. Roggisch
ythonology.com/success The Python Software Foundation (PSF) has replaced the Python Consortium as an independent nexus of activity. It has official responsibility for Python's development and maintenance. http://www.python.org/psf/ Among the ways you can support

Weekly Python Patch/Bug Summary

2005-09-29 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 337 open ( +0) / 2947 closed ( +6) / 3284 total ( +6) Bugs: 912 open ( +4) / 5278 closed (+16) / 6190 total (+20) RFE : 195 open ( +1) / 187 closed ( +0) / 382 total ( +1) New / Reopened Patches __ fix for d

Re: Quick help needed: how to format an integer ?

2005-10-05 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi ! > > I need to convert some integer values. > > "1622" ->"1 622" > > or > > "10001234" -> ""10.001.234"" > > So I need thousand separators. > > Can anyone helps me with a simply solution (like %xxx) ? The module locale does what you need, look at ist docs, espe

Re: regarding python and c++ interaction

2005-10-05 Thread Diez B. Roggisch
> i am new to python.i hav to call function of c++ .so file(shared > library)on linux. > any how i am not able to do that. > i had made one zoo.so file.when i import it this gives the following error... > > import zoo > > Traceback (most recent call last): > File "", line 1, in ? > ImportE

Re: "no variable or argument declarations are necessary."

2005-10-05 Thread Diez B. Roggisch
> This is naive. Testing doesn't guarantee anything. If this is what you > think about testing, then testing gives you a false impression of > security. Maybe we should drop testing. Typechecking is done by a reduced lamda calculus (System F, which is ML-Style), whereas testing has the full power

Re: Does python support the expression "a = b | 1"???

2005-10-05 Thread Diez B. Roggisch
Wenhua Zhao wrote: > a = b | 1 > > a = b if b != nil > else a =1 > > Is there such expression in python? Soon there will be, but currently: no. What you are after is a ternary operator like _?_:_ in C. There have been plenty of discussions about these - search this NG.

Re: How to create temp file in memory???

2005-10-05 Thread Diez B. Roggisch
Wenhua Zhao wrote: > I have a list of lines. I want to feed these lines into a function. > The input of this function is a file. > I want to creat a temp file on disk, and write the list of lines into > this temp file, then reopen the file and feed it to the function. > Can I create a this temp fi

Re: how to keep collection of existing instances and return one on instantiation

2005-10-05 Thread Diez B. Roggisch
> What I *really* want is to keep a collection of all the Spam instances, > and if i try to create a new Spam instance with the same contructor > parameters, then return the existing Spam instance. I thought new-style > classes would do it: > So what is the best/preferred way to do this? Use t

Re: how to keep collection of existing instances and return one on instantiation

2005-10-05 Thread Diez B. Roggisch
> > I looked at the Borg Pattern, but I don't think it was exactly what I > want. > > The Borg patten appears to be if you want multiple instances that point > to the same "data". > > What I wanted is multiple calls to create a new object with the same > parameters points to the "original" objec

Re: how to keep collection of existing instances and return one on instantiation

2005-10-05 Thread Diez B. Roggisch
>>Read the comments. What you say is essentially the same - the data >>matters, after all. What do you care if there are several instances >>around? >> > In my case it matters more that the objects are the same. > > For example I want set([Spam(1), Spam(2), > Spam(3)]).intersect(set([Spam(1), Sp

Re: how to keep collection of existing instances and return one on instantiation

2005-10-05 Thread Diez B. Roggisch
Diez B. Roggisch wrote: > >>> Read the comments. What you say is essentially the same - the data >>> matters, after all. What do you care if there are several instances >>> around? >>> >> In my case it matters more that the objects are the same.

Re: Using command line args on Windows

2005-10-05 Thread Diez B. Roggisch
k8 wrote: > Hello- > > I'm stuck on a Windows machine today and would love to fully play with > and test a simple python script. I want to be able to type "python > myscript myarg" somewhere. Is there anything out there to help me? My > main concern is playing with the myarg in the sys.argv lis

Re: Using command line args on Windows

2005-10-06 Thread Diez B. Roggisch
k8 wrote: > Thank you thank you thank you- The windows command line sol worked. It sure does. But it sucks.. bad tab-completion, few tools, short history, limited command-line-editing and so on. But if you want it the hard way, it's your choice :) Diez -- http://mail.python.org/mailman/listinf

Re: "no variable or argument declarations are necessary."

2005-10-06 Thread Diez B. Roggisch
> Sure, But allow me this silly analogy. > > Going out on a full test-drive will also reveal your tires are flat. > So if you one has to be dropped, a full test drive or a tire check > it would certainly be the tired check. But IMO the tire check > is still usefull. But you could write it as test

Re: updating local()

2005-10-06 Thread Diez B. Roggisch
Flavio wrote: > Ok, > > I got it! > > Its vey insecure, and it is not guaranteed to work. Fine. > > Now what would you do if you wanted to pass a lot of variables (like a > thousand) to a function and did not wanted the declare them in the > function header? use a dict or list? This is almost c

Re: "no variable or argument declarations are necessary."

2005-10-06 Thread Diez B. Roggisch
> > I can't help but feel that a lot of people have specific typechecking > systems in mind and then conclude that the limits of such a symtem > are inherent in typechecking itself. I've been writing a type-checker for my diploma thesis for a functionnal programmming language. And it _is_ limite

Re: "no variable or argument declarations are necessary."

2005-10-06 Thread Diez B. Roggisch
> Suppose we have a typesystem which has the type ANY, which would mean > such an object could be any type. You could then have homogenous lists > in the sense that all elements should be of the same declared type and > at the same time mix all kind of type in a particular list, just > as python do

Re: dcop module under Python 2.4

2005-10-07 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi all, > at the end I upgraded to 2.4, but now I am not able to load dcop module > (part of the Python-KDE3 bindings). > Any help? Install PyKDE for 2.4 Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't extend function type

2005-10-07 Thread Diez B. Roggisch
Paul Rubin wrote: > Oh well. I had wanted to be able to define two functions f and g, and > have f*g be the composition of f and g. > > >>> func_type = type(lambda: None) > >>> class composable_function(func_type): > ... def __mult__(f,g): > ... def c(*args, **kw): > ...

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Diez B. Roggisch
> Why do you call this a JAVA Object or C void*? Why don't you call > it a PYTHON object. It is this kind of reaction that IMO tells most > opponents can't think outside the typesystems they have already > seen and project the problems with those type systems on what > would happen with python shou

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Diez B. Roggisch
Paul Rubin wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > >>In other words, you want Python to be strongly-typed, but sometimes >>you want to allow a reference to be to any object whatsoever. In which >>case you can't possibly do any sensible type-checking on it, so this >>new Python+ or what

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Diez B. Roggisch
Antoon Pardon wrote: > Then argue against my ideas, and not your makings of it. > > If I just use 'ANY' and you fill that in with C void* like > implementation and argue against that, then you are arguing > against your own ghosts, but not against what I have in mind. Well, you didn't tell us wha

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Diez B. Roggisch
n, but the capability of today's type-systems to keep that information across such a transition. This won't work: Object foo = A(); B bar = (B) foo; And please, pretty please don't argue with the simplicity of that example - think of a bazillion statements between these two, possibly done

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Diez B. Roggisch
> Now some of the Python-is-perfect crowd seems to suffer from a "Blub > paradox" (http://c2.com/cgi/wiki?BlubParadox). They see annoying, > static typed languages like C and Java, and they see pleasant, > dynamically typed languages like Python, and conclude that static > types = annoying, when i

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Diez B. Roggisch
Paul Rubin wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > > - FPs share their own set of problems - try writing a server. The > > have inherent troubles with event-driven programs. > > Erlang? Guess what, worked with that, too :) And let me

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Diez B. Roggisch
> > You just said "let's > > introduce something like any". I showed you existing implementations of > > such a concept that have problems. > > But as far as I can see that is a problem of the implementation > not necessarily of the concept. Without any concept, sure there can't be problems with

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Diez B. Roggisch
espective types could be meant, thus A B C are constrained by these types. Which, in an overloading-allowing language, can get pretty much. The trick is to find a solution for the variables that satisfy all the constraints. And a solution are actual types, not ad-hoc sets of types - otherwise,

Re: Python, alligator kill each other

2005-10-07 Thread Diez B. Roggisch
infidel wrote: > By Denise Kalette > Associated Press > > MIAMI - The alligator has some foreign competition at the top of the > Everglades food chain, and the results of the struggle are horror-movie > messy. > > A 13-foot Burmese python recently burst after it apparently tried to > swallow a li

Weekly Python Patch/Bug Summary

2005-10-07 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 341 open ( +4) / 2953 closed ( +6) / 3294 total (+10) Bugs: 884 open (-28) / 5321 closed (+43) / 6205 total (+15) RFE : 196 open ( +1) / 187 closed ( +0) / 383 total ( +1) New / Reopened Patches __ Make fcnt

Re: Function decorator that caches function results

2005-10-09 Thread Diez B. Roggisch
>>def cache_function(fn): >> cache = {} >> def cached_result(*args, **kwargs): >> if args in cache: >> return cache[args] >> result = fn(*args, **kwargs) >> cache[args] = result >> return result >> return cached_result > > > I'm curious... w

Re: Question about StringIO

2005-10-09 Thread Diez B. Roggisch
Frank Millman wrote: > Hi all > > I understand that StringIO creates a file-like object in memory. > > Is it possible to invoke another program, using os.system() or > os.popen(), and use the < redirect operator, so that the other program > reads my StringIO object as its input? No. Processes do

Re: Function decorator that caches function results

2005-10-09 Thread Diez B. Roggisch
> If you create a closure, using a memoization technique as per the original > post, and then call type() on that closure, Python reports . Because it is. The closure is only sort of an extension to the locals() available to that function. Not more, not less. > > If you use dir() on that closur

Re: assigning in nested functions

2005-10-09 Thread Diez B. Roggisch
jena wrote: > Hi > I have code > > # BEGIN CODE > def test(): > def x(): >print a >a=2 # *** > > a=1 > x() > print a > > test() > # END CODE > > This code fails (on statement print a in def x), if I omit line marked > ***, it works (it prints 1\n1\n). It look like when I assign var

Re: What about letting x.( ... ? ... ) be equivalent to ( ... x ... )

2005-10-09 Thread Diez B. Roggisch
> There's something i don't understand : > > I've posted the original message you reply to yesterday, but I still > cannot see it in comp.lang.python, while I can see your reply, and my > reply to your reply. > > I tried with two different providers to get the messages, but with the > same res

Re: Function decorator that caches function results

2005-10-09 Thread Diez B. Roggisch
> Clearly there is no DISTINCT closure object. If there were, I wouldn't > need to ask how one can tell them apart, because type() would just report > that one was a function and one was a closure. I don't have a problem with > that. But read on... > > >>function objects always con- >>tain all th

Re: Function decorator that caches function results

2005-10-09 Thread Diez B. Roggisch
> > [penny drops] Now we're getting somewhere... a closure is something > _added_ to a function. So we should talk about functions-without-closures > and functions-with-closures. Yes. > > >>Speaking in >>terms of "is a" could be seen as some inheritance relation. > > > [penny rises again]

Re: What about letting x.( ... ? ... ) be equivalent to ( ... x ... )

2005-10-10 Thread Diez B. Roggisch
Daniel Delay wrote: > I agree the comparison to the mathematical o-operator is misleading, it > was just to say sometimes, it can be usefull introduce new syntax to > avoid too many nested parenthesis To replace them by the same amount of parentheses with a dot in front? Not very convincing. > T

Re: Python's Performance

2005-10-10 Thread Diez B. Roggisch
Mike Meyer wrote: > Donn Cave <[EMAIL PROTECTED]> writes: > >>I agree that there are many shades of grey here, but there's also a >>real black that's sharply distinct and easy to find -- real native >>code binaries are not interpreted. > > > Except when they are. Many machines are microcoded, wh

Re: Question about StringIO

2005-10-10 Thread Diez B. Roggisch
> Thanks, Steve and Diez, for the replies. I didn't think it was > possible, but it was worth asking :-) > > I will try to explain my experience with popen() briefly. > > I have some sql scripts to create tables, indexes, procedures, etc. At > present there are about 50 scripts, but this number w

Re: Question about StringIO

2005-10-11 Thread Diez B. Roggisch
> Thanks for this pointer. I have read it, but I don't think it applies > to my situation, as it talks about 'reading' from the child's stdout > while the child is 'writing' to stderr. But that is exactly the point: the psql blocks because you don't read away the buffered data. Start a thread, re

Re: Question about StringIO

2005-10-11 Thread Diez B. Roggisch
> My scripts are used to create the tables in the database. I didn't > think that DB-API covered that. The DB-Api covers executin arbirary SQL - either DDL or DML. It is surely centered around DML, but that doesn't mean that its not usabel to issue "create ..." statements. >However, even if i

Re: Wrapper function

2005-10-11 Thread Diez B. Roggisch
> PyObject *wrap_doStuff(PyObject *, PyObject *args) { ^ I guess you need a parameter name here Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Nicer way of strip and replace?

2005-10-11 Thread Diez B. Roggisch
> I replace commata with dots, then delete leading/trailing "s then add to > a sum after converting it to a float. > This looks ugly (I htink) and I wonder if there is a nicer way to strip > commata and change the comma to a dot already when reading in. It's not ugly - it's necessary. > Or sho

Re: Adding a __filename__ predefined attribute to 2.5?

2005-10-12 Thread Diez B. Roggisch
Rune Strand wrote: > I Steve, > > I know it's several ways to isolate the filename. I just want to avoid > the overhead of importing sys or os to achieve it. What overhead? Besides: if you want to do python this, why don't we introduce the function solve_my_problems() that is the only thing a

Re: Adding a __filename__ predefined attribute to 2.5?

2005-10-12 Thread Diez B. Roggisch
Rune Strand wrote: > Excuse me, do you suffer from a bad hair-day? I didn't say it is > platform independant. It's ok for my use on Linux and Windows. If you > cannot imagine any other usecase for a __filename__ attribute, that's > your problem, not mine. I think you are the one who wants __filen

Re: Adding a __filename__ predefined attribute to 2.5?

2005-10-12 Thread Diez B. Roggisch
Diez B. Roggisch wrote: > And requesting random features built into the interpreter without even > specifying a usecase - as remote as it may be - isn't very likely > happen, don't you think? Which I wanted to express with my apparently > misunderstood solve_my_problem()

Re: A Tree class, my $0.02 contribution to the python community.

2005-10-12 Thread Diez B. Roggisch
Antoon Pardon wrote: > I don't know. The python dictionary type with its name, seem to refer > to how it is implemented, so I thought Tree was an appropiate name > here as it is implemented as a tree. I too had the impression you're talking about a tree-implementation, not a mapping based on key

Re: python server?

2005-10-12 Thread Diez B. Roggisch
> I was wondering if something similar already existed, to use as-is or > to adapt to my needs. > I did a little googling, which pointed me to interesting, but rather > different projects. Has anybody ever seen or heard something of this > kind? Or maybe there is something almost-ready in the amazi

Re: Setdefault bypasses __setitem__

2005-10-13 Thread Diez B. Roggisch
Ron Garret wrote: > Is this a bug or a feature? > > class mydict(dict): >def __setitem__(self, key, val): > print 'foo' > dict.__setitem__(self, key, val) > > d=mydict() d[1]=2 > > foo > d.setdefault(2,3) Feature. If it wouldn't bypass __setitem__, how exactly would

Re: Python's garbage collection was Re: Python reliability

2005-10-13 Thread Diez B. Roggisch
Delaney, Timothy (Tim) wrote: > Tom Anderson wrote: > > >>Except that in smalltalk, this isn't true: in ST, every variable >>*appears* to contain a reference to an object, but implementations >>may not actually work like that. In particular, SmallTalk 80 (and >>some earlier smalltalks, and all su

Re: Perl-Python-a-Day: Sorting

2005-10-13 Thread Diez B. Roggisch
> In Perl, sort is a function, not some Object Oriented thing. It returns > the sorted result as another list. This is very simple and nice. And sometimes exteremely stupid - if your list is large, and making a copy just form sorting it (when you don't have to keep a referenece to the old list)

Re: Python's garbage collection was Re: Python reliability

2005-10-13 Thread Diez B. Roggisch
Paul Rubin wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > >>AFAIK some LISPs do a similar trick to carry int values on >>cons-cells. And by this tehy reduce integer precision to 28 bit or >>something. Surely _not_ going to pass a regression te

Re: Setdefault bypasses __setitem__

2005-10-13 Thread Diez B. Roggisch
> The implementation is certainly a design decision. setdefault() could be > implemented in terms of __set/getitem__() as > > def setdefault(self, key, value=None): > try: > return self[key] > except KeyError: > self[key] = value > return self[key] > > I guess it's

Re: Setdefault bypasses __setitem__

2005-10-13 Thread Diez B. Roggisch
> Are we talking about the same setdefault()? > > > D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D > > There is no per-instance default value just on per call: Oh. You're right. I was somehow under the impression that setdefault is per-instance, so that I can avoid d.get(ke

Re: Python's garbage collection was Re: Python reliability

2005-10-13 Thread Diez B. Roggisch
> Yes, that would describe just about every cpu for the past 30 years > that's a plausible Python target. No. The later 68K (>68020) could address on odd adresses. And AFAIK all x86 can because of their 8080 stemming. Don't confuse this with 16Bit aligned addressing - _that_ is the minimum for

Re: wxPython & Cygwin

2005-10-13 Thread Diez B. Roggisch
Gilles DRIDI wrote: > Does someone has installed wxPython on the Cygwin platform, environment ? Why? Use windows python, wxPython for it - and put it in your path to use it inside cygwin. But maybe you _can_ compile it yourself - I didn't try, though. Diez -- http://mail.python.org/mailman/lis

Re: Setdefault bypasses __setitem__

2005-10-13 Thread Diez B. Roggisch
Duncan Booth wrote: > Diez B. Roggisch wrote: > > >>So if setdefault >>was implemented as >> >>def setdefault(self, v): >> self["SOME_DEFAULT_KEY_NAME"] = v > > > if setdefault was implemented that way then all current uses of set

Re: Python's garbage collection was Re: Python reliability

2005-10-14 Thread Diez B. Roggisch
> Yeah, I noticed that, I could have been pedantic about it but chose to > just describe how these language implementations work in the real > world with zero exceptions that I know of. I guess I should have > spelled it out. You talked about CPU architectures: """ >And this presumes an archite

Weekly Python Patch/Bug Summary

2005-10-15 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 344 open ( +3) / 2955 closed ( +2) / 3299 total ( +5) Bugs: 883 open ( -1) / 5341 closed (+20) / 6224 total (+19) RFE : 201 open ( +5) / 187 closed ( +0) / 388 total ( +5) New / Reopened Patches __ Compiling

Re: wxPython & Cygwin

2005-10-16 Thread Diez B. Roggisch
>> Why? Use windows python, wxPython for it - and put it in your path to >> use it inside cygwin. >> > Don't think that'll work for an extension module. Sure it will. You can call whatever program you want from cygwin, as long as it is in the path. No difference to double-clicking an icon or so

Re: subtle side effect of generator/generator expression

2005-10-16 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > That is exactly what I meant, in fact. These IO thing are expected to > have side effects so they are not subtle. Generator on the other hand, > is sort of "clever iteratables". > > Now that I notice that, Of course I can be sure I would be careful. But > what about the

Re: wxPython & Cygwin

2005-10-16 Thread Diez B. Roggisch
> I'm sure the Cygwin world would be grateful if you or someone else were > to establish the correct build procedure. For Qt? I found it on the Qt free edition site, and followed the instructionbs. Not much to do there. But make sure you have _plenty_ of time. It took me _days_ to compile Qt. N

Re: TypeError: unbound method PrintInput() must be called with test instance as first argument (got test instance instead)

2005-10-16 Thread Diez B. Roggisch
arotem wrote: > Hi, > > I am trying to call an unbound method (PrintInput) with the object > instance as the first argument but getting the following error: > "TypeError: unbound method PrintInput() must be called with test > instance as first argument (got test instance instead)" > > Below is th

<    1   2   3   4   5   6   7   8   9   10   >