zero-cool Posted June 20, 2008 at 01:26 PM Report Share #192392 Posted June 20, 2008 at 01:26 PM Viva, É possível fazer algo do tipo? dic["ac"]= function command["xx"] = ( lambda self: print "lol" ) Abraço, Link to comment Share on other sites More sharing options...
djthyrax Posted June 20, 2008 at 02:29 PM Report Share #192404 Posted June 20, 2008 at 02:29 PM command['xx'] = lambda: 'ois' print command['xx']() Ou então: def tmp(): print "ois" command['xx'] = tmp def tmp(): print "lulz" command['yy'] = tmp command['xx']() command['yy']() Não peças ajuda por PM! A tua dúvida vai ter menos atenção do que se for postada na secção correcta do fórum! Link to comment Share on other sites More sharing options...
zero-cool Posted June 20, 2008 at 10:00 PM Author Report Share #192541 Posted June 20, 2008 at 10:00 PM Ok, obrigado. Já agora, quais as diferenças e/ou diferenças entre funções normais e lambda? O que posso ou não fazer nelas? Já reparei que em lambda não posso definir variáveis... Link to comment Share on other sites More sharing options...
djthyrax Posted June 20, 2008 at 10:05 PM Report Share #192545 Posted June 20, 2008 at 10:05 PM http://www.secnetix.de/olli/Python/lambda_functions.hawk Não peças ajuda por PM! A tua dúvida vai ter menos atenção do que se for postada na secção correcta do fórum! Link to comment Share on other sites More sharing options...
zero-cool Posted June 20, 2008 at 10:13 PM Author Report Share #192555 Posted June 20, 2008 at 10:13 PM Obrigado. 😛 Abraço, Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now