modify xterm command to launch in virtual environment properly

This commit is contained in:
Firstname Lastname 2019-12-18 22:30:40 +01:00
parent 49cfce6371
commit 7143932a76
2 changed files with 10 additions and 8 deletions

View File

@ -13,13 +13,13 @@ Please check requirements.txt.
### Installing ### Installing
Install a virtual environment: * Install a virtual environment:
virtualenv --python=/usr/bin/python3 venv virtualenv --python=/usr/bin/python3 venv
Activate virtual environment: * Activate virtual environment:
source venv/bin/activate source venv/bin/activate
Install requirements: * Install requirements:
pip install -r requirements.txt pip install -r requirements.txt
## Authors ## Authors

View File

@ -11,7 +11,7 @@ class Interface(tk.Frame):
def create_command(self): def create_command(self):
if os.path.split(sys.argv[0])[1] == 'core.py': if os.path.split(sys.argv[0])[1] == 'core.py':
command = 'python {}'.format(os.path.abspath(sys.argv[0])) command = 'source {}/venv/bin/activate & {}/venv/bin/python {}'.format(os.path.dirname(os.path.abspath(sys.argv[0])),os.path.dirname(os.path.abspath(sys.argv[0])),os.path.abspath(sys.argv[0]))
else: else:
command = '{}'.format(os.path.abspath(sys.argv[0])) command = '{}'.format(os.path.abspath(sys.argv[0]))
@ -78,8 +78,10 @@ class Interface(tk.Frame):
if __name__ == "__main__": if __name__ == "__main__":
root = tk.Tk() #create window # root = tk.Tk() #create window
root.title("Ydl - Youtube downloader") # root.title("Ydl - Youtube downloader")
#
# app = Interface(master=root) #create all components inside the window
# app.mainloop()
app = Interface(master=root) #create all components inside the window print(os.path.dirname(os.path.abspath(__file__)))
app.mainloop()