Re: Python script to install network printers

2005-10-05 Thread future_retro
The target OS needs to support WMI so 2000 or XP. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python script to install network printers

2005-10-05 Thread future_retro
These functions should get you started and probably finished... def createprinterport(IPAddress,ServerName): WBEM = win32com.client.GetObject(r"winmgmts:{impersonationLevel=impersonate}!\\" + ServerName + r"\root\cimv2") WBEM.Security_.Privileges.AddAsString("SeLoadDriverPrivilege") pr

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

2005-10-05 Thread Brian Quinlan
Paul Rubin wrote: > Brian Quinlan <[EMAIL PROTECTED]> writes: > >>Have those of you who think that the lack of required declarations in >>Python is a huge weakness given any thought to the impact that adding >>them would have on the rest of the language? I can't imagine how any >>language with req

Re: dictionary interface

2005-10-05 Thread Paul Rubin
Antoon Pardon <[EMAIL PROTECTED]> writes: > My tree class is almost finished, but one unittest still fails, > is this a failing of my class (as a replacement for a dictionary) > or is this a non-required characteristic of dictionaries? If it were me, I'd treat the language reference manual as auth

Re: dictionary interface

2005-10-05 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > I can't help wondering, though, under what conditions it actually > makes sense to compare two dictionaries for anything other than > equality. You might want to sort a bunch of dictionaries to bring the equal ones together. -- http://mail.python.org/mai

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

2005-10-05 Thread Paul Rubin
Brian Quinlan <[EMAIL PROTECTED]> writes: > > Python already has a "global" declaration; > > Which is evaluated at runtime, does not require that the actual global > variable be pre-existing, and does not create the global variable if > not actually assigned. I think that is pretty different than

Re: dictionary interface

2005-10-05 Thread Antoon Pardon
Op 2005-10-05, Paul Rubin schreef : > Antoon Pardon <[EMAIL PROTECTED]> writes: >> But that is contradicted by the unittest. If you have a unittest for >> comparing dictionaries, that means comparing dictionaries has a >> testable characteristic and thus is further defined. > > No, I don't think so

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

2005-10-05 Thread Duncan Booth
Antoon Pardon wrote: > It also is one possibility to implement writable closures. > > One could for instace have a 'declare' have the effect that > if on a more inner scope such a declared variable is (re)bound it > will rebind the declared variable instead of binding a local name. That is one p

Re: Pygame: Filling the screen with tile images

2005-10-05 Thread Ben Sizer
I don't think PyGame will handle tiling for you, or any concept of a 'background image'. If you want something to appear multiple times on the screen, you need to draw it multiple times. If you do that onto a surface that is the same size as your screen, you can then consider that the background im

Re: Confused with module and .py files

2005-10-05 Thread Steve Holden
Iyer, Prasad C wrote: > Actually I am bit confused between the modules and .py file > How do I differentiate between the 2. > > For example > I have a file import1.py, import2.py file > Which has few functions and classes > And if I have a class with same name "BaseClass" in both the file > > How

Re: New project coming up...stay with Python, or go with a dot net language??? Your thoughts please!

2005-10-05 Thread adDoc's networker Phil
On 10/4/05, Cameron Laird <[EMAIL PROTECTED]> wrote:   Python IS "a dot net language" http://ironpython.com/ >. . that is the site it was born at; but microsoft has actively adopted it here: IronPython 0.9.2 (9/22/2005) [EMAIL PROTECTED] http://www.microsoft.com/downloads/details.aspx?FamilyID=2C

Re: dictionary interface

2005-10-05 Thread Steve Holden
Antoon Pardon wrote: > Op 2005-10-05, Tom Anderson schreef <[EMAIL PROTECTED]>: > >>On Tue, 4 Oct 2005, Robert Kern wrote: >> >> >>>Antoon Pardon wrote: >>> >>> class Tree: def __lt__(self, term): return set(self.iteritems()) < set(term.iteritems()) def __

Re: 2 class with same name in different module

2005-10-05 Thread Fredrik Lundh
> thats a syntax error; I assume you meant message = message.replace( "a syntax error", "almost always an import error (no module named py)" ) -- http://mail.python.org/mailman/listinfo/python-list

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

2005-10-05 Thread Magnus Lycka
James A. Donald wrote: > What can one do to swiftly detect this type of bug? Unit tests. In my experience the edit - test cycle in Python is typically roughly as fast as the edit - compile cycle in e.g. C++, and much faster than the full edit - compile - link - test cycle in C++. You do use autom

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

2005-10-05 Thread Antoon Pardon
Op 2005-10-05, Duncan Booth schreef <[EMAIL PROTECTED]>: > Paul Rubin wrote: > >> Brian Quinlan <[EMAIL PROTECTED]> writes: >>> Have those of you who think that the lack of required declarations in >>> Python is a huge weakness given any thought to the impact that adding >>> them would have on the

Re: Confused with module and .py files

2005-10-05 Thread Fredrik Lundh
"Iyer, Prasad C" wrote: > How would I use it if I declare it as given below in my 3rd class > > from import1.py import * > from import2.py import * thats a syntax error; I assume you meant from import1 import * from import2 import * which simply doesn't work if you need to access things

Re: Confused with module and .py files

2005-10-05 Thread Roel Schroeven
Iyer, Prasad C wrote: > Actually I am bit confused between the modules and .py file > How do I differentiate between the 2. > > For example > I have a file import1.py, import2.py file > Which has few functions and classes > And if I have a class with same name "BaseClass" in both the file > > How

Re: IDLE dedent/unindent key bindings for non-us keybord?

2005-10-05 Thread Franz Steinhaeusler
On 2 Oct 2005 08:52:53 -0700, [EMAIL PROTECTED] wrote: >Hi. > >I use Idle 1.1.1 on Python 2.4.1. > >The "Ctrl-[" and "Ctrl-]" key bindings for indenting do not work on >non-us keyboards where brackets are accessed by the "Alt Gr" key. > >The Tab key seem to work for indenting a selected textblock

Re: dictionary interface

2005-10-05 Thread Paul Rubin
Antoon Pardon <[EMAIL PROTECTED]> writes: > But that is contradicted by the unittest. If you have a unittest for > comparing dictionaries, that means comparing dictionaries has a > testable characteristic and thus is further defined. No, I don't think so. The unittest makes sure that a particular

Re: dictionary interface

2005-10-05 Thread Antoon Pardon
Op 2005-10-05, Tom Anderson schreef <[EMAIL PROTECTED]>: > On Tue, 4 Oct 2005, Robert Kern wrote: > >> Antoon Pardon wrote: >> >>> class Tree: >>> >>> def __lt__(self, term): >>> return set(self.iteritems()) < set(term.iteritems()) >>> >>> def __eq__(self, term): >>> return se

Re: Confused with module and .py files

2005-10-05 Thread Satchidanand Haridas
Iyer, Prasad C wrote: >Actually I am bit confused between the modules and .py file >How do I differentiate between the 2. > > > A module 'name' is the same as the name of your file without the '.py' extension. >For example >I have a file import1.py, import2.py file >Which has few functions and

Re: Does any one recognize this binary data storage format

2005-10-05 Thread Christos Georgiou
On Wed, 10 Aug 2005 13:23:22 GMT, rumours say that [EMAIL PROTECTED] (Bengt Richter) might have written: >BTW, my second post was doing ''.join(chr(int(h[i:i+2],16)) for i in >xrange(0,16,2)) >to undo the hexlify you had done (I'd forgotten that there's a >binascii.unhexlify ;-) And there's als

Confused with module and .py files

2005-10-05 Thread Iyer, Prasad C
Actually I am bit confused between the modules and .py file How do I differentiate between the 2. For example I have a file import1.py, import2.py file Which has few functions and classes And if I have a class with same name "BaseClass" in both the file How would I use it if I declare it as give

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

2005-10-05 Thread Paul Rubin
Magnus Lycka <[EMAIL PROTECTED]> writes: > It seems you've missed the entire point of using a dynamically > typed language. It's not just about saving typing time and making > your methods take up fewer lines of code. It's about writing generic > code. Just look at C++ with all that mess with compl

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

2005-10-05 Thread Paul Rubin
Duncan Booth <[EMAIL PROTECTED]> writes: > If you think variable declarations should be required, I don't think they should be required. I think there should optional declarations along with a compiler flag that checks for them if the user asks for it, like Perl has. > then you presumably want t

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

2005-10-05 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > Some people just don't get the simple fact that declarations are > essentially kind of unit test you get for free (almost), and the compiler > is a testing framework for them. It seems you've missed the entire point of using a dynamically typed language. It's not just ab

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

2005-10-05 Thread Antoon Pardon
Op 2005-10-04, Ron Adam schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Op 2005-10-03, Steven D'Aprano schreef <[EMAIL PROTECTED]>: >>> >>>And lo, one multi-billion dollar Mars lander starts braking either too >>>early or too late. Result: a new crater on Mars, named after the NASA >>>employ

Re: how to get any available port

2005-10-05 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Apparently, calling bind() with a zero "port" will choose some available port > number, as demonstrated by this program: > > import socket > s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > s.bind(("", 0)) > print s.getsockname() > > Here's how it behaved over se

Re: 2 class with same name in different module

2005-10-05 Thread Fredrik Lundh
"Iyer, Prasad C" wrote: > I have a class in a module which is getting imported in main module. > How do you differentiate between the 2 class if you have one class in a module, why do you need to differentiate between it? assuming that you do in fact have *two* classes with the same name in two

Re: 2 class with same name in different module

2005-10-05 Thread Leif K-Brooks
Iyer, Prasad C wrote: > I have a class in a module which is getting imported in main module. > How do you differentiate between the 2 class import foo import bar foo.TheClass().dostuff() bar.TheClass().dostuff() -- http://mail.python.org/mailman/listinfo/python-list

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

2005-10-05 Thread Duncan Booth
Paul Rubin wrote: > Brian Quinlan <[EMAIL PROTECTED]> writes: >> Have those of you who think that the lack of required declarations in >> Python is a huge weakness given any thought to the impact that adding >> them would have on the rest of the language? I can't imagine how any >> language with r

2 class with same name in different module

2005-10-05 Thread Iyer, Prasad C
I have a class in a module which is getting imported in main module. How do you differentiate between the 2 class regards prasad chandrasekaran This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the p

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

2005-10-05 Thread Antoon Pardon
Op 2005-10-04, Mike Meyer schreef <[EMAIL PROTECTED]>: > Antoon Pardon <[EMAIL PROTECTED]> writes: >> Op 2005-10-03, Steven D'Aprano schreef <[EMAIL PROTECTED]>: >>> On Mon, 03 Oct 2005 13:58:33 +, Antoon Pardon wrote: >> Declarations also allow easier writable closures. Since the declaration >

Re: Help needed in OOP-Python

2005-10-05 Thread Toufeeq Hussain
Fredrik, sigh! I see the problem you mention and I agree. Should have posted the orginal code without edits. :( Anyway I'll try to fill in whereever required.On 10/5/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: $ python test.pycondition satisfiedTraceback (most recent call last):   File "test.py",

Re: Help needed in OOP-Python

2005-10-05 Thread Fredrik Lundh
Toufeeq Hussain wrote: > My coding is really really bad,that's why I changed the names to more human > readable form(Module1,2.. etc). the problem is that when you do that (and post using a tool that's not smart enough to preserve leading whitespace), anyone who wants to help will basically have

Re: While and If messing up my program?

2005-10-05 Thread Lasse Vågsæther Karlsen
The specific error in your code, is that when cnto == len(ttllst), then doing ttllst[cnto] will give you that error. The list is indexed from 0 to len-1, which means that doing list[len(list)] will give that error. -- http://mail.python.org/mailman/listinfo/python-list

Re: While and If messing up my program?

2005-10-05 Thread Fredrik Lundh
"CJ" wrote: >What does worry me, is that I can't seem to get the program by a > certain spot. It keeps giving me the same error, and I don't know why. quite often, exception messages means exactly what they say; if you get an index error, it's because you're trying to fetch an item that doesn

Re: python plotting with greek symbols within labels recommendations?

2005-10-05 Thread Juho Schultz
[EMAIL PROTECTED] wrote: > hello all, > > this message is geared toward those of you in the scientific community. > i'm looking for a python plotting library that can support rendering > greek symbols and other various characters on plot axes labels, etc. I > would prefer something that adheres to

Re: While and If messing up my program?

2005-10-05 Thread [EMAIL PROTECTED]
hi, to get howmany element list appear you can code: ttllst=[4,3,45,3] for x in ttllst: print x, ttllst.count(x) pass to get non duplicate element list you can code: ttllst=[4,3,45,3] print list(set(ttllst)) Cheers, pujo -- http://mail.python.org/mailman/listinfo/p

Re: how to debug when "Segmentation fault"

2005-10-05 Thread Maksim Kasimov
yes, to generete core dump is the best way, but the command "$ ulimit -c 50" don't make python to generete core dump in the time of crush. I would like to know how to run python script so if it crushes than core dump will be genereted. Thanks Pierre Barbier de Reuille wrote: > Maksim Ka

Re: Turn $6 into $6.000

2005-10-05 Thread sweet_thiruvonam
Hello, Happy Harmony is the fastest growing matrimonial portal for Indians. You can email and IM other members without paying anything on this site. The amazing thing is that this site is totally free. Absolutely free. Cannot believe? Then click on this link to visit and register Happy Harmony.

Re: Idle

2005-10-05 Thread Hrvoje Blazevic
[EMAIL PROTECTED] wrote: > If you are compiling python and you want to build idle/tkinter, you > need to have the development packages for tcl and tk. The python build > scripts will only build tkinter should they find the libraries > (libtk8.4.so and libtcl8.4.so) and the header files (tk.h and tc

<    1   2   3