Re: design question: no new attributes

2007-02-26 Thread Ben Finney
"Alan Isaac" <[EMAIL PROTECTED]> writes: > "Ben Finney" <[EMAIL PROTECTED]> wrote: > > The Pythonic design is: don't expect to have such control over > > users of your code. > > I know this is a popular response, but the fact of the matter > remains that it can be helpful to know when someone trie

Re: Jobs: Lisp and Python programmers wanted in the LA area

2007-02-26 Thread Tech HR
In article <[EMAIL PROTECTED]>, Tech HR <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Ray Dillinger <[EMAIL PROTECTED]> wrote: > > > Tech HR wrote: > > > > > But we're a very young company (barely six months old at this point) so > > > we're willing to listen to most anything

Re: Interactive os.environ vs. os.environ in script

2007-02-26 Thread boris . smirnov
On Feb 26, 5:44 pm, Thinker <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > > > > [EMAIL PROTECTED] wrote: > > > OK then I have to reformulate my question. :) > > > In my script I have a line with > > > os.environ["LD_LIBRARY_PATH"]='/path/Linux/rh_linux' > > > bu

Epydoc 3.0 beta release

2007-02-26 Thread Edward Loper
Epydoc 3.0 beta is now available for download from SourceForge. Epydoc is a tool for generating API documentation for Python modules, based on their docstrings. - The epydoc homepage. - Download epydoc 3.0 beta.

Re: How can I disable a device in windows using python

2007-02-26 Thread Tim Golden
Phoe6 wrote: > Hi all, > I am trying to disable the NIC card (and other cards) enabled in my > machine to test diagnostics on that card. > I am trying to disable it programmatic using python. I checked python > wmi and i could not find ways to disable/enable, (listing is however, > possible). Sinc

Re: design question: no new attributes

2007-02-26 Thread Arnaud Delobelle
On 27 Feb, 06:40, "Alan Isaac" <[EMAIL PROTECTED]> wrote: > So my question remains: > how best to trap any such attempt > subsequent to object initialization? > (I am willing to have properties for > all data attributes, if that helps.) > You can define the __setattr__ method in your class as def

Re: design question: no new attributes

2007-02-26 Thread Steven D'Aprano
On Tue, 27 Feb 2007 06:40:29 +, Alan Isaac wrote: > "Ben Finney" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> The Pythonic design is: don't expect to have such control over users >> of your code. > > I know this is a popular response, It's popular for good reason. > but

Re: How can I disable a device in windows using python

2007-02-26 Thread Gary Herron
Phoe6 wrote: > Hi all, > I am trying to disable the NIC card (and other cards) enabled in my > machine to test diagnostics on that card. > I am trying to disable it programmatic using python. I checked python > wmi and i could not find ways to disable/enable, (listing is however, > possible). > > W

Re: Jobs: Lisp and Python programmers wanted in the LA area

2007-02-26 Thread Tech HR
In article <[EMAIL PROTECTED]>, Bruce Lewis <[EMAIL PROTECTED]> wrote: > Tech HR <[EMAIL PROTECTED]> writes: > > > (Actually, > > it's turning out to be hard to find Python programmers too, but it's > > easier to train a Java programmer or a Perler on Python than Lisp. > > Is this speculation

How can I disable a device in windows using python

2007-02-26 Thread Phoe6
Hi all, I am trying to disable the NIC card (and other cards) enabled in my machine to test diagnostics on that card. I am trying to disable it programmatic using python. I checked python wmi and i could not find ways to disable/enable, (listing is however, possible). Where should I look for to en

Re: Jobs: Lisp and Python programmers wanted in the LA area

2007-02-26 Thread Tech HR
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: > You know about http://lispjobs.wordpress.com I presume. I did not. Thanks for the pointer. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to call os.path.join() on a list ...

2007-02-26 Thread greg
funkyj wrote: > What is the python idiom for callling a function like os.path.join() > that takes a variable number of arguments when you currently have the > arguements in a list variable? os.path.join(*list_of_args) This is preferable to joining it yourself with os.path.sep, because it wi

Re: Jobs: Lisp and Python programmers wanted in the LA area

2007-02-26 Thread Tech HR
In article <[EMAIL PROTECTED]>, Dan Bensen <[EMAIL PROTECTED]> wrote: > Tech HR wrote: > > easier to train a Java programmer or a Perler on Python than Lisp. > > Are your technical problems simple enough to be solved by Python trainees? Some are. Some aren't. That's why we're using Lisp too

Re: Jobs: Lisp and Python programmers wanted in the LA area

2007-02-26 Thread Tech HR
In article <[EMAIL PROTECTED]>, Ray Dillinger <[EMAIL PROTECTED]> wrote: > Tech HR wrote: > > > But we're a very young company (barely six months old at this point) so > > we're willing to listen to most anything at this point. (We're using > > Darcs for revision control. Haskell, anyone?) >

Re: wxPython - 2 x foldpanelbar with tree...

2007-02-26 Thread Franz Steinhaeusler
On 26 Feb 2007 06:50:11 -0800, "w.p." <[EMAIL PROTECTED]> wrote: >Hello! >I have some trouble with my GUI. I have left panel with foldpanelbar, >but i need one item but not collapsed - simple button. I split my left >panel into two foldpanelbars with one button between. >But a have trouble... >Sor

Re: design question: no new attributes

2007-02-26 Thread Alan Isaac
"Ben Finney" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The Pythonic design is: don't expect to have such control over users > of your code. I know this is a popular response, but the fact of the matter remains that it can be helpful to know when someone tries to set a value for

Re: classobj?

2007-02-26 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Venky wrote: >> Do you mean that you want to add it to globals()? >> >> globals()['SomeClass'] = cl >> >> myinst = SomeClass() >> print isinstance(myinst, SomeClass) >> print isinstance(myinst, BaseClass) >> > > Thanks. That's what I was looking for. Probably not becau

Re: How to use cmp() function to compare 2 files?

2007-02-26 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > File "./scripts/regressionTest.py", line 30, in getSnapShot > if (difflib.context_diff(f1.readlines(), f2.readlines()).len() == > 0): > # no difference > else: > # files are different > AttributeError: 'generator' objec

Re: Lists: Converting Double to Single

2007-02-26 Thread Scott David Daniels
Leif K-Brooks wrote: > [EMAIL PROTECTED] wrote: >> ... >> Unfortunately, when I try to use that last list in a NumPy function, >> I'm told that it cannot be broadcast to the correct shape. So, what I >> want to do is strip the extra brackes from each end to leave just >> [3.5, 4.5, 5.5, 6.5, 7.5].

Re: How to use cmp() function to compare 2 files?

2007-02-26 Thread [EMAIL PROTECTED]
On Feb 26, 10:53 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Feb 26, 10:22 pm, "Dan Bishop" <[EMAIL PROTECTED]> wrote: > > > > > On Feb 26, 10:09 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > i have 2 files which are different (1 line difference): > > > $ diff g

Re: a=b change b a==b true??

2007-02-26 Thread Gabriel Genellina
En Mon, 26 Feb 2007 11:26:43 -0300, <[EMAIL PROTECTED]> escribió: > It works great now. Thank you for all of your incredibly quick > replies. Now that you have solved your immediate problem, you could read: http://effbot.org/zone/python-objects.htm -- Gabriel Genellina -- http://mail.python.

Re: How to use cmp() function to compare 2 files?

2007-02-26 Thread [EMAIL PROTECTED]
On Feb 26, 10:22 pm, "Dan Bishop" <[EMAIL PROTECTED]> wrote: > On Feb 26, 10:09 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > i have 2 files which are different (1 line difference): > > $ diff groupresult20070226190027.xml groupresult20070226190027-2.xml > > 5c5 > > < x:22

Re: Pep 3105: the end of print?

2007-02-26 Thread Martin v. Löwis
Neil Cerutti schrieb: > On 2007-02-23, I V <[EMAIL PROTECTED]> wrote: >> While that's true, C++ compiler vendors, for example, take >> backwards compatibility significantly less seriously, it seems >> to me. > > Compiler vendors usually take care of their customers with > compiler switches that e

Re: Pep 3105: the end of print?

2007-02-26 Thread Martin v. Löwis
Edward K Ream schrieb: > In other words, the consequence of pep 3105 will be that *nobody* who wants > their app to be portable will be able to use print until *everybody* has > converted to Python 3.x. I doubt that is what Guido had in mind, but I may > be mistaken :-) That's not true. Many

Re: how to call os.path.join() on a list ...

2007-02-26 Thread Ben Finney
"funkyj" <[EMAIL PROTECTED]> writes: > I want to call os.path.join() on a list instead of a variable list of > arguments. I.e. > > [...] > >>> import os > >>> import string > >>> p = os.environ['PWD'] > >>> p > '/tmp/a/b/c/d' > >>> os.path.join(string.split(p, os.sep))

Re: How to use cmp() function to compare 2 files?

2007-02-26 Thread Dan Bishop
On Feb 26, 10:09 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > i have 2 files which are different (1 line difference): > $ diff groupresult20070226190027.xml groupresult20070226190027-2.xml > 5c5 > < x:22 y:516 w:740 h:120 area: > --- > > > x:22 y:516 w:740 h:1202 area: > > But when

Re: how to call os.path.join() on a list ...

2007-02-26 Thread funkyj
On Feb 26, 8:03 pm, "funkyj" <[EMAIL PROTECTED]> wrote: > I want to call os.path.join() on a list instead of a variable list of > arguments. I.e. > > [scr-misc] (186:0)$ python > iPython 2.4 (#2, Feb 18 2005, 16:39:27) > [GCC 2.95.4 20020320 [FreeBSD]] on freebsd4 > Type "help", "c

How to use cmp() function to compare 2 files?

2007-02-26 Thread [EMAIL PROTECTED]
Hi, i have 2 files which are different (1 line difference): $ diff groupresult20070226190027.xml groupresult20070226190027-2.xml 5c5 < x:22 y:516 w:740 h:120 area: --- > x:22 y:516 w:740 h:1202 area: But when I use the cmp() function to compare 2 files, it return "1", $ python Python 2.4.3 (#1,

how to call os.path.join() on a list ...

2007-02-26 Thread funkyj
I want to call os.path.join() on a list instead of a variable list of arguments. I.e. [scr-misc] (186:0)$ python iPython 2.4 (#2, Feb 18 2005, 16:39:27) [GCC 2.95.4 20020320 [FreeBSD]] on freebsd4 Type "help", "copyright", "credits" or "license" for more information. m>>>

Re: Is type object an instance or class?

2007-02-26 Thread Dan Bishop
On Feb 26, 8:00 pm, "JH" <[EMAIL PROTECTED]> wrote: > Hi > > I found that a type/class are both a subclass and a instance of base > type "object". > > It conflicts to my understanding that: > > 1.) a type/class object is created from class statement > 2.) a instance is created by "calling" a class

Re: Is type object an instance or class?

2007-02-26 Thread James Stroud
JH wrote: > Hi > > I found that a type/class are both a subclass and a instance of base > type "object". > > It conflicts to my understanding that: > > 1.) a type/class object is created from class statement > 2.) a instance is created by "calling" a class object. > > A object should not be bot

Re: Lists: Converting Double to Single

2007-02-26 Thread rshepard
On 2007-02-27, Leif K-Brooks <[EMAIL PROTECTED]> wrote: Lief, Bjoern: > l = l[0] Of course! If I had let it work in my mind overnight I would almost certainly have seen this. Thank you both for your patient responses, Rich -- http://mail.python.org/mailman/listinfo/python-list

Tip: 'Open IPython here' in Windows context menu

2007-02-26 Thread Karlo Lozovina
Based on the idea from 'Open Command Window Here' utility from MS - add a context menu item, which allows you to open IPython in selected directory. ---cut-here--- Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\ipython] @="IPython here" [HKEY_LOCAL_MACHI

Re: Probably somewhat silly newbie question

2007-02-26 Thread elgrandchignon
On Feb 26, 6:57 pm, James Stroud <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi all-- > > > Trying to learn Python w/little more than hobbyist (bordering on pro/ > > am, I guess) Perl as a background. > > > My problem is, I have a list of departments, in this instance, things > > like

Re: Probably somewhat silly newbie question

2007-02-26 Thread James Stroud
James Stroud wrote: > [EMAIL PROTECTED] wrote: > >> Hi all-- >> >> Trying to learn Python w/little more than hobbyist (bordering on pro/ >> am, I guess) Perl as a background. >> >> My problem is, I have a list of departments, in this instance, things >> like "Cheese", "Bakery", et al. (I work @ a

Re: Probably somewhat silly newbie question

2007-02-26 Thread James Stroud
[EMAIL PROTECTED] wrote: > Hi all-- > > Trying to learn Python w/little more than hobbyist (bordering on pro/ > am, I guess) Perl as a background. > > My problem is, I have a list of departments, in this instance, things > like "Cheese", "Bakery", et al. (I work @ a co-op health food store). > I'

Re: classobj?

2007-02-26 Thread Venky
... > > Do you mean that you want to add it to globals()? > > globals()['SomeClass'] = cl > > myinst = SomeClass() > print isinstance(myinst, SomeClass) > print isinstance(myinst, BaseClass) > > -- > Hope this helps, > Steven > > > Thanks. That's what I was looking for. -- http://mail.pyth

Probably somewhat silly newbie question

2007-02-26 Thread elgrandchignon
Hi all-- Trying to learn Python w/little more than hobbyist (bordering on pro/ am, I guess) Perl as a background. My problem is, I have a list of departments, in this instance, things like "Cheese", "Bakery", et al. (I work @ a co-op health food store). I've populated a list, 'depts', w/these, so

Re: classobj?

2007-02-26 Thread attn . steven . kuo
On Feb 26, 5:43 pm, Venky <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to create classes at runtime based on input from a textfile. > I am trying to use the function new.classobj. I am able to create the > new classes successfully, however I fail to understand on how to add > this new class to

Is type object an instance or class?

2007-02-26 Thread JH
Hi I found that a type/class are both a subclass and a instance of base type "object". It conflicts to my understanding that: 1.) a type/class object is created from class statement 2.) a instance is created by "calling" a class object. A object should not be both a class and an instance at the

classobj?

2007-02-26 Thread Venky
Hi, I am trying to create classes at runtime based on input from a textfile. I am trying to use the function new.classobj. I am able to create the new classes successfully, however I fail to understand on how to add this new class to the current dictionary. cl = new.classobj('SomeClass', (Base

Re: Jobs: Lisp and Python programmers wanted in the LA area

2007-02-26 Thread Dan Bensen
> Tech HR wrote: > easier to train a Java programmer or a Perler on Python than Lisp. Dan Bensen wrote: > Are your technical problems simple enough to be solved by Python > trainees? Aahz wrote: > If they're already good programmers, yes. Sure, but who are these good programmers (coming from J

Re: Lists: Converting Double to Single

2007-02-26 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > I end up with a single list, but with two brackets on each end, > for example, [[3.5, 4.5, 5.5, 6.5, 7.5]]. > > Unfortunately, when I try to use that last list in a NumPy > function, I'm > told that it cannot be broadcast to the correct shape. So, what I > want to d

Re: Preallocate? -- potentially brain dead question about performance

2007-02-26 Thread Jan Danielsson
[EMAIL PROTECTED] wrote: >>newlist = [ None ] * len(mylist) >>for i in range(len(mylist)): >> newlist.append(int(e[0])) > > Note that this appends after the Nones, not over them. And note that > here the name 'e' is undefined. What an idiot I am.. Yes, I know that.. And I actuall

ArcGIS and Python

2007-02-26 Thread mjl8379
Is there any online resource where I can check for ArcGIS scripting? Maybe a forum? Mario -- http://mail.python.org/mailman/listinfo/python-list

Re: getting terminal display size?

2007-02-26 Thread jeff
On Feb 26, 8:01 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-02-27, jeff <[EMAIL PROTECTED]> wrote: > > > I don't really understand any of that; can you right me a function > > that'll return the size as a tuple? > > What do you think I posted? > > -- > Grant Edwards gra

Re: Lists: Converting Double to Single

2007-02-26 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote: > So I have lists that look like this: [1, 2, 3, 4, 5]. When I > concatenate lists, I end up with a list of lists that looks like > this: [[1, 2, 3. 4, 5]. [6, 7. 8, 9. 10]]. Really? >>> [1, 2, 3, 4, 5] + [6, 7, 8, 9, 10] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] > Then, I aver

Re: getting terminal display size?

2007-02-26 Thread Grant Edwards
On 2007-02-27, jeff <[EMAIL PROTECTED]> wrote: > I don't really understand any of that; can you right me a function > that'll return the size as a tuple? What do you think I posted? -- Grant Edwards grante Yow! I selected E5... but

Re: is it possible to use ironpython 1.1 in visual studio 2005

2007-02-26 Thread hrh1818
For those who don't subscribe to the Iron Python Mail Group check the following answer to this question. This was good heads up for me http://blogs.msdn.com/533273.aspx Howard On Feb 26, 3:15 pm, "jojoba" <[EMAIL PROTECTED]> wrote: > hi all > is it possible to use ironpython 1.1 in visual stu

Re: getting terminal display size?

2007-02-26 Thread Joshua J. Kugler
jeff wrote: > I don't really understand any of that; can you right me a function > that'll return the size as a tuple? Did you even *try* his code? I ran this: import termios, fcntl, struct, sys s = struct.pack("", 0, 0, 0, 0) fd_stdout = sys.stdout.fileno() x = fcntl.ioctl(fd_stdout, ter

Lists: Converting Double to Single

2007-02-26 Thread rshepard
I start with a list of tuples retrieved from a database table. These tuples are extracted and put into individual lists. So I have lists that look like this: [1, 2, 3, 4, 5]. When I concatenate lists, I end up with a list of lists that looks like this: [[1, 2, 3. 4, 5]. [6, 7. 8, 9. 10]]. Then, I

Re: getting terminal display size?

2007-02-26 Thread jeff
I don't really understand any of that; can you right me a function that'll return the size as a tuple? -- http://mail.python.org/mailman/listinfo/python-list

Re: gmpy moving to code.google.com

2007-02-26 Thread Alex Martelli
On 2/26/07, Daniel Nogradi <[EMAIL PROTECTED]> wrote: ... > Svn checkout, compilation and installation went okay but some tests > failed, this is the output of 'python test_gmpy.py': Thanks for the report! That test is trying to check that a previously existing memory leak went away, and unfor

Re: Jobs: Lisp and Python programmers wanted in the LA area

2007-02-26 Thread Aahz
In article <[EMAIL PROTECTED]>, Dan Bensen <[EMAIL PROTECTED]> wrote: >Tech HR wrote: >> >> easier to train a Java programmer or a Perler on Python than Lisp. > >Are your technical problems simple enough to be solved by Python trainees? If they're already good programmers, yes. -- Aahz ([EMAIL

Re: design question: no new attributes

2007-02-26 Thread Ben Finney
"Alan Isaac" <[EMAIL PROTECTED]> writes: > I have a class whose instances should only receive attribute > assignments for attributes that were created at inititialization. > If slots are not appropriate, what is the Pythonic design for this? The Pythonic design is: don't expect to have such contr

Why does SocketServer default allow_reuse_address = false?

2007-02-26 Thread Joshua J. Kugler
Considering that UNIX Network Programming, Vol 1 (by W. Richard Stevens) recommends "_All_ TCP servers should specify [SO_REUSEADDR] to allow the server to be restarted [if there are clients connected]," and that self.allow_reuse_address = False makes restarting a server a pain if there were connec

Re: pickle problem - frexp() out of range

2007-02-26 Thread Ziga Seilnacht
ahaldar wrote: > Hi: > > I have some large data structure objects in memory, and when I attempt > to pickle them, I get the following error: > > SystemError: frexp() out of range > > Are there some objects that are just too large to serialize, and if > so, is there an easy workaround without breaki

Re: Preallocate? -- potentially brain dead question about performance

2007-02-26 Thread bearophileHUGS
Jan Danielsson: >newlist = [ None ] * len(mylist) >for i in range(len(mylist)): > newlist.append(int(e[0])) Note that this appends after the Nones, not over them. And note that here the name 'e' is undefined. The most used idiom for that is: newlist = [int(e[0]) for e in mylist] O

Re: pickle problem - frexp() out of range

2007-02-26 Thread Irmen de Jong
ahaldar wrote: > Hi: > > I have some large data structure objects in memory, and when I attempt > to pickle them, I get the following error: > > SystemError: frexp() out of range > > Are there some objects that are just too large to serialize, and if > so, is there an easy workaround without bre

Preallocate? -- potentially brain dead question about performance

2007-02-26 Thread Jan Danielsson
Hello all, I have a list which contains a bunch of tuples: mylist = [ ('1', 'Foobar'), ('32', 'Baz'), ('4', 'Snorklings') ] (The list can potentially be shorter, or much longer). Now I want to take the first element in each tuple and store it in a list (to use in a Set later on). Wh

what the heck is going on here?

2007-02-26 Thread [EMAIL PROTECTED]
I found the following ways to generate permutations on the ASPN: Python Cookbook page. SLOW (two defs): def xcombinations(items,n): if n == 0: yield[] else: for i in xrange(len(items)): for cc in xcombinations(items[:i]+items[i+1:],n-1): yield [items[i

Re: Walk thru each subdirectory from a top directory

2007-02-26 Thread Adam
Whoops, the first bit of my reply ended up in the quoted text. See above. Adam -- http://mail.python.org/mailman/listinfo/python-list

pickle problem - frexp() out of range

2007-02-26 Thread ahaldar
Hi: I have some large data structure objects in memory, and when I attempt to pickle them, I get the following error: SystemError: frexp() out of range Are there some objects that are just too large to serialize, and if so, is there an easy workaround without breaking up the object and reconstru

Re: Walk thru each subdirectory from a top directory

2007-02-26 Thread Adam
On Feb 26, 9:28 pm, [EMAIL PROTECTED] wrote: > i am trying to use python to walk thru each subdirectory from a top > directory. Here is my script: > > savedPagesDirectory = "/home/meryl/saved_pages/data" > > dir=open(savedPagesDirectory, 'r') > > for file in dir: > if (isdir(file)): >

Re: how can I create/set a 'file' reference in a attribute of a class

2007-02-26 Thread Bjoern Schliessmann
ken wrote: > Hi, > i have a class: > > class LogHandler(ContentHandler): > # a reference to a file open by some other function/class > outputFile; What do you intend to achieve with this last line, and what's the ';' for? > First, I get an error saying 'NameError: global name 'outputFil

Re: how can I create/set a 'file' reference in a attribute of a class

2007-02-26 Thread Larry Bates
ken wrote: > Hi, > i have a class: > > class LogHandler(ContentHandler): > # a reference to a file open by some other function/class > outputFile; > > > def endElement(self, name): > doSomething(self, "GroupResultList", self.text, outputFile) > > > First, I get an error sa

how can I create/set a 'file' reference in a attribute of a class

2007-02-26 Thread ken
Hi, i have a class: class LogHandler(ContentHandler): # a reference to a file open by some other function/class outputFile; def endElement(self, name): doSomething(self, "GroupResultList", self.text, outputFile) First, I get an error saying 'NameError: global name 'outputF

Re: design question: no new attributes

2007-02-26 Thread Larry Bates
Alan Isaac wrote: > I have a class whose instances should only receive attribute > assignments for attributes that were created at inititialization. > If slots are not appropriate, what is the Pythonic design for this? > > Thanks, > Alan Isaac > > My understanding of "Pythonic design" is not to

Re: modifying a list while iterating through

2007-02-26 Thread Steven D'Aprano
On Mon, 26 Feb 2007 13:45:36 -0800, dustin.getz wrote: > My original question still stands, though, in situations where a > simple string replacement might not be sufficient. Is there a way to > insert into a list whilst iterating through it? Inserting/deleting from a list while you're walking t

Re: Python+Windows specific questions

2007-02-26 Thread hg
hg wrote: > Hi, > > Do I need the pywin32 extentions to: > > 1) change the pc system date ? > 2) launch a ppp connection ? > > Thanks, > > hg Yes to both I guess. hg -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie in the deep - some PyGTK questions

2007-02-26 Thread Dieter Verfaillie
On Mon, 2007-02-26 at 20:58 +, nmp wrote: > I did that and it works now :) Thank you, I had indeed been playing with > those options but not being entirely sure what they did I also forgot > about them... Happy it worked out :) > Yes, I found that a short time after I posted my question and

Re: 2.4->2.5 current directory change?

2007-02-26 Thread Ziga Seilnacht
Chris Mellon wrote: > Considering that it's a backwards incompatible breaking change > (although I understand why it was done), you'd think it deserved > mention in the more prominent "Whats new in Python 2.5" section on the > website, in addition to a one-liner in the NEWS file. Ah well, while > I

Re: Help on Dict

2007-02-26 Thread Steven D'Aprano
On Mon, 26 Feb 2007 18:16:13 +, Dennis Lee Bieber wrote: > On Mon, 26 Feb 2007 17:58:34 +1100, Steven D'Aprano > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > >> >> Which I think was deliberate. The Original Poster asked a reasonable >> question in a stupid way (Python

Re: Walk thru each subdirectory from a top directory

2007-02-26 Thread Jeff McNeil
Isn't this something that os.walk would be good for? import os for t in os.walk(base_dir): for f in t[2]: print "/".join((t[0], f)) Jeff On Feb 26, 2007, at 4:42 PM, Sick Monkey wrote: I had a do something similar. I had to get a program to traverse through a directory and delet

design question: no new attributes

2007-02-26 Thread Alan Isaac
I have a class whose instances should only receive attribute assignments for attributes that were created at inititialization. If slots are not appropriate, what is the Pythonic design for this? Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Walk thru each subdirectory from a top directory

2007-02-26 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > i am trying to use python to walk thru each subdirectory from a top > directory. Here is my script: > > savedPagesDirectory = "/home/meryl/saved_pages/data" > > dir=open(savedPagesDirectory, 'r') > > for file in dir: > if (isdir(file)): > # get the full

Re: modifying a list while iterating through

2007-02-26 Thread dustin . getz
On Feb 25, 9:15 pm, [EMAIL PROTECTED] wrote: > On Feb 25, 5:12 pm, [EMAIL PROTECTED] wrote: > > > consider the following working loop where Packet is a subclass of > > list, with Packet.insert(index, iterable) inserting each item in > > iterable into Packet at consecutive indexes starting at index.

Re: Walk thru each subdirectory from a top directory

2007-02-26 Thread Sick Monkey
I had a do something similar. I had to get a program to traverse through a directory and delete all files with a specific file extension. (The program below will delete files, so I do not recommend you running it without paying close attention to it.) This program will start at a given director

Re: Add images together

2007-02-26 Thread bearophileHUGS
On Feb 26, 10:16 pm, "iceman" <[EMAIL PROTECTED]> wrote: > a)Yes, I am using PIL. > b)The color of each pixel over a sequence of frames I think PIL has it for 2 images, you may have to build a binary tree of merged images: http://www.pythonware.com/library/pil/handbook/image.htm#blend Bye, bearop

Re: Add images together

2007-02-26 Thread zefciu
iceman wrote: > a)Yes, I am using PIL. > b)The color of each pixel over a sequence of frames > If you want to add numerical values of each pixel's colour then itereate through the pixels using nested for loops. But I (and I thing the rest of people here) can't be sure, what in fact you are tryi

Walk thru each subdirectory from a top directory

2007-02-26 Thread silverburgh . meryl
i am trying to use python to walk thru each subdirectory from a top directory. Here is my script: savedPagesDirectory = "/home/meryl/saved_pages/data" dir=open(savedPagesDirectory, 'r') for file in dir: if (isdir(file)): # get the full path of the file fileName = savedPages

Re: Jobs: Lisp and Python programmers wanted in the LA area

2007-02-26 Thread Dan Bensen
Tech HR wrote: > easier to train a Java programmer or a Perler on Python than Lisp. Are your technical problems simple enough to be solved by Python trainees? -- Dan www.prairienet.org/~dsb -- http://mail.python.org/mailman/listinfo/python-list

Re: Jobs: Lisp and Python programmers wanted in the LA area

2007-02-26 Thread Paul Rubin
Tech HR <[EMAIL PROTECTED]> writes: > No, it doesn't mean that. In fact, there is a significant faction in > the technical staff (including the CTO) who would like nothing better > than to be able to use Lisp instead of Python. But we have some pretty > compelling reasons to stick with Python,

Re: 2.4->2.5 current directory change?

2007-02-26 Thread Chris Mellon
On 26 Feb 2007 13:00:55 -0800, Ziga Seilnacht <[EMAIL PROTECTED]> wrote: > On Feb 26, 7:44 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > This appears to be a change in behavior from Python 2.4 to Python 2.5, > > which I can't find documented anywhere. It may be windows only, or > > related to W

Re: Add images together

2007-02-26 Thread iceman
a)Yes, I am using PIL. b)The color of each pixel over a sequence of frames -- http://mail.python.org/mailman/listinfo/python-list

is it possible to use ironpython 1.1 in visual studio 2005

2007-02-26 Thread jojoba
hi all is it possible to use ironpython 1.1 in visual studio 2005? i have 1.0 running great...but would love to use the newer verision any ideas thank you immenely, jojoba -- http://mail.python.org/mailman/listinfo/python-list

Re: getting info on remote files

2007-02-26 Thread Larry Bates
[EMAIL PROTECTED] wrote: > hello everyone, > > Im trying to write some python code that will return information (file > size, last modified ...) about files on a remote computer that I have > 'no password' ssh access to. Ive been able to write code that logs on > to remote computers and I can iss

Re: getting info on remote files

2007-02-26 Thread Sick Monkey
You should use os.popen() instead of os.system. os.popen() will return a file-like object that is connected to the stdout of the system command; you can then use that object's read()/readlines() method(s) to assign that output to a Python variable. http://docs.python.org/lib/module-popen2.html

Re: Python object to xml biding

2007-02-26 Thread sjpiii
"raf" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi there, > > > I'm looking for a python to XSD/xml biding library to easy handling > this very large protocol spec I need to tackle. I've searched google > quite extensibly and I haven't found anything that properly fits the > bi

Re: 2.4->2.5 current directory change?

2007-02-26 Thread Ziga Seilnacht
On Feb 26, 7:44 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > This appears to be a change in behavior from Python 2.4 to Python 2.5, > which I can't find documented anywhere. It may be windows only, or > related to Windows behavior. > > In 2.4, the current directory (os.curdir) was on sys.path. I

Re: Add images together

2007-02-26 Thread bearophileHUGS
iceman: > What i am trying to do > is to calculate a color-over-time-function for each pixel. Are you using PIL? What does it means color-over-time-function? Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

getting info on remote files

2007-02-26 Thread gabriel . altay
hello everyone, Im trying to write some python code that will return information (file size, last modified ...) about files on a remote computer that I have 'no password' ssh access to. Ive been able to write code that logs on to remote computers and I can issue a command using, os.system(ssh bl

Re: starship.python.net is down

2007-02-26 Thread Tom Bryan
[EMAIL PROTECTED] wrote: > Any news on starship.python.net? It still seems to be down. Yes. Unfortunately, there may be a hardware problem. Stefan, the admin who owns the hosted machine, is working with the host company to determine what's going on. I think that they are still in the "inve

Re: Add images together

2007-02-26 Thread Bruno Desthuilliers
iceman a écrit : > Hi, > > I am trying to add together a number of images: > > im = image1 + image2 + ... > > How can i do this? > > I have tried to add two image instances > together but i get the following error: > TypeError: unsupported operand type(s) for +: 'instance' and > 'instance' >

Re: SystemError: new style getargs format but argument is not a tuple

2007-02-26 Thread zefciu
Ziga Seilnacht wrote: > The second example uses your approach and is a bit more cumbersome, > but still works. Could you post your current version of the code? > I don't understand where your problem could be. I think, there's no need to. Now I understand :) > if (!PyArg_ParseTuple(args, "O

Re: Add images together

2007-02-26 Thread iceman
What i am trying to do is to separate the foreground object from the background.All my images contain a foreground object (i don't have a reference image). What i am trying to do is to calculate a color-over-time-function for each pixel. -- http://mail.python.org/mailman/listinfo/python-list

Re: gmpy moving to code.google.com

2007-02-26 Thread Daniel Nogradi
> If you're interested in gmpy (the Python wrapper of GMP, for > unlimited-precision arithmetic, rationals, random number generation, > number-theoretical functions, etc), please DO check out > http://code.google.com/p/gmpy/ -- gmpy 1.02 is there (as far as I can > tell) in a workable state. Sourc

Re: about framework

2007-02-26 Thread Bruno Desthuilliers
raf a écrit : > On Feb 24, 10:09 pm, [EMAIL PROTECTED] wrote: > >>Python has some web framework.I'm not familiar with all of them. >>Do you think which is best popular of them?Thanks. >>** AOL now offers free >>email to everyone. Find out more about what's fre

RE: a=b change b a==b true??

2007-02-26 Thread Delaney, Timothy (Tim)
[EMAIL PROTECTED] wrote: > All, > It works great now. Thank you for all of your incredibly quick > replies. > Rob You should have a read of these: http://wiki.python.org/moin/BeginnersGuide http://effbot.org/zone/python-objects.htm Cheers, Tim Delaney -- http://mail.python.org/mailman/listin

RE: [OT] python notation in new NVIDIA architecture

2007-02-26 Thread Delaney, Timothy (Tim)
Daniel Nogradi wrote: >>> Something funny: >>> >>> The new programming model of NVIDIA GPU's is called CUDA and I've >>> noticed that they use the same __special__ notation for certain >>> things as does python. For instance their modified C language has >>> identifiers such as __device__, __glob

  1   2   >