Created
March 16, 2017 13:34
-
-
Save starlightme/ae97b3d577fe80239515c8466e06714a to your computer and use it in GitHub Desktop.
list2query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
# mainly for sql query | |
filename = 'test.txt' | |
with open(filename,'r') as fp: | |
l = fp.readlines() | |
l = map( lambda s:s.strip(), l ) | |
result = str(l).replace('[','(').replace(']',')') | |
print result | |
with open(filename,'a') as fp: | |
fp.write(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment