daily pastebin goal
11%
SHARE
TWEET

Untitled

a guest Dec 12th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import sys
  2. import webbrowser
  3. import random
  4. import time
  5. import os
  6. import subprocess
  7. from PyQt4.QtCore import QSize, QTimer, SIGNAL
  8. from PyQt4.QtGui import QApplication,QScrollBar,QLineEdit , QDialog , QFormLayout ,QGraphicsRectItem , QMainWindow, QPushButton, QWidget, QIcon, QLabel, QPainter, QPixmap, QMessageBox, QAction, QKeySequence, QFont, QFontMetrics, QMovie
  9. from PyQt4 import QtGui
  10. import vlc
  11. #----|Imports End|----#
  12. class UIWindow(QWidget):
  13.     def __init__(self, parent=None):
  14.         super(UIWindow, self).__init__(parent)
  15.  
  16.         self.resize(QSize(400, 450))
  17.  
  18.         self.Play = QPushButton('Play', self)
  19.         self.Play.resize(100,40)
  20.         self.Play.move(45, 100)#
  21.  
  22.         self.Pause = QPushButton('Pause', self)
  23.         self.Pause.resize(100,40)
  24.         self.Pause.move(260, 100)#
  25.  
  26.  
  27.  
  28.         self.Tbox = QLineEdit('Song name',self)
  29.         self.Tbox.resize(400,25)
  30.         self.Tbox.move(0,50)
  31.  
  32.         self.Play.clicked.connect(self.PlayB)
  33.         self.Pause.clicked.connect(self.PauseB)
  34.         self.Flask = vlc.MediaPlayer("C:UsersMattMusic\"+str(self.Tbox.text())+".mp3")
  35.  
  36.     def PlayB(self):
  37.         self.Flask.play()
  38.  
  39.     def PauseB(self):
  40.         self.Flask.stop()
  41.  
  42. class MainWindow(QMainWindow,):
  43.     def __init__(self, parent=None):
  44.         super(MainWindow, self).__init__(parent)
  45.         self.setGeometry(745 ,350 , 400, 450)
  46.         self.setFixedSize(400, 450)
  47.         self.startUIWindow()
  48.  
  49.  
  50.     def startUIWindow(self):
  51.         self.Window = UIWindow(self)
  52.         self.setWindowTitle("HELP ME!")
  53.         self.setCentralWidget(self.Window)
  54.         self.show()
  55.  
  56.  
  57.  
  58. if __name__ == '__main__':
  59.     app = QApplication(sys.argv)
  60.     w = MainWindow()
  61.     sys.exit(app.exec_())
  62.    
  63. QTextEdit.textChanged.connect(your_method_to_put_text_somewhere_else)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top