Files
twblue/src/mysc/restart.py

12 lines
348 B
Python
Raw Normal View History

# -*- coding: cp1252
2019-06-06 11:52:23 -05:00
from __future__ import unicode_literals
import sys, os
def restart_program():
""" Function that restarts the application if is executed."""
args = sys.argv[:]
if not hasattr(sys, "frozen"):
args.insert(0, sys.executable)
if sys.platform == 'win32':
args = ['"%s"' % arg for arg in args]
os.execv(sys.executable, args)