Hi,
I'm getting a strange segfault error when I try to run my relatively basic Kivy code, and I'm wondering if there's anything explicitly wrong that might be causing it. I've tried running it on two different machines, one running Windows 7, the other running Ubuntu 13.04, and I get the same error in both places. I imagine it has something to do with how I'm building the app, but I'm unsure. If anyone could provide any feedback or thoughts, it'd be greatly appreciated. Thanks!
import kivy
import os.path
from kivy.app import App
from kivy.uix.textinput import TextInput
from kivy.uix.button import Button
from kivy.uix.widget import Widget
from kivy.uix.floatlayout import FloatLayout
class Search (Widget):
def __init__ (self):
exerciseList = []
self.approposList = exerciseList
self.searchType = "exercise"
def makeFile (self):
file = open("%ssearch.txt" % (searchType), "w")
self.file = file
def writeFile():
if os.path.isfile("exercisesearch.txt"):
file = open("exercisesearch.txt", "w")
else:
file = makeFile()
for entry in exerciseList:
file.write(entry + "\n")
def on_enter(value):
approposList.append(value)
self.writeFile()
searchInput = TextInput(text = "Search %s" % ("exercise") + "s",
multiline = False)
searchInput.bind(on_text_validate = on_enter)
class App (App):
def build(self):
root = FloatLayout()
exerciseSearch = Search()
root.add_widget(exerciseSearch)
return root
if __name__ == "__main__":
App().run()