3

I am trying to make directory using os.mkdir in python
It works fine when path is D:\screenshots\data

os.mkdir("D:\screenshots\data")

but it gives error when path is D:\screenshots\subs:air.com.freshplanet.games.MoviePop:moviepop.vip.1month

os.mkdir("D:\screenshots\subs:air.com.freshplanet.games.MoviePop:moviepop.vip.1month")
[Error 123] The filename, directory name, or volume label syntax is incorrect: 'D:\\screenshots\\subs:air.com.freshplanet.games.MoviePop:moviepop.vip.1month'

I don't know why it is giving this error

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Umair Khalid
  • 150
  • 1
  • 1
  • 12

1 Answers1

2

I experienced a similar error while working in jupyter notebook.similar to OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: And i figured it out to be a double slash instead of single. I don't know why i had to give double back slash(\) instead of single. How ever it solved my problem Even before a day i used the same single back slash() to change directory. Please comment if someone knows about it.

S k
  • 23
  • 5