rn 4
else: return 1
def start(self):
storage.load()
level=1
while 1:
if level==0:
Console.Menu.Level0().do()
if level==1:
level=Console.Menu.Level1().do()
if level==2:
level=Console.Menu.Level2().do()
if level==3:
level=Console.Menu.Level3().do()
if level==4:
level=Console.Menu.Level4().do()
def start(self):Console.Menu().start()
if __name__=="__main__":
Console().start()
--
Logan Lee aka Pyenos
--
http://mail.python.org/mailman/listinfo/python-list
#!/usr/bin/python
# answers.py --- A simple answer bot
# Copyright (C) 2006 Logan Lee
#
# MESSAGE:
#
# This program is a simple text-console program
#+that asks for a problem and its solution then
#+persists the problem-solution dictionary to
Pyenos <[EMAIL PROTECTED]> writes:
> Thanks for clarifying the definitions of nested class and
> subclass. However, it did not solve my original problem, and I have
> redefined my question:
>
> class Class1:
> class Class2:
> class Class3:
>
Thanks for clarifying the definitions of nested class and
subclass. However, it did not solve my original problem, and I have
redefined my question:
class Class1:
class Class2:
class Class3:
def __init__(self):
self.var="var"
class Class4:
class Class1:
class Class2(Class1):
variable="variable"
class Class3(Class2):
print Class1().Class2().variable #problem
Also, why is this wrong?
--
http://mail.python.org/mailman/listinfo/python-list
Approach 1:
class Class1:
class Class2:
def __init__(self):self.variable="variable"
class Class3:
def method():print Class1().Class2().variable #problem
Approach 1.1:
class Class1:
class Class2:
class One:
Two() #can't instantiate
class Two:
Three() #can't instantiate
class Three:pass
--
http://mail.python.org/mailman/listinfo/python-list
Pyenos <[EMAIL PROTECTED]> writes:
> class Model:
> Controller() #problem
>
> class View:
> Model()
>
> class Controller:pass
>
>
> Python interpreter complains that 'Name Error: Controller()' not defined.
>
Following
"Edward Kozlowski" <[EMAIL PROTECTED]> writes:
> Pyenos wrote:
> > class model:pass
> > class view:
> > model()
> > class controller:
> > model()
> >
> > I can instantiate clsss model from inside class view but I can
class Model:
Controller()
class View:
Model()
class Controller:pass
Python interpreter complains that 'Name Error: Controller()' not defined.
--
http://mail.python.org/mailman/listinfo/python-list
class model:pass
class view:
model()
class controller:
model()
I can instantiate clsss model from inside class view but I can't
instantiate class model from inside controller, due to the nature of
python interpreter.
I wish to circumvent this restriction by:
class model:pass
clas
Gabriel Genellina <[EMAIL PROTECTED]> writes:
> At Friday 22/12/2006 22:24, Pyenos wrote:
>
> > > > "code"
> > > > var=1
> > > > class CLASS:
> > > > def METHOD1:
> > > > def ME
Pyenos <[EMAIL PROTECTED]> writes:
> Pyenos <[EMAIL PROTECTED]> writes:
>
> i will try to answer my own questions(pls verify):
>
> > "code"
> > var=1
> > class CLASS:
> > def METHOD1:
> > def METHOD2:
>
"Max Wilson" <[EMAIL PROTECTED]> writes:
> Pyenos wrote:
> > does class WORK inherit t_len=0 from line1?
> >
> > does def getwork() inherit t_len=0 from line1?
> >
> > does def formattable(table_to_process,type) inherit t_len=0 from line1?
>
Pyenos <[EMAIL PROTECTED]> writes:
i will try to answer my own questions(pls verify):
> "code"
> var=1
> class CLASS:
> def METHOD1:
> def METHOD2:
> var+=var
> return var
>
James Stroud <[EMAIL PROTECTED]> writes:
> >>>#CODE##
> >>>t_len=0
> >>>class WORK:
> >>>def getwork(self):
> >>>def formattable(table_to_process,type):
> >>>TYPE=["p","t","T","s","i"] #list of types to format
> >>>if t
"code"
var=1
class CLASS:
def METHOD1:
def METHOD2:
var+=var
return var
METHOD2() #line8
return var
METHOD1() #line10
"end code"
Q1: do
"code"
var=1
class CLASS:
def METHOD1:
def METHOD2:
var+=var
return var
METHOD2() #line8
return var
METHOD1() #line10
Q1: does class CLA
frankly, i don't konw anything about mod_python nor spyce, but i wish
you good luck.
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh <[EMAIL PROTECTED]> writes:
> Pyenos wrote:
>
> > #CODE##
> > t_len=0
> > class WORK:
> > def getwork(self):
> > def formattable(table_to_process,type):
> > TYP
#CODE##
t_len=0
class WORK:
def getwork(self):
def formattable(table_to_process,type):
TYPE=["p","t","T","s","i"] #list of types to format
if type==TYPE[1]:
"MacDonald" <[EMAIL PROTECTED]> writes:
> Pyenos wrote:
> > [code]
> > class WORK:
> > def getwork(self):
> > def choosetable(self):pass
> > choosetable() #TypeError: choosetable() takes exactly 1
> >
"Forced_Ambitions" <[EMAIL PROTECTED]> writes:
> Guys any suggestions ?
>
> Could it be because of a MS patch or something as i believe i had some
> patching on the windows box i was running this script on.
>
>
> Forced_Ambitions wrote:
>
> > Hi Guys,
> >
> > I am facing a problem with a scrip
[code]
class WORK:
def getwork(self):
def choosetable(self):pass
choosetable() #TypeError: choosetable() takes exactly 1
#argument (0 given)
[/code]
Calling choosetable() at the above location gives me the error
described above.
--
http://mail.python.o
Adonis Vargas <[EMAIL PROTECTED]> writes:
> Pyenos wrote:
> > class TREE:
> > def gettree(self):print self
> > TREE.gettree() # I get an error saying# TypeError:
> > unbound method gettree() must be called
> ># with TREE
class TREE:
def gettree(self):print self
TREE.gettree() # I get an error saying
# TypeError: unbound method gettree() must be called
# with TREE instance as first argument (got nothing instead
I still don't understand how to solve this simple code.
--
http://m
i rewrote the code following the advices from subdir of the parent thread:
# well, table is composed of a list of columns.
# so let's stick them together
def enlargetable(table,col):
table.append(col) # the code won't return sorted lists :-o
return_the_fucking_table_bitch=table # assign it
def enlargetable(table,col):
return table.append(col)
def removecolfromtable(table,col):
return table.remove(col)
print enlargetable([[1],[2],[3]],[4]) # returns None
Why does it return None instead of [[1],[2],[3],[4]] which I expected?
--
http://mail.python.org/mailman/listinfo/python
Pyenos <[EMAIL PROTECTED]> writes:
> class pickle_service:
> import cPickle as p
>
> # accept list as arg then serialize it to a file
> def serialize(some_list,picklefile):
> f=file(picklefile,"w")
> p.dump(some
thanks for your point. so because i have said class blah: i must
explicitly say self for every instantiation of object?
--
http://mail.python.org/mailman/listinfo/python-list
class pickle_service:
import cPickle as p
# accept list as arg then serialize it to a file
def serialize(some_list,picklefile):
f=file(picklefile,"w")
p.dump(some_list,f) # so dumped this shit to the file
f.close()
# which one
gt; a container of many many smaller questions, and you need to focus your
> questions better.
>
> On 21 Dec 2006 09:16:58 +1100, Pyenos <[EMAIL PROTECTED]> wrote:
> > import cPickle, shelve
> >
> > could someone tell me what things are wrong with my
class pid:
"pid"
def add(original_pid,toadd):
"add pid"
original_pid.append(toadd)
return original_pid
def remove(something_to_remove_from,what):
"remove pid"
something_to_remove_from.remove(what)
return something_to_remove_from
def m
import cPickle, shelve
could someone tell me what things are wrong with my code?
class progress:
PROGRESS_TABLE_ACTIONS=["new","remove","modify"]
DEFAULT_PROGRESS_DATA_FILE="progress_data"
PROGRESS_OUTCOMES=["pass", "fail"]
def unpickleProgressTable(pickled_progress_data_file):
34 matches
Mail list logo