Skip to content

Instantly share code, notes, and snippets.

@kived
Created August 14, 2014 19:14
Show Gist options
  • Save kived/c8eac85f8f51ec34d8c0 to your computer and use it in GitHub Desktop.
Save kived/c8eac85f8f51ec34d8c0 to your computer and use it in GitHub Desktop.
reopen fds
import os, sys
sys.stdin.close()
sys.stdout.close()
sys.stderr.close()
os.close(0)
os.close(1)
os.close(2)
sys.stdin = open('/dev/null', 'r')
sys.stdout = open('/dev/null', 'w')
sys.stderr = open('/dev/null', 'w')
import kivy
kivy.require('1.8.1')
from kivy.app import App
from kivy.lang import Builder
root = Builder.load_string('''
BoxLayout:
Label:
text: 'hi'
''')
class TestApp(App):
def build(self):
return root
if __name__ == '__main__':
TestApp().run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment