Skip to content

Instantly share code, notes, and snippets.

@mlai-demo
Created December 30, 2019 21:28
Show Gist options
  • Save mlai-demo/366434adc539dade03bbfcf9d98263ac to your computer and use it in GitHub Desktop.
Save mlai-demo/366434adc539dade03bbfcf9d98263ac to your computer and use it in GitHub Desktop.
import shutil
os.mkdir('RenamedPub')
old_txt_dir = path + "/TextsPub"
new_txt_dir = path + "/RenamedPub"
file01 = shutil.copy(old_txt_dir + '/5827', new_txt_dir + '/Problems_Philosophy.txt')
file02 = shutil.copy(old_txt_dir + '/690', new_txt_dir + '/Roads_Freedom.txt')
file03 = shutil.copy(old_txt_dir + '/2529', new_txt_dir + '/Analysis_Mind.txt')
file04 = shutil.copy(old_txt_dir + '/25447', new_txt_dir + '/Mysticism_Logic.txt')
file05 = shutil.copy(old_txt_dir + '/4776', new_txt_dir + '/Political_Ideals.txt')
file06 = shutil.copy(old_txt_dir + '/44932', new_txt_dir + '/Free_Thought.txt')
file07 = shutil.copy(old_txt_dir + '/37090', new_txt_dir + '/Knowledge.txt')
file08 = shutil.copy(old_txt_dir + '/17350', new_txt_dir + '/Bolshevism.txt')
file09 = shutil.copy(old_txt_dir + '/55610', new_txt_dir + '/Why_Fight.txt')
file10 = shutil.copy(old_txt_dir + '/52091', new_txt_dir + '/Foundations_Geometry.txt')
text_titles = []
for fn in texts:
basename = os.path.basename(fn)
title, ext = os.path.splitext(basename)
text_titles.append(title)
titles = sorted(set(text_titles)); titles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment