What is the significance of after() in this code?

W

W. eWatson

See Subject.
def StackImages(self):
self.Upload("P")
self.after_id = self.master.after(10000,self.GetFrameOne)
 
C

Carl Banks

See Subject.
     def StackImages(self):
         self.Upload("P")
         self.after_id = self.master.after(10000,self.GetFrameOne)

It's a "method" of the object that is bound to "self.master". It's
return value is then bound to the attribute "after_id" of the object
"self".


Carl Banks
 
B

Benjamin Kaplan

See Subject.
   def StackImages(self):
       self.Upload("P")
       self.after_id = self.master.after(10000,self.GetFrameOne)

I think this is close to winning an award for "least information
provided". How are we supposed to know with the information you gave
us? We don't know what package you're using, what type anything is, or
even the purpose of that method. Try putting this line in there
somewhere
print type(self.master)

and then open up the interactive interpreter, import whatever you need and do
help(<type>.after)
 
Z

zeph

I think this is close to winning an award for "least information
provided". How are we supposed to know with the information you gave
us? We don't know what package you're using, what type anything is, or
even the purpose of that method. Try putting this line in there
somewhere
print type(self.master)

and then open up the interactive interpreter, import whatever you need and do
help(<type>.after)


True, though by *context* the after method looks like it takes a time
(probably in milliseconds, given its size), and a method, and calls
the method after that amount of time, and returning some process/
thread id to self.after_id. Though if that's right, we still don't
know if its synchronous or not, if its calling it in a new thread or a
new process, etc etc.
 
A

alex23

zeph said:
True, though by *context* the after method looks like it takes a time
(probably in milliseconds, given its size), and a method, and calls
the method after that amount of time, and returning some process/
thread id to self.after_id.  Though if that's right, we still don't
know if its synchronous or not, if its calling it in a new thread or a
new process, etc etc.

"Please tell me what this function does based solely on its name and
signature" is _still_ a ridiculous question, though, even given the
context you can extrapolate from it.
 
N

Neil Cerutti

See Subject.
def StackImages(self):
self.Upload("P")
self.after_id = self.master.after(10000,self.GetFrameOne)

It's a violation of the Law of Demeter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,183
Messages
2,570,967
Members
47,518
Latest member
RomanGratt

Latest Threads

Top