This file contains hidden or 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 re | |
import sys | |
with open(sys.argv[1]) as f: | |
text = f.read() | |
numberRE = re.compile('08[3-8][0-9]{7}') | |
for w in numberRE.findall(text): | |
print w |
This file contains hidden or 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 fnmatch | |
import os | |
matches = [] | |
for root, dirnames, filenames in os.walk(path): | |
for filename in fnmatch.filter(filenames, '*.ext'): | |
matches.append(os.path.join(root, filename)) |
This file contains hidden or 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
''' | |
py 2.7 | |
assumptions: | |
- buze is currently running in a dir located outside of program files | |
- the dir is either formatted like: buze-x.x.x or buze-x.x.x-revision | |
[x]- read externally the name of latest version and revision. | |
[ ]- if version and revision equal current, offer to cease now. | |
[x]- get current buze path, go up level. |
This file contains hidden or 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
''' | |
py 2.7 | |
assumptions: | |
- buze is currently running in a dir located outside of program files | |
- the dir is either formatted like: buze-x.x.x or buze-x.x.x-revision | |
[x]- read externally the name of latest version and revision. | |
[ ]- if version and revision equal current, offer to cease now. | |
[x]- get current buze path, go up level. |
This file contains hidden or 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 re, urllib | |
def openurl(number): | |
base_url = "http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=" | |
url = base_url + str(number) | |
webpage = urllib.urlopen(url) | |
body = webpage.read() | |
if not re.search('^and the next nothing is', body): | |
print body | |
return re.search('\d+$', body).group() |
This file contains hidden or 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 csv | |
text = csv.reader(open('evoreg.csv', 'rb'), delimiter=';') | |
idList = ['Name', 'Boards', 'Age', 'Email', 'Games', 'Date'] | |
for row in text: | |
gamesList = row[5].split(',') | |
print '='*80 | |
for id, data in enumerate(row[1:7]): | |
if not id == 4: |
This file contains hidden or 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
require 'formula' | |
class Mysql < Formula | |
homepage 'http://dev.mysql.com/doc/refman/5.5/en/' | |
url 'http://downloads.mysql.com/archives/mysql-5.5/mysql-5.5.20.tar.gz' | |
md5 '375794ebf84b4c7b63f1676bc7416cd0' | |
depends_on 'cmake' => :build | |
depends_on 'readline' | |
depends_on 'pidof' |
This file contains hidden or 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
#include <stdio.h> | |
void print_options(){ | |
printf(" Please choose an option \n"); | |
printf(" 1: Balance Enquiry \n"); | |
printf(" 2: Withdraw Funds \n"); | |
printf(" 3: Quit \n"); | |
} | |
void print_welcome(){ |
This file contains hidden or 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 | |
import pygame | |
pygame.init() | |
width, height = 500, 500 | |
screen = pygame.display.set_mode((width, height)) | |
running = True | |
colorRed = (255,0,0) |
This file contains hidden or 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 | |
# encoding: utf-8 | |
""" | |
untitled.py | |
Created by XXX XXX on YYYY-MM-DD. | |
Copyright (c) YYYY __MyCompanyName__. All rights reserved. | |
""" | |
import sys |
OlderNewer