1. Takayuki KONDO
  2. playground

Commits

Takayuki KONDO  committed b0243ca

py: argサンプル

  • Participants
  • Parent commits c49aabe
  • Branches default

Comments (0)

Files changed (1)

File py/arg.py

View file
  • Ignore whitespace
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-import urllib
 import sys
 
-def initlog(one, *args):
-    print args
-    for ar in args:
-        print ar
+print u"引数 ", sys.argv
+print u"個数 ", len(sys.argv)
 
-print '----'
-print sys.argv
-print '----'
+for v in sys.argv:
+    print v
 
-initlog('abc')
-initlog(1,2,3,'d')
-initlog(7,8,'str')
-
-
-