On Sunday, July 28, 2013 11:23:41 PM UTC-4, Jorge Caicedo wrote:
> For programming in web2py I just need to know Python?
You need to know Python, but you also need to know how web2py works, so
please read the book.
> (I'm a beginner with Python but when I try to do something in WEB2PY it
> doesn't work like Python)
>
> nota=7
>> print 'Nota:'
>> print nota
>> print '<br>'
>> if nota>=9:
>> print 'Promocionado'
>> elif nota>=4:
>> print 'Regular'
>> else:
>> print 'Reprobado'
>
>
The Python print statement prints to the console, and you will find this to
be the case in web2py as well. However, you don't want to print to the
console -- you want to generate strings of HTML and send them to the
browser. Please read the book for how to achieve this in web2py.
> def index():
>> form= FORM(INPUT(_name='valorini', INPUT(_type='submit'))
>> resultado=valorini*2
>>
>> return dict(resultado)
>
>
That's not how you create a dictionary in Python -- should be something
like:
return dict(resultado=resultado)
If you take some time to go through the book, you should be able to pick up
on these things.
Anthony
--
---
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.