Python Forum
Help repeately prompting for directory name if it already exists.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help repeately prompting for directory name if it already exists.
#4
You can't use else with try unless you also have an except section. I think you actually want to have that else be except IOError:. That way you make the directory if an error was raised trying to find it.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Help repeately prompting for directory name if it already exists. - by ichabod801 - Aug-05-2019, 01:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  p]Why os.path.exists("abc/d") and os.path.exists("abc/D") treat same rajeev1729 1 2,187 May-27-2020, 08:34 AM
Last Post: DeaD_EyE
  create a new directory if not already exists fioranosnake 1 1,717 Aug-28-2019, 07:26 PM
Last Post: Larz60+
  Prompting user for number, reading number, squaring it and returning result JHPythonLearner 5 3,062 Sep-13-2018, 04:05 PM
Last Post: gruntfutuk

Forum Jump:

User Panel Messages

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