Python Forum
a challenging project idea
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
a challenging project idea
#2
https://docs.python.org/3/library/pathli...ath.rename

import pathlib

def rename(fname, to):
    pathlib.Path(fname).rename(to)

if __name__ == "__main__":
    import sys
    if len(sys.argv) >= 3:
        fname, to = sys.argv[1:3]
        rename(fname, to)
    else:
        print("rename.py: [from] [to]")
Reply


Messages In This Thread
a challenging project idea - by Skaperen - Apr-02-2019, 02:08 AM
RE: a challenging project idea - by nilamo - Apr-02-2019, 06:11 PM
RE: a challenging project idea - by Skaperen - Apr-03-2019, 03:28 AM
RE: a challenging project idea - by nilamo - Apr-03-2019, 04:13 PM
RE: a challenging project idea - by Skaperen - Apr-04-2019, 02:46 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Idea of project dibax10 2 2,116 Nov-26-2019, 08:57 PM
Last Post: dibax10
  a less challenging project idea Skaperen 2 2,394 Apr-07-2019, 03:01 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020