see the example:
from visual import *
def hello():
newyear=2010
sphere()开发者_运维百科
return newyear
my problem here is when I call function hello(), a sphere display window shows up, and also prints 2010, however if I close the display window, the program terminates. That is not what I want, how can I avoid this?
also, in my code, I will also use newyear, say b=hello(), but I dont want it show the sphere when I want use newyear, how can I do this?
Thanks in advance!
You need to fork the process before hand.
(Totally untested)
import os
if os.fork() == 0: exit()
Placing that stanza at the start of your program should cause execution to continue in a forked process, detached from your tty. Someone can probably correct me though.
精彩评论