Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- # Form implementation generated from reading ui file 'simple_test.ui'
- #
- # Created: Wed Aug 06 19:09:43 2014
- # by: PyQt4 UI code generator 4.11.1
- #
- # WARNING! All changes made in this file will be lost!
- from PyQt4 import QtCore, QtGui
- try:
- _fromUtf8 = QtCore.QString.fromUtf8
- except AttributeError:
- def _fromUtf8(s):
- return s
- try:
- _encoding = QtGui.QApplication.UnicodeUTF8
- def _translate(context, text, disambig):
- return QtGui.QApplication.translate(context, text, disambig, _encoding)
- except AttributeError:
- def _translate(context, text, disambig):
- return QtGui.QApplication.translate(context, text, disambig)
- class Ui_Dialog(object):
- def setupUi(self, Dialog):
- Dialog.setObjectName(_fromUtf8("Dialog"))
- Dialog.resize(453, 455)
- icon = QtGui.QIcon()
- icon.addPixmap(QtGui.QPixmap(_fromUtf8("../../Users/Ismail/Pictures/Icons/python_icn.ico")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- Dialog.setWindowIcon(icon)
- self.verticalLayout_2 = QtGui.QVBoxLayout(Dialog)
- self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
- self.verticalLayout = QtGui.QVBoxLayout()
- self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
- self.verticalLayout_3 = QtGui.QVBoxLayout()
- self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
- self.label = QtGui.QLabel(Dialog)
- self.label.setObjectName(_fromUtf8("label"))
- self.verticalLayout_3.addWidget(self.label)
- self.verticalLayout.addLayout(self.verticalLayout_3)
- self.label_2 = QtGui.QLabel(Dialog)
- self.label_2.setObjectName(_fromUtf8("label_2"))
- self.verticalLayout.addWidget(self.label_2)
- self.verticalLayout_4 = QtGui.QVBoxLayout()
- self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4"))
- self.runScript_btn = QtGui.QPushButton(Dialog)
- self.runScript_btn.setObjectName(_fromUtf8("runScript_btn"))
- self.verticalLayout_4.addWidget(self.runScript_btn)
- self.verticalLayout.addLayout(self.verticalLayout_4)
- self.verticalLayout_2.addLayout(self.verticalLayout)
- self.retranslateUi(Dialog)
- QtCore.QMetaObject.connectSlotsByName(Dialog)
- def retranslateUi(self, Dialog):
- Dialog.setWindowTitle(_translate("Dialog", "Python GUI", None))
- self.label.setText(_translate("Dialog", "This is a test using Qt Designer to develop a GUI for a Python script.", None))
- self.label_2.setText(_translate("Dialog", "This program will run a Python script.", None))
- self.runScript_btn.setText(_translate("Dialog", "Run script", None))
- self.runScript_btn.clicked.connect(self.runScript)
- def runScript(self):
- import plotly.plotly as py
- from plotly.graph_objs import Figure, Data, Layout, Scatter
- py.sign_in('USERNAME', 'API')
- xresults = [1,2,3,4,5,6,7,8,9,10]
- yresults = [10,3,5,7,9,12,15,25,30,2]
- trace1 = Scatter(x=xresults, y=yresults)
- my_data = Data([trace1])
- my_layout = Layout(title = "Random graph")
- my_fig = Figure(data=my_data, layout=my_layout)
- py.plot(my_fig)
- if __name__ == "__main__":
- import sys
- app = QtGui.QApplication(sys.argv)
- Dialog = QtGui.QDialog()
- ui = Ui_Dialog()
- ui.setupUi(Dialog)
- Dialog.show()
- sys.exit(app.exec_())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement