Python Forum
Where does string.punctuation come from?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Where does string.punctuation come from?
#5
(Sep-16-2019, 03:12 PM)Mark17 Wrote: It looks like a file has been imported:
You did import a module when you called
>>> import string
(Sep-16-2019, 03:12 PM)Mark17 Wrote: How does the computer know where to find that file?
Python has a predefined series of locations to load modules.
Python first searches the directory the file is ran in. Then searches the PYTHONPATH. Then python searches the standard library directories. Then python searches for directories in a .pth file.

A module is a set of functions, types, classes, ... put together in a common namespace.
A library is a set of modules which makes sense to be together and that can be used in a program or another library.
A package is a unit of distribution that can contain a library or an executable or both. It's a way to share your code with the community.
More info on all that here.
Recommended Tutorials:
Reply


Messages In This Thread
RE: Where does string.punctuation come from? - by metulburr - Sep-16-2019, 04:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  string.punctuation for languages like French or German Leo978 1 3,245 Jun-06-2020, 09:09 AM
Last Post: DeaD_EyE
  Removing punctuation from strings in lists iFunKtion 3 18,217 May-21-2017, 06:43 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020