当前位置: 首页>>代码示例>>Python>>正文


Python Gui.endcol方法代码示例

本文整理汇总了Python中swampy.Gui.endcol方法的典型用法代码示例。如果您正苦于以下问题:Python Gui.endcol方法的具体用法?Python Gui.endcol怎么用?Python Gui.endcol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在swampy.Gui的用法示例。


在下文中一共展示了Gui.endcol方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: final_res

# 需要导入模块: from swampy import Gui [as 别名]
# 或者: from swampy.Gui import endcol [as 别名]
def final_res(ipusn):
            view=Gui()
            view.title('view results')
            fin=open('RES.txt')

            usn_gpa={}	#an dictionary with usn as key and gpa as items
            name_usn={}
            gpa_usn={}	#an dictionary with gpa as key and usn as items
            linesplit=[]	#an empty list
            gpaacc=[]		#a list to store all the gpas
            usnacc=[]		#a list to store all the usn
            usn_name={}		#a dictionary to map usn to names
            for line in fin:
                        linesplit=line.split(' ')	#reads the line and splits it into list of strings
                        gpa=gpa_calc(linesplit)		#sends the whole list to the function
                        usn_gpa[linesplit[1]]=gpa	#stores the gpa in a dictionary database
                        usnacc.append(linesplit[1])	#stores the usn into a usn accumilator
                        dell=' '
                        usn_name[linesplit[1]]=dell.join(linesplit[2:-18])	#extracts the name from the line
                        if gpa in gpa_usn:			#store all the usns with same GPAs under the GPA key
                                    gpa_usn[gpa].append(linesplit[1])
                        else:
                                    gpa_usn[gpa]=[linesplit[1]]

                        if gpa not in gpaacc:		#store gpa into gpaacc if it is not in the list
                                    gpaacc.append(gpa)

            gpaacc.sort(reverse=True)		#sort the gpa acc for finding the rank

            if ipusn not in usnacc:
                        view.la(text='Invalid USN\n Make sure you have entered the USN correctly')

            gpa2=usn_gpa[ipusn]		#get the gpa of the student whose usn is taken as input
            for i in range(len(gpaacc)):	#find the rank
                           if gpaacc[i]==gpa2:
                                       rank=i+1
            view.row()
            view.col()
            view.la(text='Hello %s' %usn_name[ipusn])
            view.la(text='Your SGPA is %s' %gpa2)
            view.la(text='Your SGPA position is %i: ' %rank)
            view.endcol()
            gpa_usn[gpa2].remove(ipusn)
            view.col(padx=50)
            view.la(text='Your SGPA is tied with %s students' %len(gpa_usn[gpa2]))
            view.col(pady=50)
            view.col(padx=5)
            for u in gpa_usn[gpa2]:
                        var='%s  (%s)' %(usn_name[u], u)
                        view.la(text=var)
                        view.col(pady=5)
开发者ID:hgsujay,项目名称:SGPA_py,代码行数:53,代码来源:res.py

示例2: press_me

# 需要导入模块: from swampy import Gui [as 别名]
# 或者: from swampy.Gui import endcol [as 别名]
en.insert(END, "This is an entry widget.")

la2 = g.la(text="")


def press_me():
    """this callback gets invoked when the user presses the button"""
    text = en.get()
    la2.configure(text=text)


# bu is for button
bu = g.bu(text="Press me", command=press_me)

# end of the first frame
g.endcol()


# FRAME 2

g.col()

# ca is for canvas
ca = g.ca(width=200, height=200)

item1 = ca.circle([0, 0], 70, "red")
item2 = ca.rectangle([[0, 0], [60, 60]], "blue")
item3 = ca.text([0, 0], "This is a canvas.", "white")

# mb is for menubutton
mb = g.mb(text="Choose a color")
开发者ID:Ehsan1981,项目名称:ThinkPython,代码行数:33,代码来源:widget_demo.py

示例3: Gui

# 需要导入模块: from swampy import Gui [as 别名]
# 或者: from swampy.Gui import endcol [as 别名]


win = Gui()	#initialise a win object
win.title('GPA Analysis')
win.row()
logo1=PIL.open('logo.png')
logo=ImageTk.PhotoImage(logo1)
win.la(image=logo)
win.row([0,0], padx=50)
win.la(text='Analysing 4th sem, ECE results \n of the year 2014')
win.col()
win.bu(text='About the app', command=ab_app)
win.bu(text='About the Developer', command=ab_dev)
win.la(text='Kindly mail your feedback to \n [email protected]')
win.endcol()
win.col([0,3],pady=70,padx=50)
win.la(text='Enter your USN')
entry=win.en(text='1BM12EC129')
win.bu(text='View result analysis', command=res)	#function res is invoked when the bu is clicked
win.endcol()
win.row([0,4], padx=1)
win.col()
bms=PIL.open('bmslogo.png')
bms=ImageTk.PhotoImage(bms)
win.la(image=bms)


win.mainloop()

开发者ID:hgsujay,项目名称:SGPA_py,代码行数:30,代码来源:res.py

示例4: launch

# 需要导入模块: from swampy import Gui [as 别名]
# 或者: from swampy.Gui import endcol [as 别名]

#.........这里部分代码省略.........
        global username
        for i in shared_source.distinct(username):
            if i['link'] not in shared_viewer.distinct('link'):
                add_link(i)
                link = new_shared_list.canvas.text([0,share_count], text = str(i['link']), activefill = 'blue')
                link.bind('<Double-1>', onObjectClick)
                share_count -= 12

    def onObjectClick(event):
        """
        allows us to double click on a link and show it, as well as remove it from the list of need to view links
        """
        global username
        for thing in point_total.find():
            for key in thing:
                if key == username:
                    existing = thing[username]
                    point_total.update({username: existing}, {'$inc': {username:1}})
                    points.config(text = str(existing + 1))
        index = event.widget.find_closest(event.x, event.y)
        i = shared_viewer.find()
        access = i[index[0] - 1]
        link = access['link']
        url_display(link)
        shared_source.remove({username: {'link':access['link'], 'friend':access['friend']}})


    #General set-up
    pretty = 'light cyan'

    gui = Gui()
    gui.title('MusicswAPPer')


    gui.row()
    gui.la(text = 'Welcome to the swAPP', bg = 'black', fg='cyan', justify = 'left', font = ('Times', 20, 'bold italic'), height = 2, relief = 'groove')
    gui.endrow()
    gui.row(bg=pretty)
    gui.col(bg=pretty)
    gui.bu(text = 'Refresh', fg = 'forest green', font = ('Times', 15, 'bold'), bg=pretty, activeforeground='forest green', activebackground='powder blue', command = update) 
    gui.row([0,1], pady = 10, bg=pretty)
    gui.endrow()
    gui.la(text = 'Share a link', bg = pretty, font = ('Times', 13, 'italic'), anchor = 'left', justify='left')
    friend = gui.en(text = 'Who do you want to share with?', disabledforeground = 'light gray', fg = 'black', font = ('Times', 12))
    en = gui.en(text = 'Insert URL here', font = ('Times', 12))
    gui.bu(text = 'Share', font = ('Times', 15, 'bold'), bg = pretty, fg = 'forest green', activebackground = 'powder blue', activeforeground = 'forest green', command = print_entry)
    label = gui.la(bg=pretty, font=('Times', 11))

    gui.row([0,1], pady = 10, bg=pretty)
    gui.endrow()

    gui.la(text = 'Share history', bg=pretty, font=('Times',13, 'italic'))
    share_history = gui.sc(width = 500, height = 300)
    share_history.canvas.configure(confine = False, scrollregion = (0,0,1000,1000)) 
     
    gui.endcol() 

    gui.col(bg=pretty)
    gui.ca(height = 100, width = 5, bg=pretty, bd=0)
    gui.endcol()
    gui.col(bg=pretty)
    gui.ca(height = 10, width = 5, bg=pretty, bd=0)
    gui.ca(height = 10, width = 5, bg='black',bd=0)
    gui.ca(height = 10, width = 5, bg=pretty,bd=0)
    gui.ca(height = 10, width = 5, bg='black',bd=0)
    gui.ca(height = 10, width = 5, bg=pretty,bd=0)
    gui.ca(height = 10, width = 5, bg='black',bd=0)
    gui.ca(height = 10, width = 5, bg=pretty,bd=0)
    gui.ca(height = 10, width = 5, bg='black',bd=0)
    gui.ca(height = 10, width = 5, bg=pretty,bd=0)
    gui.endcol()
    gui.col(bg=pretty)
    gui.ca(height = 100, width = 5, bg=pretty)
    gui.endcol()

    gui.col(bg=pretty)

    gui.la(text = 'New Shares from Friends', bg = pretty, font=('Times', 13, 'italic'))
    new_shared_list = gui.sc(width = 500, height = 100)
    new_shared_list.canvas.configure(confine = False, scrollregion = (0,0,1000,1000))

    gui.row([0,1], pady = 30, bg=pretty)
    gui.endrow()

    gui.la(text = 'Viewer', bg=pretty, font = ('Times', 13, 'italic'))
    canvas = gui.ca(width = 500, height = 300, bg='black')
    canvas.configure(confine = False, scrollregion = (0,0,2000, 2000))

    points = gui.la(bg=pretty)


    gui.endcol()

    gui.col(bg=pretty)
    gui.ca(height = 100, width = 5, bg=pretty)
    gui.endcol()

    gui.endrow()
    initialize()
    gui.mainloop()
开发者ID:vpreston,项目名称:MediaShareProject,代码行数:104,代码来源:rawmingui.py


注:本文中的swampy.Gui.endcol方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。