from __future__ import division
from scipy import *
import Ball

# Open a file and read the contents
f = open('Ball.py','r')   # Open the file for reading
text = f.readline()       # Read one line from file
text = f.read()           # Read everything from file
text_list = f.readlines() # Read all lines into a list
f.close()                 # Close the file

# Reading numbers
f = open('lesson.numbers','r')
text = f.read()
f.close()
word_list = text.split(',')
number_list = [float(word) for word in word_list]
print number_list

# Read a dictionary
f = open('lesson.numbers','r')
lines = f.readlines()
f.close()
result = {}
for line in lines:
    line = line.strip() # Remove whitespace from beginning and end of string
    if line != '':
        x = line.split(': ')
        result[x[0]] = float(x[1])
print result

