Re: Reference Variables In Python Like Those In PHP

2006-08-15 Thread Luke Plant
Chaos wrote: > Is It possible to have reference variables like in PHP ... > Is this available in python? You should note that, to a nearest equivalent, all variables are reference variables in Python. The difference is in what assignment does - += in Python does an assignment of a new object f

Re: Detupleize a tuple for argument list

2006-07-05 Thread Luke Plant
Marco Wahl wrote: > Hi, > > I want to give a tuple to a function where the function > expects the respective tuple-size number of arguments. ... > One way to do what I want is--of course--to call > foo(t[0], t[1]). My actual question is if there is a > smarter way to do it. Yes, just this: foo

Re: hi,every body. a problem with PyQt.

2006-05-24 Thread Luke Plant
> i use QT-designer to design application GUI. > now i save the test.ui file into e:\test\test.ui > next step,how can i run it? You should have a look at a PyQt tutorial, such as this one: http://vizzzion.org/?id=pyqt Luke -- http://mail.python.org/mailman/listinfo/python-list

Re: Help! Identical code doesn't work in Wing IDE but does in Komodo.

2006-04-20 Thread Luke Plant
> With the exact same line of code in Komodo I get the correct output > which is "Sample Feed" > > Any idea what's wrong? My guess would be different PYTHONPATHs. Try this on each: >>> import sys >>> print sys.path They might even be using different python versions - but both of these are just

Re: Initializing defaults to module variables

2006-04-13 Thread Luke Plant
Burton Samograd wrote: > My question is, how can I setup my program defaults so that they can > be overwritten by the configuration variables in the user file (and so > I don't have to scatter default values all over my code in try/catch > blocks)? The Django web framework happens to do something

Re: make a class instance from a string ?

2006-02-23 Thread Luke Plant
Bo Yang wrote: > I know in java , we can use > > class.ForName("classname") > > > to get an instance of the class 'classname' from a > string , in python , how do I do that ? In Python, classes are first class objects, so normally you would pass the class itself around, rather than use the names