Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- """
- python 4.py "fich.txt"
- sys.argv = ["4.py"]@0, "fich.txt"@1]
- """
- #print (sys.argv)
- FILE_ADDRESS = 1
- strFileNameToDisplay = sys.argv[FILE_ADDRESS]
- strPrefix = strSufix = "_.-^-."*5
- try:
- fr = open(strFileNameToDisplay, "rt")
- strTheFileContents = fr.read()
- fr.close()
- except:
- strTheFileContents = "could not open file for reading"
- pass
- strFormat = "{} {} {}".\
- format(strPrefix, strFileNameToDisplay,strSufix)
- print (strFormat)
- print (strTheFileContents)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement