nanoia 56 Posted August 25, 2015 Share Posted August 25, 2015 can anyone help me import a game.py function to another file.my system is implemented in all game.py I wanted to put to open in another system via a button Sorry for my bad English Link to comment Share on other sites More sharing options...
Former Staff flygun 304 Posted August 25, 2015 Former Staff Share Posted August 25, 2015 i didn't understand you .. but i think it would be something like this from game import <name of "def"> Link to comment Share on other sites More sharing options...
VegaS 1095 Posted August 25, 2015 Share Posted August 25, 2015 Tell us exactly what it is that we can realize. But I do like the screen shoot an example: Open game.py and copy this: SCREENSHOT_CWDSAVE = FALSE SCREENSHOT_DIR = None if localeInfo.IsEUROPE(): SCREENSHOT_CWDSAVE = TRUE if localeInfo.IsCIBN10(): SCREENSHOT_CWDSAVE = FALSE SCREENSHOT_DIR = "YT2W" and adds that overall this game.py you copied the file where is your system after import. Gender in test.py And then add to your button function: def YourFunctionButton(self): print "save screen" # SCREENSHOT_CWDSAVE if SCREENSHOT_CWDSAVE: if not os.path.exists(os.getcwd()+os.sep+"screenshot"): os.mkdir(os.getcwd()+os.sep+"screenshot") (succeeded, name) = grp.SaveScreenShotToPath(os.getcwd()+os.sep+"screenshot"+os.sep) elif SCREENSHOT_DIR: (succeeded, name) = grp.SaveScreenShot(SCREENSHOT_DIR) else: (succeeded, name) = grp.SaveScreenShot() # END_OF_SCREENSHOT_CWDSAVE if succeeded: pass """ chat.AppendChat(chat.CHAT_TYPE_INFO, name + localeInfo.SCREENSHOT_SAVE1) chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SCREENSHOT_SAVE2) """ else: chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SCREENSHOT_SAVE_FAILURE) Then add in the beginning: import os import grp import chat And now ready to do a picture in the window of another system. If you could tell me what you want to bring game.py functions in other systems / windows put I would help. Link to comment Share on other sites More sharing options...
nanoia 56 Posted August 26, 2015 Author Share Posted August 26, 2015 I will give an example It has the following function in my game.py self.interface.ToggleBonusWindow() this function will get ToggleBonusWindow () in interfacemodule.py I want to put in my system a function like this to get another function in game.py Link to comment Share on other sites More sharing options...
VegaS 1095 Posted August 26, 2015 Share Posted August 26, 2015 I will give an example It has the following function in my game.py self.interface.ToggleBonusWindow() this function will get ToggleBonusWindow () in interfacemodule.py I want to put in my system a function like this to get another function in game.py Contact me and I will help you. Skype: sacadatt.amazon Link to comment Share on other sites More sharing options...
nanoia 56 Posted September 1, 2015 Author Share Posted September 1, 2015 Hello this is my system http://pastebin.com/iitZhXJr this is a system buttons I want to make it encounters is def def __PressTabKey(self): self.kosz.OpenDialog() this is def the file http://pastebin.com/qkE22aej Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now