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
class DatabaseWrapper: | |
def __init__(self, params=None): | |
if params is None: | |
# read connection params from a config file (?) | |
params = self.config() | |
self.connection_params = params | |
self.connection = None | |
def config(self): |
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
# | |
# script to register Python 2.0 or later for use with win32all | |
# and other extensions that require Python registry settings | |
# | |
# written by Joakim Loew for Secret Labs AB / PythonWare | |
# | |
# source: | |
# http://www.pythonware.com/products/works/articles/regpy20.htm | |
# | |
# modified by Valentine Gogichashvili as described in http://www.mail-archive.com/distutils-sig@python.org/msg10512.html |
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
import contextlib | |
import dis | |
import inspect | |
import linecache | |
import struct | |
import sys | |
class SkipBlock(Exception): | |
pass |
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
def positive(L, x): | |
c1 = -1 | |
c2 = -1 | |
for c in L: | |
if c1 >= 0 and c2 >= 0: | |
break | |
if c == x and c1 < 0: | |
continue |
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
#!/usr/bin/env python | |
# I wasn't happy with any of the GitHub libraries for Python that I tried so I | |
# just used the GitHub API directly. If someone would like to rewrite this | |
# using a library please be my guest | |
from __future__ import unicode_literals | |
import argparse | |
import base64 |
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
root@b554a1ceecf7:/# cat /etc/lsb-release | |
DISTRIB_ID=Ubuntu | |
DISTRIB_RELEASE=16.04 | |
DISTRIB_CODENAME=xenial | |
DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS" | |
root@b554a1ceecf7:/# python3.6 | |
Python 3.6.5 (default, May 3 2018, 10:08:28) | |
[GCC 5.4.0 20160609] on linux | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import signal |
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
cdef public void hello(): | |
print "Hello world!" |
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
from ctypes import (cdll, c_size_t, c_void_p, c_int, c_char, Structure, | |
POINTER, cast) | |
from ctypes.util import find_msvcrt | |
msvcrt = cdll.LoadLibrary(find_msvcrt()) | |
# Constants | |
IOINFO_L2E = 5 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder