Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
invalid syantx
#1
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')
Reply


Messages In This Thread
invalid syantx - by metro779966 - Apr-25-2019, 11:05 PM
RE: invalid syantx - by keames - Apr-26-2019, 01:31 AM
RE: invalid syantx - by perfringo - Apr-26-2019, 07:18 AM
RE: invalid syantx - by keames - Apr-26-2019, 03:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  zlib decompress error: invalid code lengths set / invalid block type DreamingInsanity 0 6,918 Mar-29-2020, 12:44 PM
Last Post: DreamingInsanity

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020