I don't know why i get the error because i have done exactly as the book says
>>> os.getcwd()
'C:\\Users\\expoperialed\\Desktop\\Pyt…'
>>> data = open('sketch.txt')
>>> print(data.readline(),end="")
SyntaxError: invalid syntax
Or, to use the print function like you want in Python 2:
>>> from __future__ import print_function
That will need to be at the top of your Python program though because of the way the __future__
module works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With