-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
200 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +0,0 @@ | ||
Exception in Tkinter callback | ||
Traceback (most recent call last): | ||
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1473, in __call__ | ||
return self.func(*args) | ||
File "gui.py", line 472, in generate_netlist_errors | ||
self.generate_netlist() | ||
File "gui.py", line 349, in generate_netlist | ||
self.getImpe() | ||
File "gui.py", line 305, in getImpe | ||
A=cmath.exp(-Psi*h[i1]) | ||
TypeError: 'int' object has no attribute '__getitem__' | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,32 @@ | ||
#make sample interface and try adding two functions to button like it says on StackOverflow | ||
|
||
import tkinter as tk | ||
import time | ||
|
||
class ButtonTimer: | ||
def __init__(self, root): | ||
self.master = root | ||
self.button = tk.Button(self.master, text="press me") # Notice I haven't assigned the button a command - we're going to bind mouse events instead of using the built in command callback. | ||
self.button.bind('<ButtonPress>', self.press) # call 'press' method when the button is pressed | ||
self.button.configure(command= | ||
self.button.bind('<ButtonRelease>', self.release) # call 'release' method when the button is released | ||
self.label = tk.Label(self.master) | ||
self.startTime = time.time() | ||
self.endTime = self.startTime | ||
|
||
self.button.grid(row=1, column=1) | ||
self.label.grid(row=2, column=1) | ||
|
||
def message(self): | ||
tk.tkMessageBox(message='HI!!!!') | ||
|
||
def press(self, *args): | ||
self.startTime = time.time() | ||
|
||
def release(self, *args): | ||
self.endTime = time.time() | ||
self.label.config(text="Time pressed: "+str(round(self.endTime - self.startTime, 2))+" seconds") | ||
|
||
root = tk.Tk() | ||
b = ButtonTimer(root) | ||
root.mainloop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#make sample interface and try adding two functions to button like it says on StackOverflow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import sys | ||
from ast import literal_eval | ||
|
||
'''fsock=open('error.log','w') | ||
sys.stderr=fsock''' | ||
|
||
fsock=open('error.log','w') | ||
sys.stderr=fsock | ||
frg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import sys | ||
from ast import literal_eval | ||
|
||
fsock=open('error.log','w') | ||
sys.stderr=fsock | ||
raise Exception, 'this error will be logged' | ||
'''fsock=open('error.log','w') | ||
sys.stderr=fsock''' | ||
s=literal_eval('6 2') | ||
print s |