forked from geekcomputers/Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestlines.py
More file actions
16 lines (12 loc) · 567 Bytes
/
testlines.py
File metadata and controls
16 lines (12 loc) · 567 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Script Name : testlines.py
# Author : Craig Richards
# Created : 08th December 2011
# Last Modified :
# Version : 1.0
# Modifications :
# Description : This very simple script open a file and prints out 100 lines of whatever is set for the line variable
line="Test you want to print\n" # This sets the variable for the text that you want to print
f=open('mylines.txt','w') # Create the file to store the output
for i in range(1,101): # Loop 100 times
f.write(line) # Write the text to the file
f.close() # Close the file