dir.py

Created by mobluse

Created on October 20, 2024

857 Bytes

Shows dir of all modules one page at a time.


# Dir
import time as t
print("dir of all modules:\n")
#ms=['array','builtins','cmath','collections','framebuf','gc','io','machine','math','micropython','pyb','struct','sys','time']
ms=['builtins','cmath','ion','kandinsky','math','matplotlib.pyplot','micropython','numpy','random','time','turtle']
#ms=['builtins','cmath','math','micropython','time']
#ms=['builtins','cmath','math','time']
ms.sort()
for m in ms:
  exec("import "+m)
ms.extend(["set","dict","list","tuple","str","int","float","1j"])
for m in ms:
  print(end=m+": ")
  a=eval("dir("+m+")")
  a.sort()
  i=0
  j=0
  for f in a:
    t.sleep(0.01*len(f)) # Comment line to fix
    print("%2d. %s"%(i,f))
    t.sleep(0.01*len(f)) # Comment line to fix
    i+=1
    j+=1
    if j>10:
      input("Press OK/EXE!")
      print()
      j=0
  input("Press OK/EXE for next module!")
  print()

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our <a href="https://www.numworks.com/legal/cookies-policy/">cookies policy</a>.