<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
Step1:  Howto with examples on 'pickle' module ==> 28/May/2016
Step4:  This is the content of nopickle.txt 
1143['AECS', 'LAYOUT', 'KUNDALAHALLI']58.3('Bangalore', 560037)
Step6:  **  This is the content of pickle.txt
See the section 'DATA' in the help(pickle) to understand
what's the various markers mean i.e. I, aS, p1, a.F
I1143
.(lp0
S'AECS'
p1
aS'LAYOUT'
p2
aS'KUNDALAHALLI'
p3
a.F58.3
.(S'Bangalore'
p0
I560037
tp1
Step8:  Short notes on the above code output
We are passing the filehandle to the 'pickout' function.
While in this function, we check the argument passed to it and it's type.
[Stackoverflow thread on reading file contents (written using pickle) in a loop] (http
<ASSISTANT_TASK:>
Python Code:
An example to store the output without "pickle"
testfile = 'nopickle.txt'
var1 = 1143
var2 = ["AECS", "LAYOUT", "KUNDALAHALLI"]
var3 = 58.30
var4 = ("Bangalore", 560037)
def ezhudhu():
    with open(testfile, 'w+') as f:
        f.write(str(var1))
        f.write(str(var2))
        f.write(str(var3))
        f.write(str(var4))
    
    f.close()
    
    return None
    
def main():
    ezhudhu()
    
if __name__ == '__main__':
    main()
Explanation: Howto with examples on 'pickle' module ==> 28/May/2016
End of explanation
Let us now read the contents of 'nopickle.txt', also check it's type
Does it retain the original type of the variables ?
with open(testfile, 'r') as f:
    print f.readline()
    print(type(f.readline()))    
An example of store the outputin a file using 'pickle'
import pickle
testfile = 'pickle.txt'
var1 = 1143
var2 = ["AECS", "LAYOUT", "KUNDALAHALLI"]
var3 = 58.30
var4 = ("Bangalore", 560037)
def baree():
    with open(testfile, 'w+') as f:
        pickle.dump(var1, f)
        pickle.dump(var2, f)
        pickle.dump(var3, f)
        pickle.dump(var4, f)
            
    f.close()
    
    return None
    
def main():
    baree()
    
if __name__ == '__main__':
    main()
Explanation: This is the content of nopickle.txt 
1143['AECS', 'LAYOUT', 'KUNDALAHALLI']58.3('Bangalore', 560037)
End of explanation
Let us now read the contents of 'pickle.txt'.
Do the variables retain their types?
def pickout(fileobj):
    print "what's this file object : " 
    print fileobj
    print "it's type : "
    print type(fileobj)
    print "==" * 5 + "==" * 5
    while True:
        pickline = pickle.load(fileobj)
        yield pickline
    
with open('pickle.txt', 'rb') as f:
    for info in pickout(f):
        print info,
        print type(info)
Explanation: **  This is the content of pickle.txt
See the section 'DATA' in the help(pickle) to understand
what's the various markers mean i.e. I, aS, p1, a.F
I1143
.(lp0
S'AECS'
p1
aS'LAYOUT'
p2
aS'KUNDALAHALLI'
p3
a.F58.3
.(S'Bangalore'
p0
I560037
tp1
End of explanation
Example on how to read contents of 'pickle.txt'.
End of file condition handled.
def pickout(fileobj):
    print "what's this file object : " 
    print fileobj
    print "it's type : "
    print type(fileobj)
    print "==" * 5 + "==" * 5
    try:
        while True:
            pickline = pickle.load(fileobj)
            yield pickline
    except EOFError:
        pass
    
with open('pickle.txt', 'rb') as f:
    for info in pickout(f):
        print info,
        print type(info)
Explanation: Short notes on the above code output
We are passing the filehandle to the 'pickout' function.
While in this function, we check the argument passed to it and it's type.
[Stackoverflow thread on reading file contents (written using pickle) in a loop] (http://stackoverflow.com/questions/18675863/load-data-from-python-pickle-file-in-a-loop)
End of explanation
<END_TASK>