Re: concatenate Numeric

2006-07-09 Thread Sheldon
Robert Kern skrev: > Sheldon wrote: > > Hi, > > > > I am trying to build a large array using concatenate function in > > python. > > So as I loop over the number of arrays, of which there are 12 (4 down > > and 3 across), I create 3 long arrays by concatenating them at the > > bottom and then con

type comparison and wxpython

2006-07-09 Thread borris
ive been trying to do a test for type with wxpython objects like passing in a wx.TextCtrl into def XXX(obj) if type(obj) is type(self.Button) I have to make an object self.Button to get its type. as I tried is type("wx.Button") which didnt work. trouble is the button must have a parent, whi

Re: function that modifies a string

2006-07-09 Thread Simon Forman
greenflame wrote: > Jason wrote: > > > > There /are/ a few hacks which will do what you want. However, if you > > really need it, then you probably need to rethink your program design. > > Remember, you can't change a string since a string is immutable! You > > can change a variable to bind to an

Re: function that modifies a string

2006-07-09 Thread Simon Forman
placid wrote: > quick hack > > def thefunc(s): > return s = "||" + s + ">>" >>> def thefunc(s): return s = "||" + s + ">>" SyntaxError: invalid syntax -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a type error?

2006-07-09 Thread Marshall
Chris Smith wrote: > > [...] static typing does ... doesn't imply any constraints on the kind > of behavioral property that's being checked; but only on the way that > the check occurs. Nice post. Marshall -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a type error?

2006-07-09 Thread Chris Smith
George Neuner wrote: > Now this is getting ridiculous. It's not at all ridiculous. The fact that it seems ridiculous is a good reason to educate people about what static typing does (and doesn't) mean, and specifically that it doesn't imply any constraints on the kind of behavioral property t

Headers for Form Submision, and also HTTPrequests

2006-07-09 Thread evanpmeth
I am currently working a program that was intended to be purely JS and AJAX. Due to the cross domain access problems i have defaulted to a language I enjoy more, Python. My project consists of a web service that provides information from a site that can only be accessed through a portal type system

Re: language design question

2006-07-09 Thread Bryan
Steven Bethard wrote: > The advantage of a functional form over a method shows up when you write > a function that works on a variety of different types. Below are > implementations of "list()", "sorted()" and "join()" that work on any > iterable and only need to be defined once:: > > def

possible issue with mechanize/python parsing

2006-07-09 Thread bruce
hi... it appears that i'm running into a possible problem with mechanize/browser/python rgarding the "select_form" method. i've tried the following and get the error listed: br.select_form(nr = 1) br.select_form(name="foo") br.select_form(name=foo) br.select_form(name="foo") here's a short

Re: language design question

2006-07-09 Thread guthrie
Good point, thanks. But if (as I proposed..!) the user interface is better if presented as a method. one could porovide convenience methods which would then interface to these underlying library functions; yes? So the main datatype classes could support such a method style, and just layer on t

Re: function that modifies a string

2006-07-09 Thread greenflame
Jason wrote: > > You cannot do what you are trying to do directly. Strings are > immutable objects. Once a string is created, that string cannot be > modified. When you operate on a string, you produce a different > string. Functions which operate on a string should return their value: > > >>>

Re: Web Browser Pygame Plug-in?

2006-07-09 Thread Shane Hathaway
Gregory Piñero wrote: > Shane Wrote: >> Ah, so you also want to distribute untrusted Python code. That's fairly >> hard. There's a discussion about it on Python-Dev right now. > > Well, I want to write a game in Pygame, and people can just go to my > website and play it within their browser. I

Re: What is a type error?

2006-07-09 Thread George Neuner
On Mon, 26 Jun 2006 11:49:51 -0600, Chris Smith <[EMAIL PROTECTED]> wrote: >Pascal Costanza <[EMAIL PROTECTED]> wrote: > >> This is maybe better understandable in user-level code. Consider the >> following class definition: >> >> class Person { >>String name; >>int age; >> >>void bu

Re: language design question

2006-07-09 Thread guthrie
Many thanks; great information. Best, Gregory Steven Bethard wrote: > guthrie wrote: > >> Steven Bethard wrote: >> >>> Why would ``x.len()`` be any more convenient than ``len(x)``? Your >>> preference here seems pretty arbitrary. >> >> -- Perhaps; >> but having all standard operations as a m

Re: Add a method to the int class

2006-07-09 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > How can I add a method to the int class? You can't. The closest is to subclass int and add your method. -- http://mail.python.org/mailman/listinfo/python-list

Re: Add a method to the int class

2006-07-09 Thread placid
[EMAIL PROTECTED] wrote: > How can I add a method to the int class? sub class it >>> class MyInt(int): >>>def times(self,multiple): >>> return self * multiple >>> >>> a = 2 >>> print a 2 >>> a = MyInt(2) >>> print a >>> 2 >>> print a.times(2) 4 --Cheers -- h

Re: language design question

2006-07-09 Thread Steven Bethard
Terry Reedy wrote: > "Gregory Guthrie" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> - why is len() not a member function of strings? Instead one says >> len(w). > > Consider map(len, ('abc', (1,2,3), [1,2], {1:2})) > [3, 3, 2, 1] > > Now try to rewrite this using meth

Re: function that modifies a string

2006-07-09 Thread placid
greenflame wrote: > I want to make a function that does the following. I will call it > thefunc for short. > > >>> s = "Char" > >>> thefunc(s) > >>> s > '||Char>>' > > I tried the following > > def thefunc(s): > s = "||" + s + ">>" > > The problem is that if I look at the string after I apply

Re: language design question

2006-07-09 Thread Steven Bethard
guthrie wrote: > Steven Bethard wrote: >> Why would ``x.len()`` be any more convenient than ``len(x)``? Your >> preference here seems pretty arbitrary. > -- Perhaps; > but having all standard operations as a method seems more regular (to > me), and allows a simple chained operation format of a se

Add a method to the int class

2006-07-09 Thread barberomarcelo
How can I add a method to the int class? -- http://mail.python.org/mailman/listinfo/python-list

Re: function that modifies a string

2006-07-09 Thread Jason
greenflame wrote: > I want to make a function that does the following. I will call it > thefunc for short. > > >>> s = "Char" > >>> thefunc(s) > >>> s > '||Char>>' > > I tried the following > > def thefunc(s): > s = "||" + s + ">>" > > The problem is that if I look at the string after I apply t

Re: language design question

2006-07-09 Thread Terry Reedy
"OKB (not okblacke)" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Terry Reedy wrote: > >> Consider > map(len, ('abc', (1,2,3), [1,2], {1:2})) >> [3, 3, 2, 1] >> >> Now try to rewrite this using methods (member functions). > > [a.len() for a in ('abc', (1,2,3), [1,2], {1:2})]

Re: language design question

2006-07-09 Thread guthrie
Steven Bethard wrote: > Gregory Guthrie wrote: > >> For example, >>- why is len() not a member function of strings? Instead one says >> len(w). > > Why would ``x.len()`` be any more convenient than ``len(x)``? Your > preference here seems pretty arbitrary. -- Perhaps; but having all standa

function that modifies a string

2006-07-09 Thread greenflame
I want to make a function that does the following. I will call it thefunc for short. >>> s = "Char" >>> thefunc(s) >>> s '||Char>>' I tried the following def thefunc(s): s = "||" + s + ">>" The problem is that if I look at the string after I apply the function to it, it is not modified. I r

Re: language design question

2006-07-09 Thread Alex Martelli
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: ... > > This would allow things like: > > key = '',join( list(word.lower().strip()).sort() ) > > key = ''.join(list(sorted(word.lower().strip())) No need to make yet another list here (also, I think each of you omitted a needed closed-

Re: first book about python

2006-07-09 Thread gene tani
IOANNIS MANOLOUDIS wrote: > I want to learn python. > I plan to buy a book. I always find printed material more convenient than > reading on-line tutorials. > I don't know PERL or any other scripting language. I only know some BASH > programming. I am looking for a book which will help me get star

Re: first book about python

2006-07-09 Thread IOANNIS MANOLOUDIS
I guess it's better to wait for the for dummies book. I should focus instead in taking the LPIC-2 exams in September. Ioannis -- http://mail.python.org/mailman/listinfo/python-list

RE: [wwwsearch-general] ClientForm request re ParseErrors

2006-07-09 Thread bruce
update. out of curiosity, i fetched the latest mechanize from svn.. i get the same error with the parse... i've also tried to do: br.select_form(nr = 1) br.select_form(name="foo") br.select_form(name=foo) br.select_form(name="foo") etc same err occurs... -bruce hi john... not s

Re: pyXLWriter - grid lines and if formula

2006-07-09 Thread Waldemar Osuch
Luis P. Mendes wrote: > Gregory Piñero escreveu: > > On 7/7/06, Luis P. Mendes <[EMAIL PROTECTED]> wrote: > >> Hi, > >> > >> I know that pyExelerator is the supported project now, but I can't use > >> it because I'd need it to generate files from a web platform. Since I > >> can not save a file to

Re: language design question

2006-07-09 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Length is an obvious property of any one-dimensional non-scalar, not just > strings. As such, it makes sense to have a length function that takes an > argument. As a design decision, it could go either way, but early > Python wasn't fully object-oriente

Re: language design question

2006-07-09 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > >> Now try to rewrite this using methods (member functions). > > [a.len() for a in ('abc', (1,2,3), [1,2], {1:2})] > > Did you actually try that? No of course not. It's in a hypothetical python where .len() is a class operation instead of a global fu

Re: language design question

2006-07-09 Thread Erik Max Francis
Steven D'Aprano wrote: > On Sun, 09 Jul 2006 22:45:53 +, OKB (not okblacke) wrote: > >> Terry Reedy wrote: >> >>> Consider >> map(len, ('abc', (1,2,3), [1,2], {1:2})) >>> [3, 3, 2, 1] >>> >>> Now try to rewrite this using methods (member functions). >> [a.len() for a in ('abc', (1,2,3), [

unistall python mechanize

2006-07-09 Thread bruce
hi.. i'm trying to figure out how to uninstall "mechanize". i don't see an "unistall" from the "python --help-commands" function... i'm looking to rebuild/reinstall mechanize from the svn repos to try to see if an apparent parsing issue that i mentioned is fixed... thanks -bruce -- http://m

Re: pyXLWriter - grid lines and if formula

2006-07-09 Thread Luis P. Mendes
Gregory Piñero escreveu: > On 7/7/06, Luis P. Mendes <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I know that pyExelerator is the supported project now, but I can't use >> it because I'd need it to generate files from a web platform. Since I >> can not save a file to a file-like object, I have to use py

help a newbie with a IDE/book combination

2006-07-09 Thread mamadu
Hi, I already have a couple of newbie books on Python itself, but would rather get started with a nice to use IDE and I am therefore looking for a good IDE to learn Python. On my computer I have installed eric (http://ericide.python-hosting.com/) but it lacks any kind of useful documentation on i

Re: language design question

2006-07-09 Thread Steven D'Aprano
On Sun, 09 Jul 2006 22:45:53 +, OKB (not okblacke) wrote: > Terry Reedy wrote: > >> Consider > map(len, ('abc', (1,2,3), [1,2], {1:2})) >> [3, 3, 2, 1] >> >> Now try to rewrite this using methods (member functions). > > [a.len() for a in ('abc', (1,2,3), [1,2], {1:2})] Did you actually

Validating Python - need doctype HTML strict

2006-07-09 Thread PapaRandy
Hello, I am trying to validate the following .py webpage as HTML (through W3C). I put: - print "Content-type: text/html; charset=utf-8" import time print print """ Current Time Current Time""" print "Right now

Re: language design question

2006-07-09 Thread Steven D'Aprano
On Sun, 09 Jul 2006 12:19:13 -0500, Gregory Guthrie wrote: > I am comparing Python to a few other scripting languages, and used a simple > anagrams program as a sample. > > I was surprised ast a few python features that did not work as I would > expect/wish; which caused less compact/expressive

Re: urllib2 on Windows Vista

2006-07-09 Thread Sriram Krishnan
Rune Strand wrote: > My wil guess is that it is a firewall problem. Perhaps you'll have to > specify that python.exe is trusted. Tried that - it didn't work. I also tried turning off the User Account Control and ran as full administrator - that didn't work too. -- http://mail.python.org/mailman

Re: language design question

2006-07-09 Thread Paul Rubin
"Terry Reedy" <[EMAIL PROTECTED]> writes: > Consider > >>> map(len, ('abc', (1,2,3), [1,2], {1:2})) > [3, 3, 2, 1] > > Now try to rewrite this using methods (member functions). [x.len() for x in ('abc', (1,2,3), [1,2], {1:2})] > > - Why doesn't sort() return a value? > > Because it is an in-pl

Re: language design question

2006-07-09 Thread OKB (not okblacke)
Terry Reedy wrote: > Consider map(len, ('abc', (1,2,3), [1,2], {1:2})) > [3, 3, 2, 1] > > Now try to rewrite this using methods (member functions). [a.len() for a in ('abc', (1,2,3), [1,2], {1:2})] -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, inste

Re: language design question

2006-07-09 Thread Terry Reedy
"Gregory Guthrie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > - why is len() not a member function of strings? Instead one says > len(w). Consider >>> map(len, ('abc', (1,2,3), [1,2], {1:2})) [3, 3, 2, 1] Now try to rewrite this using methods (member functions). > - Why d

Re: WANTED: logging of all file operations on Windows

2006-07-09 Thread Claudio Grondi
Tim Golden wrote: > Claudio Grondi wrote: > >> I am aware, that it is maybe the wrong group to ask this question, but >> as I would like to know the history of past file operations from >> within a Python script I see a chance, that someone in this group was >> into it already and is so kind to

Re: please remove posting we are receiving unsolicited emails

2006-07-09 Thread Terry Reedy
"homeprice maps" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >dear python , Python is a language, not a person that can act in in this universe. >as a result of the following posting we are receiving emails from >people >regarding services and websites we have no relation to.

Re: Size of hard drive and Mp3 tags functions

2006-07-09 Thread John Hicken
Dennis Lee Bieber wrote: > On 9 Jul 2006 11:14:25 -0700, "John Hicken" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > Anyway, there are two sorts of functions that could be useful. > > 1) A function that gives the size of a hard drive (or other drive, in > > this case t

Re: WANTED: logging of all file operations on Windows

2006-07-09 Thread Claudio Grondi
faulkner wrote: > you want a directory watching daemon. it isn't hard at all to build > from scratch. > first, determine which directories should be watched. > then, os.walk each directory, building a mapping from filename to mtime > [modified time; os.path.getmtime]. > next is your main event loop

Re: looping question 4 NEWB

2006-07-09 Thread manstey
Thanks Marc, that was very helpful. Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, manstey wrote: > > > I often have code like this: > > > > data='asdfbasdf' > > find = (('a','f')('s','g'),('x','y')) > > for i in find: > >if i[0] in data: > >data = data.replace(i[0],i[1]) >

Re: can't pickle instancemethod objects

2006-07-09 Thread Jim Lewis
> Here's a thought: comment out every attribute in your class, and then try > pickling it. If it succeeds, uncomment just *one* attribute, and try > pickling again. Repeat until pickling fails. Was trying to avoid that but you motivated me to do so and now I found the probem. In a utility routine

Re: Scope, type and UnboundLocalError

2006-07-09 Thread Paddy
Bruno Desthuilliers wrote: Ta. -- http://mail.python.org/mailman/listinfo/python-list

Re: Scope, type and UnboundLocalError

2006-07-09 Thread Paddy
Fredrik Lundh wrote: > Paddy wrote: > > > ... irrelevant as in 'although only mutable objects can have their > > state modified; if n has a mutable value but the assignment statement > > changed n to refer to another object, then the name would be tagged as > > local'? > > > > Oh bosh, can anyone

Re: Scope, type and UnboundLocalError

2006-07-09 Thread Bruno Desthuilliers
Paddy a écrit : > Dennis Lee Bieber wrote: > >>On 9 Jul 2006 11:30:06 -0700, "Paddy" <[EMAIL PROTECTED]> declaimed >>the following in comp.lang.python: >> >> >>>So, >>>An assignment statement may assign an object to a name, in which case >>>the name is 'tagged' as being local, >> >> Reverse..

Re: scheduling accuracy for audio

2006-07-09 Thread andrea valle
Thanks Paul, that's what I suspected. -a- On 9 Jul 2006, at 19:22, Paul Rubin wrote: > andrea valle <[EMAIL PROTECTED]> writes: >> In order to have sequencing I have to send at precise timing messages >> from Python to SC. Obviously, being a musical application, I need >> millisecond time accu

Re: Scope, type and UnboundLocalError

2006-07-09 Thread Paddy
Dennis Lee Bieber wrote: > On 9 Jul 2006 11:30:06 -0700, "Paddy" <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > > > So, > > An assignment statement may assign an object to a name, in which case > > the name is 'tagged' as being local, > > Reverse... Python does not "assi

Re: array of array of float

2006-07-09 Thread tac-tics
Use nested list comprehensions: matrix = [[0.0 for x in xrange(n)] for y in xrange(m)] This is similar to "float matrix[m][n]" in C. All cells are independent of each other in doing this. -- http://mail.python.org/mailman/listinfo/python-list

Re: array of array of float

2006-07-09 Thread Schüle Daniel
Schüle Daniel schrieb: > [EMAIL PROTECTED] schrieb: >> i used C too much and haven't used Python for a while... >> >> like in C, if we want an array of array of float, we use >> >> float a[200][500]; >> >> now in Python, seems like we have to do something like >> >> a = [ [ ] ] * 200 >> >> and then

Re: Scope, type and UnboundLocalError

2006-07-09 Thread Paddy
Bruno Desthuilliers wrote: > Paddy a écrit : > > Bruno Desthuilliers wrote: > > > >>Frank Millman a écrit : > >> > >>>Paddy wrote: > >>> > >>> > Hi, > I am trying to work out why I get UnboundLocalError when accessing an > int from a function where the int is at the global scope, witho

Re: array of array of float

2006-07-09 Thread Schüle Daniel
[EMAIL PROTECTED] schrieb: > i used C too much and haven't used Python for a while... > > like in C, if we want an array of array of float, we use > > float a[200][500]; > > now in Python, seems like we have to do something like > > a = [ [ ] ] * 200 > > and then just use > > a[1].append(12.3

Re: concatenate Numeric

2006-07-09 Thread Robert Kern
Sheldon wrote: > Hi, > > I am trying to build a large array using concatenate function in > python. > So as I loop over the number of arrays, of which there are 12 (4 down > and 3 across), I create 3 long arrays by concatenating them at the > bottom and then concatenating them side by side: [snip

RE: [wwwsearch-general] ClientForm request re ParseErrors

2006-07-09 Thread bruce
hi john... not sure exactly who i should talk to tabout this..but here goes... i have the following piece of code... i'm trying to do a select form, and my test throws an error... i have the actual form "main" in the html, so it should find it... as far as i can tell, i've followed the docs.. bu

Weekly Python Patch/Bug Summary

2006-07-09 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 393 open (+15) / 3315 closed (+17) / 3708 total (+32) Bugs: 908 open (+22) / 5975 closed (+49) / 6883 total (+71) RFE : 223 open ( -1) / 229 closed ( +2) / 452 total ( +1) New / Reopened Patches __ test_grp.

tk filesave dialog triggers unexpected destroy event

2006-07-09 Thread John Hunter
The following behavior surprised me. I have a Tk window and launch a file save dialog from it. When the filesave dialog is finished, it calls callbacks bound to the destroy event on the main window. Is this expected, and can I avoid this? To expose the problem, run this script and click the mo

Re: language design question

2006-07-09 Thread Paddy
Gregory Guthrie wrote: > I am comparing Python to a few other scripting languages, and used a simple > anagrams program as a sample. > > I was surprised ast a few python features that did not work as I would > expect/wish; which caused less compact/expressive program styles that I > wanted - rever

Re: Scope, type and UnboundLocalError

2006-07-09 Thread Bruno Desthuilliers
Paddy a écrit : > Bruno Desthuilliers wrote: > >>Frank Millman a écrit : >> >>>Paddy wrote: >>> >>> Hi, I am trying to work out why I get UnboundLocalError when accessing an int from a function where the int is at the global scope, without explicitly declaring it as global but not

Re: Nested scopes, and augmented assignment

2006-07-09 Thread Piet van Oostrum
> Antoon Pardon <[EMAIL PROTECTED]> (AP) wrote: >AP> When someone gets confused over the difference between rebinding or >AP> mutating a variable on an intermediate scope, the explanation he >AP> mostly seems to get boils down to: one is rebinding, the other is >AP> mutation, this is a fundame

Re: class members vs instance members

2006-07-09 Thread hdixon
Bruno Desthuilliers wrote: > hdixon a écrit : > > Ive spent a few days going thru a couple of Python tutorials. No > > problem until I got to classes. I guess my java mindset is blocking my > > vision. > > Then http://dirtsimple.org/2004/12/python-is-not-java.html > > > I've borrowed another threa

Re: array of array of float

2006-07-09 Thread DH
[EMAIL PROTECTED] wrote: > i used C too much and haven't used Python for a while... > > like in C, if we want an array of array of float, we use > > float a[200][500]; > > now in Python, seems like we have to do something like > > a = [ [ ] ] * 200 > > and then just use > > a[1].append(12.34)

Re: Scope, type and UnboundLocalError

2006-07-09 Thread Fredrik Lundh
Paddy wrote: > ... irrelevant as in 'although only mutable objects can have their > state modified; if n has a mutable value but the assignment statement > changed n to refer to another object, then the name would be tagged as > local'? > > Oh bosh, can anyone come at it from a different tack? l

Re: Scope, type and UnboundLocalError

2006-07-09 Thread Paddy
Paddy wrote: > > So, > An assignment statement may assign an object to a name, in which case > the name is 'tagged' as being local, > An assignment statement may mutate a mutable object already bound to a > name, in which case the assignment will not 'tag' the name as being > local. > > I guess

Re: Scope, type and UnboundLocalError

2006-07-09 Thread Paddy
Bruno Desthuilliers wrote: > Frank Millman a écrit : > > Paddy wrote: > > > >>Hi, > >>I am trying to work out why I get UnboundLocalError when accessing an > >>int from a function where the int is at the global scope, without > >>explicitly declaring it as global but not when accessing a list in >

Size of hard drive and Mp3 tags functions

2006-07-09 Thread John Hicken
I'm creating a Python program to pick a random set of mp3s, to copy to my mp3 player, so I can regularly get a new set to listen to. Anyway, there are two sorts of functions that could be useful. 1) A function that gives the size of a hard drive (or other drive, in this case the mp3 player itself)

Re: WANTED: logging of all file operations on Windows

2006-07-09 Thread Paul McGuire
"faulkner" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > you want a directory watching daemon. it isn't hard at all to build > from scratch. > first, determine which directories should be watched. > then, os.walk each directory, building a mapping from filename to mtime > [modified

Re: array of array of float

2006-07-09 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > i used C too much and haven't used Python for a while... > > like in C, if we want an array of array of float, we use > > float a[200][500]; > > now in Python, seems like we have to do something like > > a = [ [ ] ] * 200 > > and then just use > > a[1].append(12.34

array of array of float

2006-07-09 Thread Summercoolness
i used C too much and haven't used Python for a while... like in C, if we want an array of array of float, we use float a[200][500]; now in Python, seems like we have to do something like a = [ [ ] ] * 200 and then just use a[1].append(12.34) etc but it turns out that all 200 elements poin

Re: WANTED: logging of all file operations on Windows

2006-07-09 Thread Paul McGuire
"faulkner" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > you want a directory watching daemon. it isn't hard at all to build > from scratch. > first, determine which directories should be watched. > then, os.walk each directory, building a mapping from filename to mtime > [modified

Re: language design question

2006-07-09 Thread Bruno Desthuilliers
Gregory Guthrie a écrit : > I am comparing Python to a few other scripting languages, and used a simple > anagrams program as a sample. > > I was surprised ast a few python features that did not work as I would > expect/wish; which caused less compact/expressive program styles that I > wanted -

Re: language design question

2006-07-09 Thread Steven Bethard
Gregory Guthrie wrote: > For example, >- why is len() not a member function of strings? Instead one says len(w). Why would ``x.len()`` be any more convenient than ``len(x)``? Your preference here seems pretty arbitrary. > - Why doesn't sort() return a value? > > This would allow thing

Re: scheduling accuracy for audio

2006-07-09 Thread Paul Rubin
andrea valle <[EMAIL PROTECTED]> writes: > In order to have sequencing I have to send at precise timing messages > from Python to SC. Obviously, being a musical application, I need > millisecond time accuracy, with less latency as possible or at least a > fixed (short) latency. More, I need to have

Re: first book about python

2006-07-09 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > Yes, Perl IS harder to learn, BUT -- if you've already decided to learn > both languages, starting with the harder one need not be a bad idea (the > Romans' legions, back when they were the best soldiers in the world, "Learning Perl" is actually a very w

language design question

2006-07-09 Thread Gregory Guthrie
I am comparing Python to a few other scripting languages, and used a simple anagrams program as a sample. I was surprised ast a few python features that did not work as I would expect/wish; which caused less compact/expressive program styles that I wanted - reverting to a FORTRAN like series of

Re: HTTPBasicAuthHandler doesn't work

2006-07-09 Thread John J. Lee
[EMAIL PROTECTED] writes: > Hi ! > I'm trying to add the HTTP basic authentification to my web spider but > it doesn't work... > The HTTPBasicAuthHandler don't send the headers for authentification > :-( Hi Several bugs were fixed with Basic auth in Python 2.5. I'd be most grateful if you can v

Re: WANTED: logging of all file operations on Windows

2006-07-09 Thread Tim Golden
Claudio Grondi wrote: > I am aware, that it is maybe the wrong group to ask this question, but > as I would like to know the history of past file operations from within > a Python script I see a chance, that someone in this group was into it > already and is so kind to share here his experience.

Re: cookielib incorrectly escapes cookie

2006-07-09 Thread John J. Lee
"BJörn Lindqvist" <[EMAIL PROTECTED]> writes: > I have some very serious trouble getting cookes to work. After a lot > of work (urllib2 is severly underdocumented, arcane and overengineerd > btw) I'm finally able to accept cookes from a server. But I'm still And a good day to you too ;-) In pass

Re: first book about python

2006-07-09 Thread Alex Martelli
IOANNIS MANOLOUDIS <[EMAIL PROTECTED]> wrote: > I thank everybody for your replies. > I think I'll get Hertland's book since it's newer than O'reillys. > I don't want to become a programmer. Neither Python is part of my studies. > I've finished with my studies. I want to become a Unix/Linux admin

Re: first book about python

2006-07-09 Thread Alex Martelli
Aahz <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > IOANNIS MANOLOUDIS <[EMAIL PROTECTED]> wrote: > > > >I want to learn python. > >I plan to buy a book. I always find printed material more convenient than > >reading on-line tutorials. > >I don't know PERL or any other scripting l

Re: xml aggregator

2006-07-09 Thread Gerard Flanagan
Gerard Flanagan wrote: > kepioo wrote: > > Hi all, > > > > I am trying to write an xml aggregator, but so far, i've been failing > > miserably. > > > > what i want to do : > > > > i have entries, in a list format :[[key1,value],[key2,value],[ > > key3,value]], value] > > > > example : > > [["route

Re: can't pickle instancemethod objects

2006-07-09 Thread Steven D'Aprano
On Sun, 09 Jul 2006 08:39:29 -0700, Jim Lewis wrote: >> I'd suggest that "pop" could be your culprit. ...What is pop? A function or >> an instance method? > > Neither. pop is an instance of a class, like: > class X: >... > pop = X () > > pop surely is the culprit but it has arrays of object

Re: Nested scopes, and augmented assignment

2006-07-09 Thread Antoon Pardon
On 2006-07-08, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 8 Jul 2006 18:52:56 GMT, Antoon Pardon <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >> >> I'm not fooled by that phrase. I just think the mutate vs rebind >> explanation is not complete. >> >> If we have tw

Re: WANTED: logging of all file operations on Windows

2006-07-09 Thread faulkner
you want a directory watching daemon. it isn't hard at all to build from scratch. first, determine which directories should be watched. then, os.walk each directory, building a mapping from filename to mtime [modified time; os.path.getmtime]. next is your main event loop. this while loop consists o

Re: class members vs instance members

2006-07-09 Thread Bruno Desthuilliers
hdixon a écrit : > Ive spent a few days going thru a couple of Python tutorials. No > problem until I got to classes. I guess my java mindset is blocking my > vision. Then http://dirtsimple.org/2004/12/python-is-not-java.html > I've borrowed another thread's code snippet and cannot explain > the

Re: Nested scopes, and augmented assignment

2006-07-09 Thread Antoon Pardon
On 2006-07-09, Piet van Oostrum <[EMAIL PROTECTED]> wrote: >> Antoon Pardon <[EMAIL PROTECTED]> (AP) wrote: > >>AP> It is conceptually different. In the line 'a = b' you don't need to >>AP> search for the scope of a. You know it is the current scope, if you > > Except when it has been declared

Re: can't pickle instancemethod objects

2006-07-09 Thread Jim Lewis
> I'd suggest that "pop" could be your culprit. ...What is pop? A function or > an instance method? Neither. pop is an instance of a class, like: class X: ... pop = X () pop surely is the culprit but it has arrays of objects, etc., and I don't know what to look for. -- http://mail.python.or

class members vs instance members

2006-07-09 Thread hdixon
Ive spent a few days going thru a couple of Python tutorials. No problem until I got to classes. I guess my java mindset is blocking my vision. I've borrowed another thread's code snippet and cannot explain the results: class MyClass: list = [] myvar = 10 def add(self, x): self

Re: Module for creating a screenshot of a web page given a URL?

2006-07-09 Thread John J. Lee
[EMAIL PROTECTED] writes: > > Untestetd, but I'm pretty sure something like this will do. > > If you need more control, and on windows, try pywinauto > > I do need it to run on Windows. I'll check out pywinauto. Thanks. Note he didn't say you *need* pywinauto to run on Windows. John -- http:/

Re: can't pickle instancemethod objects

2006-07-09 Thread Steven D'Aprano
On Sun, 09 Jul 2006 07:06:25 -0700, Jim Lewis wrote: >> How about you post the complete stack trace of the exception? > > Exception in Tkinter callback > Traceback (most recent call last): > File "C:\program files\python\lib\lib-tk\Tkinter.py", line 1345, in > __call__ > return self.func(*a

Re: python guru for urllib/mechanize

2006-07-09 Thread John J. Lee
"bruce" <[EMAIL PROTECTED]> writes: > i'm trying to get the pages from a site "axess.stanford.edu", and i'm > running into problems. i've got some test code that allows me to get the 1st > few pages. i'm having an issue when i run into a page that somehow > interprets a url from a src of a framese

Re: xpath question...

2006-07-09 Thread John J. Lee
"bruce" <[EMAIL PROTECTED]> writes: > i have the following section of test code where i'm trying to get the > attribute of a frame > > > i'm trying to print/get the src value. the xpath query that i have displays > the "src" attribute in the Xpather/Firefox plugin. however, i can't quite > fi

Re: xml aggregator

2006-07-09 Thread Gerard Flanagan
kepioo wrote: > Hi all, > > I am trying to write an xml aggregator, but so far, i've been failing > miserably. > > what i want to do : > > i have entries, in a list format :[[key1,value],[key2,value],[ > key3,value]], value] > > example : > [["route","23"],["equip","jr2"],["time","3pm"]],"my first

Remembering History in code.InteractiveConsole

2006-07-09 Thread Chris Spencer
I'd like to make code.InteractiveConsole function just like the normal Python console. However, when I try to use the arrow keys to recall command history, all I get is ^[[A^[[B. I've seen the example at http://docs.python.org/lib/readline-example.html but this doesn't seem to work at all, altho

Re: first book about python

2006-07-09 Thread IOANNIS MANOLOUDIS
I thank everybody for your replies. I think I'll get Hertland's book since it's newer than O'reillys. I don't want to become a programmer. Neither Python is part of my studies. I've finished with my studies. I want to become a Unix/Linux admin and knowledge of either Python or Perl is an asset. Do

Re: python/xpath question...

2006-07-09 Thread John J. Lee
Stefan Behnel <[EMAIL PROTECTED]> writes: [...] > I'm not quite sure how this is supposed to be related to Python, but if you're > trying to find a sibling, what about using the "sibling" axis in XPath? There's no "sibling" axis in XPath. I'm sure you meant "following-sibling" and/or "preceding-

  1   2   >