Quick Search


Tibetan singing bowl music,sound healing, remove negative energy.

528hz solfreggio music -  Attract Wealth and Abundance, Manifest Money and Increase Luck



 
Your forum announcement here!

  Free Advertising Forums | Free Advertising Board | Post Free Ads Forum | Free Advertising Forums Directory | Best Free Advertising Methods | Advertising Forums > Other Methods of FREE Advertising > Free Link Exchange

Free Link Exchange Free Link Exchange

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 04-04-2011, 05:54 AM   #1
cxbwqqmtf
Chief Warrant Officer
 
Join Date: Feb 2011
Posts: 290
cxbwqqmtf is on a distinguished road
Default Windows 7 Starter Pythonを使ってソフトウェア工学の

Pythonを使ってソフトウェア工学の課題に手をつけてみた。しかし、、、 Python Pythonに興味があったので、練習がてらに課題のコーディングをしてみた,Office 2010 Professional Plus。 課題は、レポートの提出管理システムをプログラミングしろ、というもの。 具体的には、生徒はレポートの提出を手動で行うようになっていて、先生にレポートを提出したらシステムにア クセスすることで提出完了の認証を行い、先生はレポートの提出状況をシステムで確認。 さらに、先生はレポートの採点をシステム上で行い、生徒は自分の成績と平均点を確認できる、というシステム をUML図とプログラムを書いてこい、だそうで。 そんでいい機会だし、Pythonを使ってみようということでいろいろググったりしてやってみ た。 のだけれど、なんかよくわからんエラーが出る。 ソースコード
# -*- coding: utf-8 -*-
import sys class Submit: def __init__(self, identify): self.title = name def submit(self): infile = "submit.txt" submit_list = [] try: f = open(infile, "a") #Open "submit.txt" in add mode. for row in f: submit_list.append(row) #Array of submitted. for member in submit_list: if name == member[0]: return False try: f.write(self.name+",Office 2007 Professional Plus Key,send") except IOError, (errno, msg): print "except: Cannot write to %s" % infile print " errno: [%d] msg: [%s]" % (errno, msg) finally: f.close except IOError, (errno,Windows 7 Starter, msg): print "except: Cannot open to %s" % infile print " errno: [%d] msg: [%s]" % (errno, msg) return True course Accunt: def recognize(self): cmd1 = raw_input("Type ID: ") #Students's or teacher's ID. cmd2 = raw_input("Type Password: ") #Students's or teacher's password. f = open("accunt.txt","r") #Open "accunt.txt" in read mode. for row in f: #Each line of "accunt.txt". if cmd1 + ",Microsoft Office Ultimate 2007," + cmd2 == row.rstrip(): return cmd1 #Return Students's or teacher's name. f.close #Close "accunt.txt". return False course MarkScore: def mark(self): pass if __name__ == "__main__": accunt = Accunt() identify = accunt.recognize() if identify!=False: while 1: cmd = raw_input("Select Command. (Type 'q' is quit.): ") if cmd=="submit": print identify sub = Submit(name) result = sub.submit() print result if cmd=="q": sys.exit() 実行結果 Type ID: unko Type Password: unko Select Command. (Type 'q' is quit.): submit unko except: Cannot open to submit.txt errno: [9] msg: [Bad file descriptor] True Select Command. (Type 'q' is quit.): q #=>ここで終了 Bad file descriptorだからファイル記述子が不正ということらしい。 "a"がいけないのか?とも思ったけど違うよな… もうちょい調べないとちゃんと使えないなぁ,Purchase Windows 7。 ぐぬぬ。 Permalink | コメント(0) | トラックバック(0) | 08:46
cxbwqqmtf is offline   Reply With Quote
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 08:33 PM.

 

Powered by vBulletin Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Free Advertising Forums | Free Advertising Message Boards | Post Free Ads Forum