Apr-25-2019, 11:05 PM
I am new in programing , I use python 3.7.2- when I write any code in python file and make RUN I have invalid syntax message
forexample:
I have file with name new file.py I write this :
f=open('bbb.txt', 'w')
file.Write('hello')
file.close()
make RUN then I receive invalid syantax
Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> f=open('new.txt','w')
>>> f.write(h'hello')
>>> f.close()
>>> import os
>>> if os.path.exists('newfolder'):
print('yes')
else:
print('no')
>>> if not os.path.exists('folderst'):
os.mkdir('folderst')
forexample:
I have file with name new file.py I write this :
f=open('bbb.txt', 'w')
file.Write('hello')
file.close()
make RUN then I receive invalid syantax
Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> f=open('new.txt','w')
>>> f.write(h'hello')
>>> f.close()
>>> import os
>>> if os.path.exists('newfolder'):
print('yes')
else:
print('no')
>>> if not os.path.exists('folderst'):
os.mkdir('folderst')