def __init__(self, url, streams, format, parent=None): super(SubWindow, self).__init__(parent) self.title = "Streams" self.top = 200 self.left = 500 self.width = 400 self.height = 400 self.setWindowTitle(self.title) self.setGeometry(self.left, self.top, self.width, self.height) SubWindow.url = url SubWindow.format = format layout = QVBoxLayout() self.setLayout(layout) #print all the streams / set stream for x in streams: radiobutton = QRadioButton(str(x), self) radiobutton.format = str(x) layout.addWidget(radiobutton) radiobutton.toggled.connect(self.onClicked) line = QHBoxLayout() line.addWidget(SubWindow.filePathLine) locationButton = QPushButton('Change Directory') locationButton.clicked.connect(self.changeLocation) line.addWidget(locationButton) downloadButton = QPushButton('Download') downloadButton.clicked.connect(self.onDownload) layout.addLayout(line) layout.addWidget(downloadButton)