Redirect input output stream

This creates a dictionary from two lists, and redirects the input output stream to a file.

Write a file with in python.

Date Created:Friday December 29th, 2006 03:41 AM
Date Modified:Wednesday July 30th, 2008 11:49 PM

import os

import sys

newfileraw_input('Enter File Name:') + '.txt'

names = []

ideas = []

content = {}

while 1:

        name raw_input('Enter Name:')

        if name == 'exit': break

        if name in names:

                print " Already a Name !"


        idea raw_input('Enter Idea:')

        print 'Hello'name"\n"idea



for (n,iin zip(names,ideas):


print os.path.abspath(newfile)

temp sys.stdout

sys.stdout open(newfile,'a')

print content

sys.stdout temp

Download: 654 B

Please login or Click Here to register for downloads
Creative Commons License
Redirect input output stream by Dan Lynch
is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
Based on a work at
Permissions beyond the scope of this license may be available at