2015FALL 40123157 CPB 期末報告

2015 計算機程式 作業一

作業一投影片

  • basic python program:
#first:
print("hello")

#second:
for i in range(5):
    print(i, "hello")

#third: example program
for i in range(5):
    print(i, i*"hello")
  • Jupyter: run and save to Y:\notebook\print1.ipynb

    1. run: example program
    2. save as: File >> Rename... >> save as "print1"
  • SciTE: run and save to Y:\tmp\print1.py

    1. run: example program
    2. save as: File >> Save As... >> rename "print1.py"
  • cmd.exe: test run "print1.py" Y:\tmp>python print1.py

  • github: 4 step git clone >> add >> commit >> push

    • step 1: copy cpbw1 HTTPS clone URL "https://github.com/學號/cpbw1.git"
    • step 2: cmd Y:\tmp>git clone https://github.com/學號/cpbw1.git
    • step 3: copy 2 file to Y:\tmp\cpbw1 paste
      • 2 file: "print1.ipynb" & "print1.py"
    • step 4: git
    #[step 4.1] go to cpbw1
    Y:\tmp>cd cpbw1

    #[step 4.2] submit update
    Y:\tmp\cpbw1>git add -A

    #[step 4.3] submit message
    Y:\tmp\cpbw1>git commit -m "add two files"

    #cmd.exe: Please tell me who you are.
    Run
      git config --global user.email "you@example.com"
      git config --global user.name "Your Name"

    #[step 4.4] user.email
    Y:\tmp\cpbw1>git config --global user.email "學號@nfu.edu.tw"

    #[step 4.5] user.name
    Y:\tmp\cpbw1>git config --global user.name "學號"

    #check user email & name Y:\home\.gitconfig open
    [user]
        email = 學號@gm.nfu.edu.tw
        name = 學號

    #[step 4.6] submit message again
    Y:\tmp\cpbw1>git commit -m "add two files"

    #cmd.exe:
    [master 版次編號] add two files
     2 files changed, 115 insertions(+)
     create mode 100644 print1.ipynb
     create mode 100644 print1.py

    #[step 4.7] push to github
    Y:\tmp\cpbw1>git push

    #[step 4.8] cmd.exe: 輸入帳密
    Username: 學校信箱
    Password: github密碼

    #update github\學號\cpbw1 success
  • note: cmd.exe 指令:
    • 查詢指令: dir
    • 更換目錄: cd
    • 回上一層: cd ..
    • 跳上一個: 上鍵
    • 跳下一個: 下鍵

※播放須知: 由於網頁嵌入式影片畫質較低, 建議直接點案影片視窗右下角前往Vimeo瀏覽!

40123157_2015cpbw1 from 盧毅民 on Vimeo.

Comments