Open SvennoNito opened 4 years ago
Not sure whether it is a clean solution, but what eventually worked for me was this
import scholar
import sys
sys.argv = ["-c", "1",
"--author", "albert einstein",
"--phrase", "quantum theory",
"--citation", "bt",
"--cookie-file", "~/.scholar-cookies.txt"
]
scholar.main()
Hey everybody, I want to use the
main()
function fromscholar.py
in another script of mine. I saw a simmilar issue #50 but not a satisfying answer so far. Is it possible to call the script with optional input arguments in another script? It should be I guess. So far I've triedAnd I get the following error message:
TypeError: main() takes 0 positional arguments but 1 was given
Makes sense, the
main()
function inscholar.py
doesn't have any input argument. Maybe a super basic question, but any idea how to work around it?