[pulec@archus python]$ ipython Python 3.5.2 (default, Jun 28 2016, 08:46:01) Type "copyright", "credits" or "license" for more information. IPython 5.1.0 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. In [1]: import re, json ...: ...: #define RIL html file and compile regex for base url ...: ril_file = '/home/pulec/ril_export_www.html' ...: re_http_link = re.compile = ".*(http://[\w.-]+)" ...: ...: #load RIL file and put all in ril_data list ...: with open(ril_file, 'r') as ril_file_h: ...: ril_data = ril_file_h.read().split('\n') ...: In [2]: ril_data[1] ERROR:root:Internal Python error in the inspect module. Below is the traceback from this internal error. Traceback (most recent call last): File "/usr/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2881, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in ril_data[1] File "/usr/lib/python3.5/site-packages/IPython/core/displayhook.py", line 243, in __call__ if result is not None and not self.quiet(): File "/usr/lib/python3.5/site-packages/IPython/core/displayhook.py", line 94, in quiet tokens = list(tokenize.generate_tokens(sio.readline)) File "/usr/lib/python3.5/tokenize.py", line 601, in _tokenize pseudomatch = _compile(PseudoToken).match(line, pos) File "/usr/lib/python3.5/tokenize.py", line 173, in _compile return re.compile(expr, re.UNICODE) TypeError: 'str' object is not callable During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 1821, in showtraceback stb = value._render_traceback_() AttributeError: 'TypeError' object has no attribute '_render_traceback_' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.5/site-packages/IPython/core/ultratb.py", line 1132, in get_records return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset) File "/usr/lib/python3.5/site-packages/IPython/core/ultratb.py", line 313, in wrapped return f(*args, **kwargs) File "/usr/lib/python3.5/site-packages/IPython/core/ultratb.py", line 358, in _fixed_getinnerframes records = fix_frame_records_filenames(inspect.getinnerframes(etb, context)) File "/usr/lib/python3.5/inspect.py", line 1453, in getinnerframes frameinfo = (tb.tb_frame,) + getframeinfo(tb, context) File "/usr/lib/python3.5/inspect.py", line 1414, in getframeinfo lines, lnum = findsource(frame) File "/usr/lib/python3.5/site-packages/IPython/core/ultratb.py", line 223, in findsource pat = re.compile(r'^(\s*def\s)|(.*(?>> import re, json >>> >>> #define RIL html file and compile regex for base url ... ril_file = '/home/pulec/ril_export_www.html' >>> re_http_link = re.compile = ".*(http://[\w.-]+)" >>> >>> #load RIL file and put all in ril_data list ... >>> with open(ril_file, 'r') as ril_file_h: ... ril_data = ril_file_h.read().split('\n') ... >>> ril_data[1] '
  • Index of /~amitp/game-programming
  • ' >>> re.match(re_http_link, ril_data[1]).group(1) 'http://www-cs-students.stanford.edu'