In a python project that I collaborate, we're intending initially to parse information from a input fasta file into a dictionary.
Parsing method is already implemented (here and here), and the problem is: code works fine when running in Python3 (fasta file is loaded, its information is parsed for FDB data-strucuture, and then it's saved in a new fdb-file), but when it runs in Python 2, generated dictionary doesn't contains value-information from read fasta file, just the keys.
Links above show code developed for parsing, and block below contains test we execute (which works fine with Python 3 but not save fasta information in Python 2).
print("Instantiating a FastaDB object...")
fasta_db = FastaDB()
print("Defining input file name...")
filename = "../FastaDB/test2.fasta"
username = "inacio_medeiros"
print("Invoking FDB parsing...")
parsed_fdb_structure = fasta_db.ImportFasta(filename, username)
print("Saving in file...")
content = json.dumps(parsed_fdb_structure)
fdb_file_name = filename+".fdb"
fdb_file = open(fdb_file_name, "w")
fdb_file.write(content)
Does anyone have an idea why dictionaries are working fine in Python 3, but not in Python 2?