Adding list data to a .txt file and re-opening these lists where prompted
Question: I have done some research and found various examples but as my python
knowledge is so basic I do not understand them.

Is there a method for importing ONLY the lists to another python window as any
import i try seems to import the list and then run that files functions which
I don't want it to do? I only want the other python pages to import the lists
to either show them or modify them further? I have no code for this but I
presume it would be something such as

    
    
    from 'filename' import task[],date[],description[]
    

The code this is on is as follows (Bear in mind I only want to lists. I don't
want the other functions to be run)

    
    
    import sys
    import os
    task=[]
    date=[]
    description=[]
    def addtask():
        """adds a task to the task list"""
        print("Please re-enter your filename with .txt on the end.")
        f=(raw_input("filename: "))
        file= open(f, "w+")
        add=(raw_input("Enter a task: "))
        if add=="helpme":
            os.startfile("C:\Users\Dale\Desktop\Python coursework\helpme.txt")
            add=(addtask())
        else:
            file.write(add)
            task.append(add)
        add1=(raw_input("Please enter a date for this task: "))
        if add1=="helpme":
            os.startfile("C:\Users\Dale\Desktop\Python coursework\helpme.txt")
            add=(addtask())
        else:
            file.write(add1)
            date.append(add1)
        add2=(raw_input("Please enter a description of the task: "))
        if add2=="helpme":
            os.startfile("C:\Users\Dale\Desktop\Python coursework\helpme.txt")
            add=(addtask())
        else:
            file.write(add2)
            description.append(add2)
        a=(raw_input("would you like to add another?: "))
        if a=="yes":
            print(addtask())
        elif a=="helpme":
            os.startfile("C:\Users\Dale\Desktop\Python coursework\helpme.txt")
            add=(addtask())
        else:
            import choices
    b=(raw_input("Would you like to add a task?"))
    if b=="yes":
        add=addtask()
    elif b=="no":
        import choices
    elif b=="helpme":
        os.startfile("C:\Users\Dale\Desktop\Python coursework\helpme.txt")
        add=(addtask())
    else:
        import choices
    

Hopefully that has come out correctly... Note* the three lists are called
`task[]`, `date[]` and `description[]`


Answer: Do you mean something like this?

    
    
    $ cat task.py 
    task=[1,2,3,4,5,6,7,8,9,0]
    
    $ python
    Python 2.7.3 (default, Sep 26 2012, 21:51:14) 
    [GCC 4.7.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from task import task
    >>> task
    [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
    

