資源簡介
一個由源文件自動生成vs工程的腳本,使用時放到源文件的根目錄下,直接執行就可以看到效果了。由于腳本是python編寫的,請先安裝python2.

代碼片段和文件信息
#?vsproj.py
import?uuid
import?os
import?os.path
import?re
def?write_file(filepath?str):
f?=?file(filepath?“w“)
f.write(str)
f.close()
proj_uuid?=?str(uuid.uuid1()).upper()
cwd?=?os.getcwd()
proj_name?=?cwd[cwd.rfind(“\\“)+1:]
vs_dir?=?“vs2012“
#?sln?
sln?=?\
“Microsoft?Visual?Studio?Solution?File?Format?Version?12.00“\
“\n#?Visual?Studio?2012“\
“\nProject(\“{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\“)?=?\“$proj_name\“?\“vs2012.vcxproj\“?\“{$proj_uuid}\““\
“\nEndProject“\
“\nGlobal“\
“\n GlobalSection(SolutionConfigurationPlatforms)?=?preSolution“\
“\n Debug|Win32?=?Debug|Win32“\
“\n Release|Win32?=?Release|Win32“\
“\n EndGlobalSection“\
“\n GlobalSection(ProjectConfigurationPlatforms)?=?postSolution“\
“\n {$proj_uuid}.Debug|Win32.ActiveCfg?=?Debug|Win32“\
“\n {$proj_uuid}.Release|Win32.ActiveCfg?=?Debug|Win32“\
“\n EndGlobalSection“\
“\n GlobalSection(SolutionProperties)?=?preSolution“\
“\n HideSolutionNode?=?FALSE“\
“\n EndGlobalSection“\
“\nEndGlobal\n“
sln?=?sln.replace(“$proj_uuid“?proj_uuid).replace(“$proj_name“?proj_name)
#print?sln
#?vcxproj
vcproj?=?\
“l?version=\“1.0\“?encoding=\“utf-8\“?>“\
“\nlns=\“http://schemas.microsoft.com/developer/msbuild/2003\“>“\
“\n??“\
“\n????“\
“\n??????Debug “\
“\n??????Win32 “\
“\n???? “\
“\n?? “\
“\n?? “\
“\n?? “\
“\n??“\
“\n?? ??“\
“\n??“\
“\n???? “\
“\n?? “\
“\n??“\
“\n????Application “\
“\n????true “\
“\n????v110 “\
“\n????MultiByte “\
“\n?? “\
“\n??“\
“\n????{$proj_uuid} “\
“\n????vs2012 “\
“\n????$proj_name “\
“\n?? “\
“\n?? “\
“\n??“\
“\n????Application “\
“\n????true “\
“\n????v110
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????7015??2016-02-28?18:59??vsproj.py
- 上一篇:fcntl.py模塊
- 下一篇:caffe Makefile.config
評論
共有 條評論