On Thursday, September 1, 2016 at 3:11:42 PM UTC-7, Alex Glaros wrote:
>
> thanks Niphlod and Luis. It was always unclear to me how, where, and if 
> possible, to install packages. So that helps my long-term understanding a 
> lot.
>
> For the time being, can anyone please remind me how to extract the bad 
> word without braces in controller below?  
>
> def clean_bad_words(original_text):
>     bad_words = 
> open(os.path.join(request.folder,'static','bad_words.txt')).readlines() 
>     bad_word_is = None
>     for line in bad_words:
>         splitted = line.split()
>         if splitted[0] in original_text:
>             bad_word_is = splitted[0]
>     return dict (bad_word_is = bad_word_is)
>
>
> def testing():   
>     original_text = '****'
>     new_words_is = clean_bad_words(original_text)
>     return dict(new_words_is = new_words_is)
>
> VIEW:  {{=new_words_is}} 
>
> this below is diplayed instead of just the word (****): Would like it 
> without the braces and quotes.
> {'bad_word_is': '****'}
>

In the view, wouldn't it be new_words_is['bad_word_is"] ?   Ordinary dict 
behavior?

/dps


-- 
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