Jag behöver med min webbläsare att ansluta Google. Den ansluter google, men den bara använder HTML. Inga bilder, ingen Javascript, inga css eller som något annat syns.
Programmet ska ha 3 funktioner. Men jag är inte färdig med det. Vet du hur man gör detta 3 funktioner?
1. Läs en URL från en annan python-fil.
2. Göra så programmet kan röra musen och klicka på färger, linjer och beräkna hur stora kanter och streck är t.ex. hur se denna kurs på aktien är. Den ska också läsa från en annan Python fil.
3. Gör start fönstret som en terminal. Där kan du välja några alternativ (1,2,3,4,5,6,7), etc "Starta programmet"eller "Stäng av programmet"eller "pausa programmet"eller "Titta hur många .... " o.s.v.
Men det första steget kommer att vara nr 1. Kan du hjälpa mig?

Här är min kod:
Kod: Markera allt
# -*- coding: utf-8 -*-
import wx
import wx.html
import sys
username = raw_input('MoneyMaker login password?: ')
if username == "hello":
print "Welcome to the MoneyMaker"
else:
print "Wrong password - Closing"
raw_input("Press Enter to Exit")
sys.exit()
class PageOne(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
html = wx.html.HtmlWindow(self, size=(700,700))
class PageTwo(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
html = wx.html.HtmlWindow(self, size=(700,700))
class PageThree(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
html = wx.html.HtmlWindow(self, size=(700,700))
class PageFour(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
html = wx.html.HtmlWindow(self, size=(700,700))
class PageFive(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
html = wx.html.HtmlWindow(self, size=(700,700))
wx.CallAfter(html.LoadPage, "http://www.google.com")
class MainFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, title="MoneyMaker", size=(750,750))
# Here we create a panel and a notebook on the panel
p = wx.Panel(self)
nb = wx.Notebook(p)
# create the page windows as children of the notebook
page1 = PageOne(nb)
page2 = PageTwo(nb)
page3 = PageThree(nb)
page4 = PageFour(nb)
page5 = PageFive(nb)
# add the pages to the notebook with the label to show on the tab
nb.AddPage(page1, "Page 1")
nb.AddPage(page2, "Page 2")
nb.AddPage(page3, "Page 3")
nb.AddPage(page4, "Page 4")
nb.AddPage(page5, "Page 5")
# finally, put the notebook in a sizer for the panel to manage
# the layout
sizer = wx.BoxSizer()
sizer.Add(nb, 1, wx.EXPAND)
p.SetSizer(sizer)
if __name__ == "__main__":
app = wx.App()
MainFrame().Show()
app.MainLoop()
BIG EDIT!

Nu har jag börjat med PyQT och jag får det inte att fungera.
Här är min nya kod:
Kod: Markera allt
import sys
from PyQt4 import QtGui,QtCore,QtWebKit
username = raw_input('MoneyMaker login password?: ')
if username == "hello":
print "Welcome to the MoneyMaker"
else:
print "Wrong password - Closing"
raw_input("Press Enter to Exit")
sys.exit()
class Ui_TabWidget(QtGui.QTabWidget):
def __init__(self,parent=None):
QtGui.QTabWidget.__init__(self,parent)
self.setObjectName("MoneyMaker")
self.resize(1000, 700)
self.setWindowTitle(QtGui.QApplication.translate("MoneyMaker", "MoneyMaker", None, QtGui.QApplication.UnicodeUTF8))
#Creating the tabbar
self.tabBar=QtGui.QTabBar(self)
#Adding the first tab
self.tabBar.addTab("tab1")
self.tabBar.setTabText(0,"1")
#The widget intended for tab1
self.widgetForTab1=QtWebKit.QWebView()
self.addTab(self.widgetForTab1,"")
widgetForTab1.setUrl(QtCore.QUrl('http://www.google.com'))
#Adding the second Tab
self.tabBar.addTab("tab2")
self.tabBar.setTabText(1,"2")
#The widget intended for tab2
self.widgetForTab2=QtGui.QWidget()
self.addTab(self.widgetForTab2,"")
#Adding the thrd tab
self.tabBar.addTab("tab3")
self.tabBar.setTabText(2,"3")
#Adding the tabbar to the tabwidget
self.setTabBar(self.tabBar)
self.tabBar.setMovable(True)
self.setCurrentIndex(0)
if __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
ui = Ui_TabWidget()
ui.show()
sys.exit(app.exec_())
Kod: Markera allt
#The widget intended for tab1
self.widgetForTab1=QtWebKit.QWebView()
self.addTab(self.widgetForTab1,"")
widgetForTab1.setUrl(QtCore.QUrl('http://www.google.com'))
Kod: Markera allt
import sys
from PyQt4 import QtGui,QtCore,QtWebKit
app=QtGui.QApplication(sys.argv)
wb=QtWebKit.QWebView()
wb.setUrl(QtCore.QUrl('http://www.google.com'))
wb.show()
sys.exit(app.exec_())
Edit:!!!
Nu fungerar programmet.