Esempio n. 1
0
 def OnInit(self):
     """Set up the main frame"""
     # Enable gif, jpg, bmp, png handling for wxHtml and icons
     wx.InitAllImageHandlers()
     self.frame=gui.MyFrame(None,-1, 'Abeni - The ebuild Builder ' + \
                            __version__.version)
     self.frame.Show(True)
     self.SetTopWindow(self.frame)
     return True
Esempio n. 2
0
 def __init__(self):
     """
     This starts the Tk framework up, instantiates the Model (a Counter object),
     instantiates the View (a MyFrame object), and starts the event loop that waits
     for the user to press a Button on the View.
     """
     root = tkinter.Tk()
     self.model = counter.Counter()
     self.view = gui.MyFrame(self)
     self.view.mainloop()
     root.destroy()
Esempio n. 3
0
"""
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
"""

import gui, wx

app = wx.PySimpleApp()
frame = gui.MyFrame(None, -1, 'reSTEditor - version 0.1')
frame.Maximize(1)
frame.Show(1)
app.MainLoop()
def recommend_movies(title, cos_sim1=cos_sim):

    title = title.lower()

    # First, we get the index of the movie for the inserted title
    movie_index = idx[title]

    # Then we compute the cosine similarity scores of all movies in the dataset to the one provided by the user
    similarity_scores = list(enumerate(cos_sim1[movie_index]))

    # The movies are then sorted based on their similarity ratings.
    similarity_scores = sorted(similarity_scores, key=lambda x: x[1], reverse=True)

    # Next, we obtain the similarity scores of the 10 most related movies
    similarity_scores = similarity_scores[1:11]

    # Here we acquire the indices of those most similar movies
    recommended_movies = [i[0] for i in similarity_scores]

    # Finally, we convert the dataframe to be a list for later use
    # and return the titles of the 10 recommended movies
    recommendations = movies['title'].iloc[recommended_movies].values.tolist()
    return recommendations

# GRAPHICAL USER INTERFACE

if __name__ == '__main__':
    app = wx.App()
    frame = gui.MyFrame()
    app.MainLoop()
Esempio n. 5
0
 def OnInit(self):
     self.my_app = gui.MyFrame(None, -1, "")
     self.my_app.Show()
     return True
Esempio n. 6
0
""""""

import wx

import gui
import othello
from strategy import Strategy

if __name__ == "__main__":
    game = othello.OthelloGame()
    game.load_strategy(Strategy)

    application = wx.App()
    frame = gui.MyFrame(title="Othello Game", othello=game)

    frame.Center()
    frame.Show()
    application.MainLoop()
    wx.Exit()