Hey guys,
I use Python 2.6.2, and have made a program; here's the code:
import subprocess
import time
def open_program():
time.sleep(s)
print 'Opening the program...'
subprocess.call(c)
h=input("Time: ")
c=raw_input("Enter the full location of the program you want to open after the desired time: ")
s=(h*60*60)
open_program()
I also have some wxPython code I got from using FarPY GUI:
import sys
import wx
import wx.calendar
class MyFrame(wx.Frame):
def __init__(self, parent, title):
wx.Frame.__init__(self, parent, -1, 'tLapse', wx.DefaultPosition, (560, 472), style=wx.CLOSE_BOX | wx.SYSTEM_MENU | wx.CAPTION | wx.SIMPLE_BORDER | 0 | 0 | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX)
self.panel = wx.Panel(self, -1)
self.textbox1 = wx.TextCtrl(self.panel, -1, 'textbox', (312,64), size=(100, 20))
self.textbox1.SetBackgroundColour(wx.Colour(255, 255, 255))
self.textbox1.SetFont(wx.Font(8.25, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, 'Microsoft Sans Serif'))
self.textbox1.SetCursor(wx.StockCursor(wx.CURSOR_DEFAULT))
self.label2 = wx.StaticText(self.panel, -1, 'Please enter the desired time you want to lapse(in hours):', (8,64), (300, 20))
self.label2.SetFont(wx.Font(8.25, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, 'Microsoft Sans Serif'))
self.label2.SetCursor(wx.StockCursor(wx.CURSOR_DEFAULT))
self.label4 = wx.StaticText(self.panel, -1, 'Welcome to tLapse. Please select a program you want to open.', (8,16), (325, 17))
self.label4.SetFont(wx.Font(8.25, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, 'Microsoft Sans Serif'))
self.label4.SetCursor(wx.StockCursor(wx.CURSOR_DEFAULT))
self.dialogopen1 = wx.FileDialog(self.panel, message='', defaultDir='', defaultFile='', wildcard='', style=wx.OPEN | wx.CHANGE_DIR)
self.button2 = wx.Button(self.panel, -1, 'Quit', (448,408), (75, 23))
self.button2.Bind(wx.EVT_BUTTON,quit)
self.button2.SetFont(wx.Font(8.25, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, 'Microsoft Sans Serif'))
self.button2.SetCursor(wx.StockCursor(wx.CURSOR_DEFAULT))
class MyApp(wx.App):
def OnInit(self):
frame = MyFrame(None, 'App')
frame.Show(True)
self.SetTopWindow(frame)
return True
def quit(event):
sys.exit(1)
app = MyApp(True)
app.MainLoop()
What I want to know is, how do I integrate them both? I mean like, how do I make Python accept whatever is entered in the text box in the wxPython? Can anyone please help me?
Thanks a million!