GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Python/dir_test.py at master · TensorUI/Python Expand file tree/ Copy pathdir_test.pyMore file actions 32 lines (25 loc) · 820 Bytes / Copy pathdir_test.pyFile metadata and controls32 lines (25 loc) · 820 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 # Script Name : dir_test.py # Author : Craig Richards # Created : 29th November 2011 # Last Modified : # Version : 1.0 # Modifications : # Description : Tests to see if the directory testdir exists, if not it will create the directory for you from __future__ import print_function import os try: input = raw_input except NameError: pass def main(): CheckDir = input("Enter the name of the directory to check : ") print() if os.path.exists(CheckDir): # Checks if the dir exists print("The directory exists") else: print("No directory found for " + CheckDir) # Output if no directory print() os.makedirs(CheckDir) # Creates a new dir for the given name print("Directory created for " + CheckDir) if __name__ == '__main__': main() |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |