简体   繁体   中英

how to copy files to users home directory or current directory using distutils?

I am writing a python package (svnplot). I want to copy a shell script or batch files in users home directory or current directory, so that user can conveniently execute the commands in the package.

Currently to execute svnplot command, user have to call something similar to

python /svnplot/svnplot.py

If I copy a shell script or batch file in users home directory, then user just have to call

svnplot.sh

However, I am not able to figure out how to copy the files to users home directory.

Look at distutils scripts option or entry_points/console_scripts in setuptools .

If there is a single main command then you could use PyInstaller , py2exe to pack your package into a single executable. In simple cases it might be enough just to zip the package and execute that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM