I'm attempting, poorly, to compare two lists of filenames and provide a list of the differences. I have read and attempted the numerous examples available.
Before you close this as a Duplicate, or Already Answered, please read further.
In python, I'm making a call via ftp to obtain a list of files. This returns an array as expected. Next, I'm calling Oracle to retrieve a list of filenames.
This returns an array of filenames, but the cx_oracle module returns them as
for file from resultset:
So first of all if you want to remove characters from both sides of a string you can use
>>> "('filename')".lstrip("('") 'filename')' >>> "('filename')".rstrip("')") "('filename"
But I suspect that the return data is actually a tuple and not a string
>>> ('filename',) ('filename',) >>> type(('filename',)) <class 'tuple'> >>> ('filename',)[2:20] ()
Which will allow you to say