python - Segmentation Fault? No error I’ve seen… -


i have code:

from tkinter import * def get_info(key):     pass#do more later def create_new():     create = toplevel(root)     create.title('create new contact')     label(create, text='name: ').grid(row=0, sticky=w+e)     name = entry(create, width=8).grid(row=1, sticky=w+e)     label(create, text='address(ex. 1111 main st, mycity, anystate 12345): ', wraplength=1).grid(row=2, sticky=w+e)     address = entry(create, width=8).grid(row=3, sticky=w+e) def access():     access_window = toplevel(root)     access_window.title("access contact")     label(access_window, text="enter first name: ").grid(row=0, sticky=w+e)     access_key = entry(access_window, width=8).grid(row=1, sticky=w+e)     button(access_window, text="submit", command=lambda: get_info(access_key.get('0.0', 'end-1c'))).grid(row=2, sticky=w+e) root = tk() root.title('address book') button1 = button(root, text="create new", command=create_new) button1.grid(row=0, column=0) button2 = button(root, text="access person", command=access) button2.grid(row=0, column=1) 

there error line:

button2.grid(row=0, column=1) 

it gives me error:

segmentation fault: 11 

why show up? segmentation fault?

"segmentation fault" low-level error: means operating system caught program accessing range of memory addresses not assigned actual memory.

if programming in c, indicate bug in code. programming in python. supposed impossible in python trigger segmentation fault. bug not in code! cause of problem is, believe or not, hardware fault: specifically, bad ram. run program on , on again @ least 100 times; simultaneously, memory-intensive, loading lots of graphics-heavy web pages , closing them again, repeatedly. crash every single time? if doesn't, run memtest86+ , leave running until tells ram stick bad, replace it.

now, if crash every single time, have software problem. next scenario tkinter add-on incompatible python interpreter, actual tk widgets library, or both. uninstall , reinstall tk , tkinter known-good source (for instance, if running linux, distribution's package repository). should fix it.

far less likely, still possible, outright bugs in tkinter, tk, 1 of lower-level windowing libraries, or python interpreter. consider possibility if reinstalling known-good packages not make problem go away.


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -