py_web---github程式碼程式庫使用

來源:互聯網
上載者:User

標籤:py web git

1.install pip

###############################################

# yum -y install epel-release

# yum -y install python-pip

# pip install --upgrade pip

# pip --version

pip 9.0.1 from /usr/lib/python2.7/site-packages (python 2.7)

#


2.install flask

###############################################

# pip install flask

Collecting flask

  Downloading Flask-0.12.2-py2.py3-none-any.whl (83kB)

    100% |████████████████████████████████| 92kB 264kB/s 

Collecting click>=2.0 (from flask)

  Downloading click-6.7-py2.py3-none-any.whl (71kB)

    100% |████████████████████████████████| 71kB 1.6MB/s 

Collecting Jinja2>=2.4 (from flask)

  Downloading Jinja2-2.9.6-py2.py3-none-any.whl (340kB)

    100% |████████████████████████████████| 348kB 3.2MB/s 

Collecting Werkzeug>=0.7 (from flask)

  Downloading Werkzeug-0.12.2-py2.py3-none-any.whl (312kB)

    100% |████████████████████████████████| 317kB 1.0MB/s 

Collecting itsdangerous>=0.21 (from flask)

  Downloading itsdangerous-0.24.tar.gz (46kB)

    100% |████████████████████████████████| 51kB 2.0MB/s 

Collecting MarkupSafe>=0.23 (from Jinja2>=2.4->flask)

  Downloading MarkupSafe-1.0.tar.gz

Installing collected packages: click, MarkupSafe, Jinja2, Werkzeug, itsdangerous, flask

  Running setup.py install for MarkupSafe ... done

  Running setup.py install for itsdangerous ... done

Successfully installed Jinja2-2.9.6 MarkupSafe-1.0 Werkzeug-0.12.2 click-6.7 flask-0.12.2 itsdangerous-0.24



3. git repository usage



# yum install -y git

1). 初始化git repository

首先github建立代碼倉庫

### initial git 

本地程式碼程式庫/opt/firstapp/py_web,遠程程式碼程式庫地址 https://github.com/longtian001/py_web

# cd /opt/firstapp(程式碼程式庫存放目錄)

### def remote origin

# git remote add origin https://github.com/longtian001/py_web

### get remote repository to local

# git clone https://github.com/longtian001/py_web


### watch remote git

# git remote -v

origin  https://github.com/longtian001/py_web (fetch)

origin  https://github.com/longtian001/py_web (push)


2).所有檔案初次提交遠程git repository)

# cd py_web

# git add . (將改動添加到暫存區)

# git commit -m "init prog"

# git push origin master 將本地更改推送到遠程master分支。


3).添加新的檔案

py_web檔案夾添加了新的代碼檔案

# git add newfile_name (將改動添加到暫存區)

# git commit -m "add new file"

# git push origin master 將本地更改推送到遠程master分支。


4).修改同名檔案後提交


如果在github的remote上已經有了檔案,會出現錯誤。

此時應當先pull一下,即:

# git add .

# git commit -m "modify add flask"

# git pull origin master 

然後再進行:  

# git push origin master



5).刪除檔案


# git rm *.py -r 

rm ‘hello.py‘

rm ‘hello02.py‘

# git commit -m "rm py files"

[master 9f6ea78] rm py files

 Committer: longtian001 <[email protected]>

Your name and email address were configured automatically based

on your username and hostname. Please check that they are accurate.

You can suppress this message by setting them explicitly:


    git config --global user.name "Your Name"

    git config --global user.email [email protected]


After doing this, you may fix the identity used for this commit with:


    git commit --amend --reset-author


 2 files changed, 16 deletions(-)

 delete mode 100644 hello.py

 delete mode 100644 hello02.py

 

# git push origin master

Username for ‘https://github.com‘: 輸入使用者名稱

Password for ‘https://[email protected]‘: 輸入密碼

Counting objects: 3, done.

Compressing objects: 100% (1/1), done.

Writing objects: 100% (2/2), 238 bytes | 0 bytes/s, done.

Total 2 (delta 0), reused 0 (delta 0)

To https://github.com/longtian001/py_web

   e71fc04..9f6ea78  master -> master


本文出自 “yiyi” 部落格,請務必保留此出處http://heyiyi.blog.51cto.com/205455/1958603

py_web---github程式碼程式庫使用

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.