Skip to content

Instantly share code, notes, and snippets.

@ciupicri
Forked from vvikramjhu/myParser.py
Last active December 24, 2015 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ciupicri/6844058 to your computer and use it in GitHub Desktop.
Save ciupicri/6844058 to your computer and use it in GitHub Desktop.
#! usr/bin/python
import sys
def parse(filename):
print "parsing", filename
def main():
parse(sys.argv[1])
if __name__ == '__main__':
main()
@vvikramjhu
Copy link

strings = ["hello,I,am,doing,well" , "how,are,you"]

for string in strings:
t = string.split(",")
var1 = t[0]
var2 = t[1]
var3 = t[2]
var4 = t[3]

Question. While parsing the second string I want var4 to get "null" or an equivalent value. How to do this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment