This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| EXTENSIONS = ['py', 'rb', 'cs', 'ex', 'js', 'go', 'rs', 'dart', 'php', 'sql'] | |
| def create_files_by_extension_given_a_filename(name, directory): | |
| for extension in EXTENSIONS: | |
| file = f"{name}.{extension}" | |
| if os.path.exists(os.path.join(directory, file)): | |
| print('{0}: already exists!'.format(file)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| def create_dirs_by_filenames(filenames, parent_dir): | |
| mode = 0o777 | |
| for directory in filenames: | |
| os.mkdir(os.path.join(parent_dir, directory), mode) | |
| def get_filenames(path): |
NewerOlder