1

Hey folks quick question, how do I find out what is available for import from a library?

Everyone online who teaches this stuff always uses wildcards! Even when they tell you not to, they never tell you how to find out what there is to import!

So for tkinter, I can't figure out what I have to import to be able to specify self.topFrame.config(relief = RIDGE)

it only works if I import * otherwise it says RIDGE is not defined. So how am I supposed to know where this RIDGE resides in tkinter library?

Thanks!

Ripfury
  • 39
  • 8

1 Answers1

2

You can use dir()

>>> import numpy as np
>>> dir(np)
['ALLOW_THREADS',
 'AxisError',
 'BUFSIZE',
 'CLIP',
 'ComplexWarning',
 'DataSource',
 'ERR_CALL',
 'ERR_DEFAULT',
 'ERR_IGNORE',
 'ERR_LOG'
 ...
CDJB
  • 14,043
  • 5
  • 29
  • 55