0

for my graduation project I am making a arcade GUI in Python 3.7. Now I got a little stuck here, what I am trying to do is so when you open a new page (by clicking the button) i want it so that a executable file (ex: pacman) will play inside the frame so not with the 'os' method.

Is there a possibility to make it like when you click on the button 'play' that the game starts inside of the window/frame instead of opening it outside of the program?

Here is a piece of my code:

def init(self,master):

Frame.init(self, master)

    self.frameName="GamePage"
    backgr = Image.open("Gamepage_background.png")
    render = ImageTk.PhotoImage(backgr)
    background = Label(self, image=render)
    background.image = render
    background.place(x=0, y=0, relwidth=1, relheight=1)

    Button(self, text = "Go back to main page",font=('Arcade Interlaced',15),bg="black",fg="white",command=lambda: master.changeFrame(0)).pack(side=BOTTOM, anchor = W , pady= 15, padx= 15)

    Button(self, text = "Pac Man",font=('Arcade Interlaced',30),bg="purple",fg="white",command = master.openPacman).place(anchor = CENTER, relx= 0.27, rely= 0.275, width = 475, height = 125) #voorlopig in orde in 1920x1080

    Button(self, text = "Space Invaders",font=('Arcade Interlaced',30),bg="purple",fg="white",command= master.openSpaceinvaders,  wraplength = 350, justify = CENTER).place(anchor = CENTER, relx= 0.74, rely= 0.275, width = 475, height = 125)'''

What I want is when i click on one of the two games it would open up a new frame with the game playing inside the frame and not externaly.

Thank you and i hope i find the answer soon!

3
  • Are these games that you want to embed written in python with tkinter, or are they random programs plucked from the internet that you have no control over? Commented Mar 20, 2020 at 17:35
  • Have you done any research? This site has a few questions related to embedded games, such as stackoverflow.com/q/20483983/7432 Commented Mar 20, 2020 at 17:36
  • @BryanOakley the games are python program which are not made with tkinter but i can acces the code and there is also a exe linked to it. Commented Mar 20, 2020 at 17:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.