User Tools

Site Tools


other:python:misc_by_jyp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
other:python:misc_by_jyp [2021/09/17 13:41]
jypeter [Printing a readable version of long lists or dictionaries] Replaced ordered dict with a regular dict
other:python:misc_by_jyp [2021/09/17 14:05] (current)
jypeter [Printing a readable version of long lists or dictionaries] Added long list example
Line 184: Line 184:
                        '​r1i1p1f3':​ {'​grid':​ '​gr'​},​                        '​r1i1p1f3':​ {'​grid':​ '​gr'​},​
                        '​r1i1p1f4':​ {'​grid':​ '​gr'​}}}                        '​r1i1p1f4':​ {'​grid':​ '​gr'​}}}
 +                       
 +>>>​ dir(test_dic)
 +['​__class__',​ '​__contains__',​ '​__delattr__',​ [... lots of unreadable stuff removed...] '​setdefault',​ '​update',​ '​values'​]
 +
 +>>>​ pprint.pprint(dir(test_dic))
 +['​__class__',​
 + '​__contains__',​
 +
 +[... lots of lines removed in this example ]
 +
 + '​setdefault',​
 + '​update',​
 + '​values'​]
 +
 </​code>​ </​code>​
  
other/python/misc_by_jyp.1631886095.txt.gz · Last modified: 2021/09/17 13:41 by jypeter