Posted By

manatlan on 09/14/09


Tagged

ironpython tech


Versions (?)

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


 / Published in: Python
 

  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  

You need to login to post a comment.