Skip to content

Conversation

abe-101
Copy link
Contributor

@abe-101 abe-101 commented Jun 23, 2022

Adding leading zeros to the file names keeps the files in order.
Renaming was wasy thanks to this neet code in python (pun intended)

import sys,os,re

for file in sys.argv[1:]:
    if __file__ in file: continue
    number, name = file.split('-', 1)
    number = '{:0>4}'.format(number)
    new_name = f'{number}-{name}'
    os.rename(file,new_name)

Using this neat python script:
import sys,os,re

for file in sys.argv[1:]:
    if __file__ in file: continue
    number, name = file.split('-', 1)
    number = '{:0>4}'.format(number)
    new_name = f'{number}-{name}'
    os.rename(file,new_name)
@mitchellirvin
Copy link
Collaborator

mitchellirvin commented Jul 12, 2022

hi @abe-101 ! i'm actually a fan of this, but @neetcode-gh's links on neetcode.io depend on the current file names, and this would be a breaking change. do you mind opening an issue that we can track separately if we feel like this is worth the lift?

@abe-101
Copy link
Contributor Author

abe-101 commented Jul 12, 2022

Hey @mitchellirvin Its funny you mentioned the dependancy issue as I was litterly gonna ask just that!
A few days a ago I discovered the new login feature on neetcode.io so i started going through grind75. Iit then downed on me the code solution all probably depend on this repo and my PR that changes the name would brake the site...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants