diff --git a/core.py b/core.py index 432d2db..b195ae8 100644 --- a/core.py +++ b/core.py @@ -3,6 +3,7 @@ import youtube_dl from feedgen.feed import FeedGenerator import os import sys +import __main__ import argparse import ydl import interface @@ -28,7 +29,6 @@ args = parser.parse_args() if __name__ == "__main__": - print(args.interface) if not args.interface: ydlo = ydl.ydl_object(args) ydlo.print_infos() diff --git a/dist/core b/dist/core index d71649e..35b686c 100755 Binary files a/dist/core and b/dist/core differ diff --git a/interface.py b/interface.py index ca1685c..6ab19c7 100644 --- a/interface.py +++ b/interface.py @@ -1,6 +1,7 @@ import tkinter as tk from tkinter import filedialog import os +import sys class Interface(tk.Frame): def __init__(self, master=None): @@ -9,7 +10,11 @@ class Interface(tk.Frame): self.create_widgets() def create_command(self): - command = 'python core.py' + if os.path.split(sys.argv[0])[1] == 'core.py': + command = 'python {}'.format(os.path.abspath(sys.argv[0])) + else: + command = '{}'.format(os.path.abspath(sys.argv[0])) + for key in self.args: if bool(self.args[key].get()): print('{}: Option non vide'.format(key))