-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcommand.py
More file actions
31 lines (24 loc) · 742 Bytes
/
Copy pathcommand.py
File metadata and controls
31 lines (24 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import os
import subprocess
from tkinter import *
cmd = ["iverilog", "-o", "temp", "temp.v"]
rn = ["vvp", "temp"]
def compile(code, log):
string = code.get("1.0", "end-1c")
with open("temp.v", "w") as file:
file.write(string)
output, error = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE
).communicate()
log.config(state=NORMAL)
log.insert(END, error)
log.insert(END, output)
log.config(state=DISABLED)
def run(log):
output, error = subprocess.Popen(
rn, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell="true"
).communicate()
log.config(state=NORMAL)
log.insert(END, error)
log.insert(END, output)
log.config(state=DISABLED)