I am new with Biopython :)
def fetchByQuery(query,days): Entrez.email = "email" # must give NCBI an email address searchHandle=Entrez.esearch(db="pubmed", reldate =single_date, term=query, usehistory="y") searchResults=Entrez.read(searchHandle) searchHandle.close() webEnv=searchResults["WebEnv"] queryKey=searchResults["QueryKey"] batchSize=10 try: fetchHandle = Entrez.efetch(db="pubmed", retmax=10, retmode="xml", webenv=webEnv, query_key=queryKey) data=fetchHandle.read() fetchHandle.close() return data except: return None
I have a list of years year = [2000, 2001, 2002 etc] A list of terms terms = [cancer, diabete, etc] I want to extract pubmed for every year since 2000 ( so I need to itrate ! then for every year, I iterate every term and print the result in XML
Can someone help me with iterations ?