Skip to content

Instantly share code, notes, and snippets.

View DoctorMalboro's full-sized avatar

Leandro DoctorMalboro

  • Berlin, Germany.
View GitHub Profile
@DoctorMalboro
DoctorMalboro / import_checker.py
Created July 25, 2014 15:01
Checks if there are any unused imports on your project. Requires snake-food to work.
# -*- coding: utf-8 -*-
import subprocess
if __name__ == '__main__':
fp = open('imports.txt', 'w+')
imports = subprocess.Popen('sfood-checker',
shell=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
# -*- coding: utf-8 -*-
import sys
import modulefinder
from glob import glob
from distutils.core import setup
import py2exe
data_files = [
import win32serviceutil
import win32service
import win32event
import servicemanager
import socket
class AppServerSvc (win32serviceutil.ServiceFramework):
_svc_name_ = "ShortAndTogetherName"
_svc_display_name_ = "Full name of your service"
# encoding: utf-8
import sys
from glob import glob # glob will help us search for files based on their extension or filename.
from distutils.core import setup # distutils sends the data py2exe uses to know which file compile
import py2exe
data_files = [
# All the files that are not .py, .pyd or .pyc should be invoked so py2exe adds them to the compilation
("Microsoft.VC90.CRT",
glob(r'C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*')), # Adds the file to the compilation folder because it may broke inside the compilation
@DoctorMalboro
DoctorMalboro / setup.py
Created June 11, 2014 21:09
setup.py for py2exe app
import sys
from glob import glob
from distutils.core import setup
import py2exe
sys.path.append("C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\redist\\x86\\Microsoft.VC90.CRT")
data_files = [
("Microsoft.VC90.CRT", glob(r'C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*'))]
setup(
windows=['../main.py'],
includes=['sys', 'glob', 'os', 'datetime', 'webbrowser', 'PySide.QtGui', 'PySide.QtCore'],
@DoctorMalboro
DoctorMalboro / Fibonacci.py
Last active October 11, 2015 04:07
Python function that with the first 3 numbers returns a fibonacci sequence.
# coding: utf-8
from __future__ import print_function
def fibonacci(num1, num2, loop):
"""
Arguments:
num1 (int) = first number
num2 (int) = second number
loop (int) = the amount of times it iterates
"""