Esempio n. 1
0
def getcontent():
    ''' filed=open('dictionary.txt',"a")
    #print(filed)
    counting=open('count.txt',"r")
    print(counting)
    s=counting.read()
    counting.close()
    count=int(s)
    print(count)
    print('----------')'''
    import tkinter as tk
    root = tk.Tk()
    root.withdraw()
    prev = '@'
    while (True):
        c = root.clipboard_get()
        if c != prev:
            #count+=1
            #counting=open('count.txt',"w")
            #counting.write(str(count))
            prev = c
            print(c)
            text = meaning.func(c)
            print(text)
            #if(text!="Sorry"):
            #filed.write(text)
            #filed.write('\n#\n')
            messagebox.display(text)
Esempio n. 2
0
                            continue
                        #Now breaking the loop
                        break
                    
                    
            #Now closing session from opensubtitles
            'Logging out from opensubtitle server'
            conn.logout()
            
        else:
            #Now closing session from opensubtitles
            conn.logout()
            raise Exception('Subtitle not found in opensubtitle database')

    except socket.gaierror:
            display("Unable to connect to the internet", "Check your internet connection.")
            sys.exit()

    except:
        #Try Connecting to SubDb....
        print('connecting to subdb server')
        try:
            lang = getLanguage()
            lang = lang[0] + lang[1]
            subdb.SubDb().conn(url_path, lang)
        except FileNotFoundError:
            display("Sorry, File not found", "Subtitle not found.")
            sys.exit()
        except:
            display("Error could connect","Could create connection to the server. Check your internet connection.")
            sys.exit()
Esempio n. 3
0
            movieName = data['title']
            year = data['year']
            movie_genre = ''
            plot = data['plot']
            
            
            if data['genres']:
                for genre in data['genres']:
                    if movie_genre == '':
                        movie_genre = movie_genre + '' + genre
                    else:
                        movie_genre = movie_genre +  " | " + genre
                    
            rating =   data['rating']
            #Now showing info...
            display("IMDB INFO.", " Movie Name: " + movieName  + "\n Rating: " + rating + "\n\n Year release: " + year + "\n Genre: " + movie_genre +"\n\n Plot:  " + plot + "..." )
            
            #Now closing session from opensubtitles
            'Logging out from opensubtitle server'
            conn.logout()
                    
                
                    

        else:
            #Now closing session from opensubtitles
            conn.logout()
            
            display("Sorry movie info not found","Sorry movie info not found")