you running it from the shell gives you the REPL which you don't have when 
you run it through web2py. repl will print out if you just give it a class 
it will tell you what instance of class you have. if you want to print like 
it does in the repl, you need to 'print repr(x)' where x is the class or 
whatever you want.

On Tuesday, June 3, 2014 12:30:02 PM UTC-7, Maurice Waka wrote:
>
>
> When I work with the same module on python shell, its perfectly printing 
> out. I dont know why it does not print on web2py. Basically I imported it 
> without editing from python shell. Anyway since am new to web2py and 
> python, you could help out
> On Tuesday, June 3, 2014, Derek <sp1...@gmail.com <javascript:>> wrote:
> > Sorry, but it looks like it's doing what you are asking of it. Perhaps 
> you should comment your code to make sure it's doing what you are thinking 
> it's doing.
> > you are instantiating a new filters class, giving it the name 'o', then 
> you get a list of the contents of that class, run them if possible, and 
> then you are instantiating a new filters class, naming it 'result', kinda 
> like 'o' was.... and then you are returning it. Why? What's the point of 
> doing all that if 'o' is never going to be used? you might as well take 
> that out since you are just returning a new class instance anyway.
> >
> >
> > On Tuesday, June 3, 2014 2:50:48 AM UTC-7, Maurice Waka wrote:
> >>
> >> 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
> >
> > --
> > Resources:
> > - http://web2py.com
> > - http://web2py.com/book (Documentation)
> > - http://github.com/web2py/web2py (Source code)
> > - https://code.google.com/p/web2py/issues/list (Report Issues)
> > ---
> > You received this message because you are subscribed to a topic in the 
> Google Groups "web2py-users" group.
> > To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/web2py/JsESNTvfrHQ/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to 
> web2py+un...@googlegroups.com <javascript:>.
> > For more options, visit https://groups.google.com/d/optout.
> >
>
> -- 
> Dr Maurice Waka, MBCHB.
> Nairobi
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to