Last active
December 10, 2018 06:50
-
-
Save bennyyip/25b8b92cae7629ed135f8aff8d4cf1df to your computer and use it in GitHub Desktop.
fasd_to_z
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
| #!/usr/bin/env python | |
| import os | |
| fasd = os.path.expandvars('$HOME/.fasd') | |
| z = os.path.expandvars('$HOME/.z') | |
| with open(fasd) as in_f, open(z, 'w') as out_f: | |
| for line in in_f: | |
| x = line.split('|') | |
| if not os.path.isdir(x[0]): | |
| continue | |
| x[1] = str(int(float(x[1]))) | |
| print(x) | |
| out_f.write('|'.join(x)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment