edit in progress will re-submit sometimes later edit in progress will re-submit sometimes later edit in progress will re-submit sometimes later
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
You can use
.strip()
to remove any whitespace around an item before entering it. This would allow a bit more clarity and solve any indentation issues.For example:
What this will have done is remove any existing whitespace, and let only your
\t
's exist.Your question is probably has been answered by others but since you are dealing with very large file, you should use generator method to input line by line.
See this question for details. Lazy Method for Reading Big File in Python?
Why not use a regex split ?
would give you ['', '+', 'chr6', '140302505', '140302604', '']. You can use the same in your current mysql methods.
PS: The regex pattern I've used would give you empty strings at the beginning and end. Modify the regex or change your sql insert to exclude first and last elements of array while pushing.
That should work: