[CODE=python]def isprime(num):
for x in range(2, num):
if num % x == 0: return False
return True[/CODE]

TrustyTony commented: please let OP to do his part -3
ihatehippies 11 Junior Poster

What is the consensus on the best way reference module level variables? I have a wx app that has grown too large, so I started to do some housekeeping. I'm trying to move several functions outside of the main module while still being able to reference the main variables.. The program works if I include [CODE=PYTHON]from main import *[/CODE] at the top of the child modules, however it only works once. If I run the script without completely closing all python windows it raises
[CODE=PYTHON]Traceback (most recent call last):
File "C:\Python25\Lib\roster\roster_main.pyw", line 427, in Login
Conform.Run()
File "C:\Python25\Lib\roster\Conform.py", line 197, in Run
window.UpdateSearch()
File "C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx_core.py", line 14528, in getattr
raise PyDeadObjectError(self.attrStr % self._name)
wx._core.PyDeadObjectError: The C++ part of the MainFrame object has been deleted, attribute access no longer allowed.[/CODE]
Is there a better way to do this?