Categories
Code

A little something for my GF

01#!/usr/bin/env python
02'''
03This is made for my wonderfull girlfriend.
04'''
05try:
06    import psyco
07    psyco.full()
08    import random
09except:
10    import random
11         
12def getBooks(file):
13    import os
14    f = open(os.path.join(os.path.curdir,file),'r')
15    books = []
16    for line in f.readlines():
17        books.append(line)
18    return books
19 
20def shuffel(books):
21    num = random.randint(0,len(books)-1)
22    result = books[num] + ", Number of books in list %s" %len(books)
23    return result
24     
25def main():
26    print(shuffel(getBooks('books.txt')))
27    raw_input()
28 
29if __name__ == '__main__':
30    main() 
Categories
Code

Hello World

1if user == nice:
2    print "hello World"
3else:
4    print ":=("