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 time | |
import sys | |
def update_progress(progress): | |
progress = round(progress*100, 1) | |
barLength = 20 | |
block = int(round(barLength*progress/100)) | |
text = "\rProgress: [{0}] {1}%".format( "#"*block + "-"*(barLength-block), progress) | |
sys.stdout.write(text) | |
sys.stdout.flush() |
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/python | |
# -*- coding: utf-8 -*- | |
''' | |
Simulates how many packages of Panini pictures have to be bought to get a certain amount of pictures. | |
@author: Adrianus Kleemans | |
@date: 19.06.2013 | |
''' | |
import random |
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
items = open('todo.txt', 'r').readlines() | |
for item in items: | |
item_file = open(item.strip() + '.txt', 'w') | |
item_file.write(item) |
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/python | |
# -*- coding: utf-8 -*- | |
''' | |
Downloads a sample PDF file. | |
''' | |
import urllib2 | |
def download(url): | |
print 'Starting download of', url |
NewerOlder