Problems with the class method on return(bound method)

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Dosya
Newbie
Posts: 11
Joined: Tue Jun 16, 2020 5:42 pm
Contact:

Problems with the class method on return(bound method)

#1 Post by Dosya » Wed Jul 29, 2020 9:24 pm

There is a class related to the time in the game. I wrote a method for it to output the current time, but it does not work and knocks out this error.
Image

Image

Image

Image
Can you help me, what am I doing wrong?

drKlauz
Veteran
Posts: 237
Joined: Mon Oct 12, 2015 3:04 pm
Contact:

Re: Problems with the class method on return(bound method)

#2 Post by drKlauz » Thu Jul 30, 2020 1:07 am

Code: Select all

    @property
    def OutPut(self):
      ...
This should work.
Problem is when you write [calendar.OutPut] you ask for attribute OutPut, which is bound method and it is printed, not called. By turning method into property you force [calendar.OutPut] to actually call method and print result.
I may be available for hire, check my thread: viewtopic.php?f=66&t=51350

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]