ironpython : tricks : pass arg by ref, generics, get argv


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  1. #/////////////////////////////:
  2. # pass a arg by ref
  3. #/////////////////////////////:
  4. err=clr.Reference[str]("")
  5. yourMethod(err)
  6.  
  7. #/////////////////////////////:
  8. # pass a arg by ref
  9. #/////////////////////////////:
  10. from System.Collections.Generic import *
  11. l=List[str]()
  12. l.Add("val1")
  13. l.Add("val2")
  14.  
  15. #/////////////////////////////:
  16. # get arguments from commandline
  17. #/////////////////////////////:
  18. from System import Environment
  19. argv = list(Environment.GetCommandLineArgs())

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.