If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!
Am working on a game app but on calling my module func into controller, I get a None response yet it work well on python shell. Please help

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

Answers (0)

Comments (0)

Related content


Hosting graciously provided by:
Python Anywhere