Python Forum
[Tkinter] Gui creation
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Gui creation
#7
Hi ,

Actually am new to python ,below is my command line.

cmd = subprocess.Popen("cmd.exe /K cd C:\\ti\\c2000\\C2000Ware_1_00_04_00\\utilities\\flash_programmers\\serial_flash_programmer & serial_flash_programmer.exe -d f2803x -k f28335_flash_kernel.txt -a PQCR.i00 -p COM7 -b 9600 -v")

In the above command,

1) How to change the .ioo file, if we need to browse another file while compiling as it is taking it directly as command and gives no other way to change it while compiling.
2) How to change the Comport (COM7) value, if the hardware is detected at different port while compiling.

Note: Need to change the values while compiling.




below is my python code

#import image
from tkinter import *
import tkinter.filedialog
import sys
import glob
import serial
import serial.tools.list_ports
import subprocess

from tkinter.ttk import *
try:
import tkinter as tk # python v3
except:
import Tkinter as tk # python v2

# This function is called when the submit button is clicked

def submit_callback(input_entry):
print("User entered : " + input_entry.get())
cmd = subprocess.Popen("cmd.exe /K cd C:\\ti\\c2000\\C2000Ware_1_00_04_00\\utilities\\flash_programmers\\serial_flash_programmer & serial_flash_programmer.exe -d f2803x -k f28335_flash_kernel.txt -a PQCR.i00 -p COM7 -b 9600 -v")
#os.system("cd C:\\ti\\c2000\\C2000Ware_1_00_04_00\\utilities\\flash_programmers\\serial_flash_programmer")
#os.system("serial_flash_programmer.exe -d f2803x -k f28335_flash_kernel.txt -a PQCR.i00 -p COM3 -b 9600 -v & pause")
return None

# This function is called when the Port button is clicked
def port_callback(input_entry1):
print("User entered : " + input_entry1.get())
return None

#Serial Ports
ports = list(serial.tools.list_ports.comports())
for p in ports:
print(p)

#Browse Button
if sys.version_info[0] < 3:
import Tkinter as Tk
else:
import tkinter as Tk

def browse_file():
fname = tkinter.filedialog.askopenfilename(filetypes = (("Python files", "*.py"),("Python files", "*.pyw"), ("All files", "*")))
bpath = print (fname)


####################### GUI ###########################
root = tk.Tk()
root.geometry('800x550') #Set window size


# Heading

heading = tk.Label(root, text="BBs" ,bg="black", fg="orange" ,font=("Times New Roman", 50))
heading.place(x = 330, y = 0)

input_entry = tk.Entry(root,bg="white", fg="green" ,font=("Times New Roman", 12))
input_entry.place(x = 255, y = 125)

portButton = Tk.Button(root, text = 'Port', width = 12, command = lambda: port_callback(input_entry1))
portButton.place(x= 435,y= 125)

input_label = tk.Label(root, text="Firmware Downloading to \n TMS320F2833x", bg="white", fg="blue" ,font=("Times New Roman", 20))
input_label.place(x = 248, y = 185)


broButton = Tk.Button(root, text = 'Browse', width = 12, command=browse_file)
broButton.place(x= 435,y= 300)

input_entry1 = tk.Entry(root,bg="white", fg="green" ,font=("Times New Roman", 12))
input_entry1.place(x = 255, y = 300)

submit_button = tk.Button(root, text = "Submit", bg="brown", fg="green" ,font=("Times New Roman", 20),command = lambda: submit_callback(input_entry))
submit_button.place(x = 350, y = 450)

Tk.mainloop()




Iam waiting for your kind reply,

Thanks & Regards
Gangadhararao G

User has been warned for this post. Reason: Not using BBcode after being advise to do so
Reply


Messages In This Thread
Gui creation - by Gangadhararao - Jun-21-2018, 04:44 AM
RE: Gui creation - by Gangadhararao - Jun-21-2018, 07:37 AM
RE: Gui creation - by wuf - Jun-21-2018, 10:53 AM
RE: Gui creation - by Gangadhararao - Jun-21-2018, 02:50 PM
RE: Gui creation - by wuf - Jun-21-2018, 05:07 PM
RE: Gui creation - by Gangadhararao - Jun-26-2018, 04:02 AM
Command line with python - by Gangadhararao - Jun-26-2018, 05:21 AM
RE: Gui creation - by wuf - Jun-26-2018, 07:54 AM
RE: Gui creation - by wuf - Jun-26-2018, 10:35 AM
RE: Gui creation - by snippsat - Jun-27-2018, 06:29 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020