Member Avatar for sravan953
sravan953

Hey All,

I am working on a Java project for school. To make my project better, I wanted to integrate Python into it... like what I wanted to do is:

  • You run the Python program
  • You get two options:
  • a) View source code
  • b) View output
  • (Output is a recorded video)
  • User selects any of the two

So here's the code:

import wx

window=wx.App()

class project(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, -1, "Sravan's Java Project",size=(500,500))

        self.panel=wx.Panel(self, -1)

        wx.StaticText(self.panel, -1, "Welcome to Sravan's Java Project.", pos=(10,10)).SetForegroundColour('red')
        wx.StaticText(self.panel, -1, "You can:",pos=(10,40))

        wx.Button(self.panel,101,"View source code",pos=(70,100))
        self.Bind(wx.EVT_BUTTON,self.sc,id=101)

        wx.Button(self.panel,102,"View output",pos=(70,160))
        self.Bind(wx.EVT_BUTTON,self.op,id=102)
        
        self.Show()
        self.Centre()

    def sc(self,event):
        wx.MessageBox("Hi")

    def op(self,event):
        wx.MessageBox("Bye")
        
project=project()
window.MainLoop()

# For now, the functions don't actually do anything,
# but I'll fix that later

My question is, I want to put two images of Blue J and WMP at (10,100) and (10,160) respectively. I just wanted to know how to do it...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.