12345678910111213141516171819202122 |
- def chooseVHDFiles(self):
- files = filedialog.askopenfilenames(
- initialdir=os.getcwd() + '\\testbenches\\',
- title="Choose VHD files",
- filetypes=(("VHD Files", "*.vhd"),)
- )
- labelText = ""
- self.selectedTestbenches = []
- try:
- for tf in files:
- if tf == "":
- self.tbUploadVar.set("")
- return
- tf = open(tf) # or tf = open(tf, 'r')
- self.selectedTestbenches.append(tf.name)
- labelText += tf.name[tf.name.rfind("/") + 1:len(tf.name)] + '\n'
- tf.close()
- except:
- self.tbSelectLabel['text'] = 'An Error Occured'
- return
- self.tbSelectLabel['text'] = labelText
|