下面是一種解決方案
在成都網(wǎng)站建設(shè)、網(wǎng)站建設(shè)中從網(wǎng)站色彩、結(jié)構(gòu)布局、欄目設(shè)置、關(guān)鍵詞群組等細(xì)微處著手,突出企業(yè)的產(chǎn)品/服務(wù)/品牌,幫助企業(yè)鎖定精準(zhǔn)用戶(hù),提高在線咨詢(xún)和轉(zhuǎn)化,使成都網(wǎng)站營(yíng)銷(xiāo)成為有效果、有回報(bào)的無(wú)錫營(yíng)銷(xiāo)推廣。創(chuàng)新互聯(lián)建站專(zhuān)業(yè)成都網(wǎng)站建設(shè)10多年了,客戶(hù)滿意度97.8%,歡迎成都創(chuàng)新互聯(lián)客戶(hù)聯(lián)系。
1 把gitbash 的路徑放到系統(tǒng)的Path環(huán)境變量里 我的是?C:\Program Files (x86)\Git\bin
2 這時(shí)候 你在系統(tǒng)命令行里就可以用git了
3 在python里倒入 os 模塊 然后執(zhí)行
os.system('git') 就可以了
C:\Users\Administratorpython
Python?2.7.8?(default,?Jun?30?2014,?16:08:48)?[MSC?v.1500?64?bit?(AMD64)]?on?win3
Type?"help",?"copyright",?"credits"?or?"license"?for?more?information.
import?os
os.system('git')
usage:?git?[--version]?[--help]?[-C?path]?[-c?name=value]
[--exec-path[=path]]?[--html-path]?[--man-path]?[--info-path]
[-p|--paginate|--no-pager]?[--no-replace-objects]?[--bare]
[--git-dir=path]?[--work-tree=path]?[--namespace=name]
command?[args]
The?most?commonly?used?git?commands?are:
add????????Add?file?contents?to?the?index
bisect?????Find?by?binary?search?the?change?that?introduced?a?bug
branch?????List,?create,?or?delete?branches
checkout???Checkout?a?branch?or?paths?to?the?working?tree
clone??????Clone?a?repository?into?a?new?directory
commit?????Record?changes?to?the?repository
diff???????Show?changes?between?commits,?commit?and?working?tree,?etc
fetch??????Download?objects?and?refs?from?another?repository
grep???????Print?lines?matching?a?pattern
init???????Create?an?empty?Git?repository?or?reinitialize?an?existing?one
log????????Show?commit?logs
merge??????Join?two?or?more?development?histories?together
mv?????????Move?or?rename?a?file,?a?directory,?or?a?symlink
pull???????Fetch?from?and?integrate?with?another?repository?or?a?local?branch
push???????Update?remote?refs?along?with?associated?objects
rebase?????Forward-port?local?commits?to?the?updated?upstream?head
reset??????Reset?current?HEAD?to?the?specified?state
rm?????????Remove?files?from?the?working?tree?and?from?the?index
show???????Show?various?types?of?objects
status?????Show?the?working?tree?status
tag????????Create,?list,?delete?or?verify?a?tag?object?signed?with?GPG
'git?help?-a'?and?'git?help?-g'?lists?available?subcommands?and?some
concept?guides.?See?'git?help?command'?or?'git?help?concept'
to?read?about?a?specific?subcommand?or?concept.
1
恰巧今天我在學(xué)習(xí)PageRank遇到digraph的問(wèn)題,踩了坑,來(lái)分享一下解決過(guò)程。其實(shí)用from pygraph.classes.digraph import digraph的時(shí)候就知道要下載pygraph第三方包。然而用pip install pygraph或者在pycharm里直接用“alt+enter”雖然可以安裝成功,并可以復(fù)制到項(xiàng)目的site-packages里,但是里面并沒(méi)有diagram方法可以用。后來(lái)便到了gituhb里找到了python-graph-master包,解壓后直接把里面的pygraph文件復(fù)制到項(xiàng)目的site-packages即可。附上鏈接網(wǎng)頁(yè)鏈接
參考文章
參考文章
復(fù)雜點(diǎn)的參考
試了一圈發(fā)現(xiàn),git庫(kù)的用法設(shè)置非常符合原生git命令,只不過(guò)之間加了個(gè) . 而已。
比如原本命令行里是 git add . ,這里就是 repo.git.add('.') ,
原本是 git commit -m "信息" ,這里就是 repo.git.commit(m='信息')
可以說(shuō)減少了很多學(xué)習(xí)時(shí)間,基本上我很多都是沒(méi)參考文檔自己猜出來(lái)的也能用。
庫(kù)安裝好后可以直接在python中用了。
文件夾地址可以是全路徑,也可以是 . 當(dāng)前文件夾、 ../ 上級(jí)文件夾等用法。