python毕业设计代码量_我毕业设计一个模块的python代码

本文介绍了一个使用Python开发的简易简历筛选系统,通过图形界面让用户选择感兴趣的职位类别,并保存选择结果以便后续处理。系统包括主程序、界面文件及实现文件等部分。

python真是太强大了,越用越喜欢,都担心能否够毕业设计要求的代码量了,嘻嘻。

这个模块的功能就是选取选取自己喜欢的分类然后保存选取的结果

1,主程序文件,resume

#!/usr/bin/python

import resume_imp

import resume_view

if __name__== "__main__":

resume_view.CResumeView(resume_imp.CResumeImp())

resume_view.main()

2,界面文件resume_view.py

#!/usr/bin/python

import pygtk

pygtk.require('2.0')

import gtk

class CResumeView:

def __init__(self,resume_imp):

self.resume_imp = resume_imp

self.init_gui()

def check_callback(self, widget,data=None):

i = data

state = widget.get_active()

res=self.resume_imp.select_do(i,state)

if(res < 0):

widget.set_active(False)

max= self.resume_imp.get_max_active_class()

self.msgbox('warnning','you must choice at most %d classes'%max)

def msgbox(self,title_str,msg_str):

def done(widget,data):

data.destroy()

dialog = gtk.Dialog(title_str, self.window, gtk.DIALOG_MODAL)

button = gtk.Button("ok")

button.connect('clicked',done,dialog)

dialog.action_area.pack_start(button, True, True, 0)

button.show()

label = gtk.Label(msg_str)

dialog.vbox.pack_start(label, True, True,0)

label.show()

dialog.show()

def button_callback(self, widget, data=None):

self.resume_imp.finish_resume()

def delete_event(self, widget, event, data=None):

gtk.main_quit()

return False

def init_gui(self):

#windows init

self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)

self.window.connect("delete_event", self.delete_event)

self.window.set_border_width(20)

n = self.resume_imp.get_list_len()

table = gtk.Table(n+1,4,True)

self.window.add(table)

#check button init

i = 0

while i

def main():

gtk.main()

return 0

3,实现文件resume_imp.py

#!/usr/bin/python

import resume_node

class CResumeImp:

def __init__(self):

self.init_resume()

def init_resume(self):

self.class_list = []

self.max_active_class = 5

self.list_len = self.init_raw_resume()

self.num_active_class = self.init_last_resume()

def init_raw_resume(self):

n=0

f=file('class.db')

while True:

line = f.readline()

if len(line) == 0:

break

n = n+1

self.class_list.append(self.split_entry(self.get_string(line)))

f.close()

return n

def init_last_resume(self):

f=file('resume.db')

n = 0

while True:

line = f.readline()

if len(line) == 0:

break

n = n + 1

i = self.find_entry(self.get_string(line))

# not find out

if (i < 0):

continue

self.class_list[i].state='active'

return n

f.close()

def find_entry(self, elem):

i = 0

while i < self.list_len:

if self.class_list[i].id == elem:

return i

i = i+1

return -1

def finish_resume(self):

self.write_resume_file()

def write_resume_file(self):

if self.num_active_class == 0:

print "please choice at least one class"

return

f=file('resume.db','w')

n = len(self.class_list)

i=0

while i < n:

state = self.class_list[i].state

if state == 'active':

line = self.class_list[i].id

f.write(line)

f.write('\n')

i=i+1

f.close()

# replace the \n

def get_string(self,str):

return str.replace('\n','')

def get_list_len(self):

return self.list_len

def get_show_name(self,i):

# all is not used

#id = self.class_list[i].id

#name = self.class_list[i].name

#n = self.get_class_level(id)

#result = ""

#i=0

#while i

def get_class_level(self, index):

id = self.class_list[index].id

n = 0

while True:

i = id.find('.')

if i < 0:

return n

n = n + 1

id = id[i+1:len(id)]

def split_entry(self,entry):

i=entry.find(':')

if i == -1:

return {}

id=entry[0:i]

name=entry[i+1:len(entry)]

return resume_node.CResumeNode(id,name,'inactive')

def select_do(self,i,state):

if state == True :

self.num_active_class = self.num_active_class + 1

if(self.num_active_class > self.max_active_class):

return -1

self.set_active(i)

else:

self.num_active_class = self.num_active_class - 1

self.set_inactive(i)

return 0

def get_class_state(self, i):

return self.class_list[i].state

def get_max_active_class(self):

return self.max_active_class

def set_active(self,i):

self.class_list[i].state = 'active'

def set_inactive(self,i):

self.class_list[i].state = 'inactive'

4,列表节点类文件

#/usr/bin/python

class CResumeNode:

def __init__(self,id,name,state='inactive'):

self.id=id

self.name=name

self.state=state

The three datasets contain the performance metrics of 520, 527 and 547 VMs from a distributed datacenter of Materna. Materna is a full service provider in the premium segment and has been successfully implementing ITC projects for their customers for more than 35 years. Thier client list reads like the “Who’s Who” of German companies and public sector organisations. Throughout Europe there are around 1,700 employees working for Materna, including highly specialized and certified consultants, software developers, software architects and project managers as well as editors and marketing experts - all with well-proven project experience. Materna covers the complete spectrum of services you would expect from a full service provider: from strategy and consulting services through to implementation and operations. The range of services is organised in six Business Lines: IT Factory, Digital Enterprise, Government and Communications, as well as cbs, a SAP business consultancy company. Each file of teh three datasets contains the performance metrics of a specific VM. These files are organized according by traces: Materna-trace-1, Materna-trace-2 and Materna-trace-3. The first trace consists of 520 VMs, the second trace consits of 527 VMs and the third trace consits of 547 VMs. The traces were taken in the distributed Materna Data Centers in Dortmund over a timespan of three months. Each trace represents one month of data. Running VMs in the traces are mostly the same in all three datasets. The workloads in the traced VMs are highly critical business applications of internatinaly known companies. All datasets contain a special text-file listing relevant trace-metrics. The traces were taken on a VMware ESX environment using the following physikal resources:
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值