Click here to Skip to main content
15,847,903 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Basically I want my python code to be able to read the line I have in my .txt file and print it out in another file when called.

What I have tried:

import os
import random
import time

var = open("Test.txt")

And what I get when I use that:

<_io.TextIOWrapper name='Test.txt' mode='r' encoding='US-ASCII'>
Updated 13-Oct-17 23:58pm
OriginalGriff 14-Oct-17 1:37am    
What does that do that you didn't expect, or not do that you did?
Where are you stuck?
What help do you need?

You only open the file, you have not read anything from it. See 7. Input and Output — Python 3.6.3 documentation[^]
Share this answer
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900