0
if  '.' not in filename:
    if not os.path.exists("shortcut"):
        os.mkdir("shortcut")
    shutil.copy(filename,"shortcut") **this row is line 70**
    os.remove(filename)
    print("shortcut don")

this is my code i faceing this error in follow image whene running my code

error message is here

1 Answers1

1

If you have a string you can just do the keyword in:

strval = './test'
if '.' not in strval:
  print('this won\'t happen')
else:
  print('there was a period in the string')

If you are using some other type/function then it should have something similar

Chase LP
  • 229
  • 2
  • 7