40823136

  • Home
    • Site Map
    • reveal
    • blog
  • First
  • About
  • stage1
    • w1
      • 建立網頁
      • 編輯leo
    • w2
      • 討論與影片
      • 圖檔
    • w3
      • 投石機(1)
      • 投石機(2)
      • 投石機(3)
      • 簡報-1
  • stage2
    • w5
      • stage2組員
    • w6
      • heroku
      • 選訂題目
    • w7
      • 自動化生產線(1)-用程式控制機械手臂與調整
    • w8
      • 自動化生產線(2)
    • w9
      • 自動化生產線(3)最終版
    • 簡報-2
  • stage3
    • w10
      • task1
      • task2-1
      • task2-2-python Remote API程式控制機械手臂
      • task2-3
    • w13
      • 第一組線上直播
      • RoboDK
    • w15
      • Video and subtitle translation-1
      • Video and subtitle translation-2
    • w16
      • Onshape 零組件繪製
      • 建立 CoppeliaSim 4.1.0 MTB robot 場景
      • 手臂末端加入 components-gripper-suction pad 吸盤跟鍵盤控制
      • 逆向運動學函式-鍵盤控制與程式迴圈方式
      • Python remote API 逆向運動學函式
  • stage3 專案
    • 自動化(1)
    • 自動化(2)
    • 自動化(3)
    • 心得
  • W18
    • 期末影片
w10 << Previous Next >> task2-1

task1

參考 40823131網站

# open file, default is read mode, since txt content no chinese char
# no encoding = "UTF-8" is needed
with open("stage3_2a.txt") as ab: 
    #先將我們存起來stage3_2a.txt打開並命名為ab
    data = ab.readlines()
    #將stage3_2a.txt的資料讀取檔案中的所有內容 (存成串列形式)
    data = [a.replace('4823122','40823122') for a in data]
    #因為有一組學號寫錯所以用 replace 把舊的字串替換成新的字串 
    data = [b.replace('\t\t','') for b in data]
      #因為有一組少2個人,所以用水平跳格來消除空格
     #print(data)
#print(len(data))
for i in range(len(data)):
    #設一個範圍len(data)=6,變數為i,從0加到5,每次加1 [0,1,2,3,4,5]
    group = data[i].rstrip("\n").split("\t") 
    #先取出data list中的第i項,消除元素中/n ,再找出新的元素
    print('<p>'+group[0]+' | <a href="https://'+group[1]+'.github.io/stage3-ag'+group[0][9]+'">Website</a> | <a href="https://github.com/'+group[2]+'/stage3-ag'+group[0][9]+'">Repository</a></p>')
    #將 group list(串列)中的元素,將網站跟倉儲依序印出來 
    for j in range(2,18,2):
        #設一個範圍,(2到18,每次加2,但不能大於18)
        try:
            print('<p>'+group[j]+' | Website:'+'<a href="https://'+group[j]+'.github.io/cd2021'+'">'+group[j]+'</a>'+' | Repository:'+'<a href="https://github.com/'+group[j]+'/cd2021'+'">'+group[j]+'</a> </p>')
          #將 group list(串列)中的元素,將網站跟倉儲依序印出來   
        except:
          continue
           #這邊使用try.....except,因為有一組6個人,如果沒用會失敗,最後用continue是要讓迴圈繼續跑

stage3_ag1 | Website | Repository

40823131 | Website:40823131 | Repository:40823131

a40823112 | Website:a40823112 | Repository:a40823112

40823123 | Website:40823123 | Repository:40823123

40823145 | Website:40823145 | Repository:40823145

40823136 | Website:40823136 | Repository:40823136

40823109 | Website:40823109 | Repository:40823109

40823116 | Website:40823116 | Repository:40823116

40823108 | Website:40823108 | Repository:40823108

stage3_ag2 | Website | Repository

40823151 | Website:40823151 | Repository:40823151

40623121 | Website:40623121 | Repository:40623121

40871106 | Website:40871106 | Repository:40871106

40823102 | Website:40823102 | Repository:40823102

40823104 | Website:40823104 | Repository:40823104

40823106 | Website:40823106 | Repository:40823106

40823101 | Website:40823101 | Repository:40823101

40823132 | Website:40823132 | Repository:40823132

stage3_ag3 | Website | Repository

40823119 | Website:40823119 | Repository:40823119

40823150 | Website:40823150 | Repository:40823150

40823103 | Website:40823103 | Repository:40823103

40823107 | Website:40823107 | Repository:40823107

40523252 | Website:40523252 | Repository:40523252

40823154 | Website:40823154 | Repository:40823154

stage3_ag4 | Website | Repository

40823142 | Website:40823142 | Repository:40823142

40823144 | Website:40823144 | Repository:40823144

40823127 | Website:40823127 | Repository:40823127

40823148 | Website:40823148 | Repository:40823148

40823121 | Website:40823121 | Repository:40823121

40823135 | Website:40823135 | Repository:40823135

40823114 | Website:40823114 | Repository:40823114

40823146 | Website:40823146 | Repository:40823146

stage3_ag5 | Website | Repository

40823111 | Website:40823111 | Repository:40823111

40823115 | Website:40823115 | Repository:40823115

40823128 | Website:40823128 | Repository:40823128

40823120 | Website:40823120 | Repository:40823120

40823140 | Website:40823140 | Repository:40823140

40823124 | Website:40823124 | Repository:40823124

40823139 | Website:40823139 | Repository:40823139

40823126 | Website:40823126 | Repository:40823126

stage3_ag6 | Website | Repository

40823152 | Website:40823152 | Repository:40823152

40823110 | Website:40823110 | Repository:40823110

40823122 | Website:40823122 | Repository:40823122

40823125 | Website:40823125 | Repository:40823125

40823117 | Website:40823117 | Repository:40823117

40823129 | Website:40823129 | Repository:40823129

40823149 | Website:40823149 | Repository:40823149

40823153 | Website:40823153 | Repository:40823153



w10 << Previous Next >> task2-1

Copyright © All rights reserved | This template is made with by Colorlib