diff --git a/start.py b/start.py new file mode 100644 index 00000000..b478e887 --- /dev/null +++ b/start.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python +from multiprocessing import Process +import webbrowser +import zeronet + +server = Process(target=zeronet.main) +server.start() +url = webbrowser.open("http://127.0.0.1:43110", new=2) +server.join() diff --git a/zeronet.py b/zeronet.py index 7f0e1de3..f8a83fa5 100644 --- a/zeronet.py +++ b/zeronet.py @@ -1,9 +1,13 @@ #!/usr/bin/env python -try: - from src import main - main.start() -except Exception, err: # Prevent closing - import traceback - traceback.print_exc() - raw_input("-- Error happened, press enter to close --") +def main(): + try: + from src import main + main.start() + except Exception, err: # Prevent closing + import traceback + traceback.print_exc() + raw_input("-- Error happened, press enter to close --") + +if __name__ == '__main__': + main()