0

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!

BIBD
  • 15,107
  • 25
  • 85
  • 137
user211037
  • 1,725
  • 5
  • 16
  • 11

1 Answers1

0

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.

richo
  • 8,717
  • 3
  • 29
  • 47