Use this tool to quickly search PDFs:
It continuously asks for a search query and then asks you for a search result to open in a PDF reader.
| # Define functions with underscore so they aren't included in output | |
| def _print_import_statements(): | |
| from IPython import get_ipython | |
| ipython = get_ipython() | |
| if not ipython: | |
| print("This function only works in an IPython environment.") | |
| return | |
| history = list(ipython.history_manager.get_range(output=False)) |
| import argparse | |
| def process_history(input_file, output_file, char_limit): | |
| prune_count = 0 | |
| with open(input_file, 'rb') as infile, open(output_file, 'wb') as outfile: | |
| current_entry = b'' | |
| for line in infile: | |
| current_entry += line | |
| if not line.endswith(b'\\\n'): # End of an entry |