Make shotcut to VS solution files with python
来源:互联网 发布:java 成功生成文件夹 编辑:程序博客网 时间:2024/06/11 11:21
import osimport globfrom win32com.client import Dispatchdef multisplit(strToSplit, listSep): listSplit = strToSplit.split( listSep[0] ) if len(listSep) <= 1: return listSplit listSubSplit = [] for subStr in listSplit: listSubSplit += multisplit( subStr, listSep[1:] ) return listSubSplit def create_shotcut( target, filename ): shell = Dispatch('WScript.Shell') shortcut = shell.CreateShortCut(filename) shortcut.Targetpath = target shortcut.WorkingDirectory = os.path.split(target)[0] shortcut.IconLocation = target shortcut.save()path = "d:/dev/"linkpath = path + "SolutionLinks/"slns = glob.glob( path + "*/*/dev/src/*.txt" )print(slns)for sln in slns: dirs = multisplit(sln, ["/", "\\", "."]) slnname = dirs[-2] subdir = dirs[2] print(subdir, ":", slnname) os.makedirs(linkpath+subdir, exist_ok=True) #os.link( sln, linkpath + subdir + "/" + slnname ) try: create_shotcut( sln, linkpath + subdir + "/" + slnname + ".lnk" ) except Exception as e: print(e)
阅读全文
0 0
- Make shotcut to VS solution files with python
- How to Hook Up a VS.NET 2005 Solution With CruiseControl.NET in a Few Minutes
- 如何象VS一样快速编辑Torque的CS文件(How to make your Torque CS files quickly)
- Solution of ArrayIndexOutOfBoundsException while extractor Microsoft Format Files with POI
- The best way to deal with large files in Python style
- How to map asm files with online database files
- Sharing Files with NFC ->Sending Files to Another Device
- Solution to Failed to find "glu32" in "" with CMAKE_CXX_LIBRARY_ARCHITECTURE ""
- make and build package, copy files to dest dir
- Reading and writing .mat files with Python
- Read & Write Excel files with Python
- Write Excel files with Python using xlwt
- Working with Excel Files in Python
- read excel files with python and xlrd
- Ways to Make Money with Instant Information
- How to make sexy buttons with CSS
- How to Make cURL works with cmake
- Python: How to import other Python files
- java 单例模式
- kafka学习笔记
- 分治法
- Marvell交换机luaCLI引擎启动流程以及如何解决函数cpssInitSystem()被二次调用的问题
- WEBADI日记账导入操作
- Make shotcut to VS solution files with python
- JZOJ 5432 三元组
- 两相四线步进电机的驱动
- Java新特性之try-with-resources实践
- codevs2245 股票趋势 ( 二维线段树+dp )
- ubuntu安装TensorFlow及编辑器pycharm
- webstorm安装
- SSL2811 2017年10月30日提高组T2 摘Galo(树形dp)
- 对java super 学习理解