The use of __main__.py to create executables
myprojectfolder/
|_ __main__.py
|_ __init__.py
Being __main__.py:
print("Hello")
| #define ENCODER_OPTIMIZE_INTERRUPTS | |
| #include <Encoder.h> | |
| #include <LedControl.h> | |
| Encoder knob(0, 1); | |
| LedControl lc = LedControl(12, 11, 10, 3); | |
| int steps = 0; |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import hal | |
| import sys | |
| import signal | |
| import linuxcnc | |
| import copy | |
| import time |
| try: | |
| import xmlrpclib | |
| except ImportError: | |
| import xmlrpc.client as xmlrpclib | |
| client = xmlrpclib.ServerProxy('https://pypi.python.org/pypi') | |
| packages = client.list_packages() | |
| total = len(packages) | |
| dashes = len([x for x in packages if '-' in x]) |
| QTabWidget::pane { | |
| border: 1px solid black; | |
| background: white; | |
| } | |
| QTabWidget::tab-bar:top { | |
| top: 1px; | |
| } | |
| QTabWidget::tab-bar:bottom { |
The use of __main__.py to create executables
myprojectfolder/
|_ __main__.py
|_ __init__.py
Being __main__.py:
print("Hello")
| from gi.repository import Gtk | |
| settings = Gtk.Settings.get_default() | |
| settings.set_property("gtk-application-prefer-dark-theme", True) |
| #!/usr/bin/env python | |
| # Author: Chris Eberle <[email protected]> | |
| # Watch for any changes in a module or package, and reload it automatically | |
| import pyinotify | |
| import imp | |
| import os | |
| class ModuleWatcher(pyinotify.ProcessEvent): | |
| """ |
| # Demo application showing how once can combine the python | |
| # threading module with GObject signals to make a simple thread | |
| # manager class which can be used to stop horrible blocking GUIs. | |
| # | |
| # (c) 2008, John Stowers <[email protected]> | |
| # | |
| # This program serves as an example, and can be freely used, copied, derived | |
| # and redistributed by anyone. No warranty is implied or given. | |
| import gtk | |
| import gobject |