Skip to content

Commit 8f19bb2

Browse files
committed
This is a simple script that will print out x number of lines of text to a file, handy when you get lines at school !!
1 parent 2c811e8 commit 8f19bb2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

testlines.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Script Name : testlines.py
2+
# Author : Craig Richards
3+
# Created : 08th December 2011
4+
# Last Modified :
5+
# Version : 1.0
6+
7+
# Modifications :
8+
9+
# Description : This very simple script open a file and prints out 100 lines of whatever is set for the line variable
10+
11+
line="Test you want to print\n" # This sets the variable for the text that you want to print
12+
f=open('mylines.txt','w') # Create the file to store the output
13+
for i in range(1,101): # Loop 100 times
14+
f.write(line) # Write the text to the file
15+
f.close() # Close the file

0 commit comments

Comments
 (0)