0
Open file and write
I am trying to open a file with RGB colors I want to make it as a list of 3 and save it.. file = input('Enter the name of color file: ') infile = open(file+'.txt','r') outfile = open('c1.txt','w') for line in infile : line = infile.readline() line = line.split(' ',3) outfile.write(line) infile.close() outfile.close() When I open the text file it is empty
2 Antworten
+ 1
use c#, it has StreamReader and StreamWriter and it's easy to understand
0
After that I want to use for loop to read the color from the file and drow a lines with the read color in a window