from applications.Folders1.modules.myfolder1.main import main
from applications.Folders1.modules.myfolder1.list1 import GAMES0
code.....
if id == name3:
result = location
return result
else:
while True:
class Filters(object):
def Filter_cause(self):
for item in name3.split():
b = False
for c in FILTERTYPE:
b = b | (item.find(c) != -1)
if b:
for (func) in GAMES0:
func()
o = Filters()
for stuff in dir(o):
if 'Filter' in stuff:
getattr(o, stuff)()
result = Filters()
return result
GAMES0 contains several python modules being imported. My loop works well up to the return location, section but on looping over the 'def class Filters', I get this message:
<applications.Folders1.modules.myfolder1.main.Filters object at 0x06D689F0>
How can I make it to print out my message from any of the modules
from applications.test.modules.Test1 import GAMES0
from applications.test.modules.Test1 import GAMES1
from applications.test.modules.Test1.cores import main
from gluon import *
def main():
id = 0
location = ""
conn = sqlite3.connect("tools.db")
c = conn.cursor()
........code
name3 = ' '.join(name2)
class Filters(object):
def Filter_cause(self):
for item in name3.split():
b = False
for c in FILTERCORE:
b = b | (item.find(c) != -1)
if b:
for (func) in GAMES0:
func()
def Filter_complications(self):
for item in name3.split():
b = False
for c in FILTERCOMP:
b = b | (item.find(c) != -1)
if b:
for (func) in GAMES1:
func()
o = Filters()
for stuff in dir(o):
if 'Filter' in stuff:
getattr(o, stuff)()
note that GAMES0 and GAMES1 contain lists of python modules that func() is calling to run. e.g. GAMES0 = [testcore1, testcore2, testcore3, testcore4]
import sys
import re
def testcore1():
.....code
name1 = ''.join(name).split()
class FILTER_TESTCORE1(object):
def test():
for item in name1:break
...code
result = test()
return result
N/B with python shell. this works fine, but on web2py, i get the 'None' printout
Thanks team!! That gives me an idea of how to program. Much appreciated!
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.