CommencerCommencer gratuitement

From script to package

One common way to begin writing a package is to start with code you have already written as a script. At the time you first write this code, you may not realize how useful it might be in other places.

If you did the prerequisite course, in one exercise you wrote a script to count the number of times cats were mentioned in the book Alice in Wonderland.

In this exercise, you'll copy from that script to make a generalized function you can use on any text file for any words. This will be the first function in a new library.

Note: You can open/close the folder and files overview by clicking on the icon on the left side of the editor highlighted in red. Icon with multiple files

Cet exercice fait partie du cours

Developing Python Packages

Afficher le cours

Exercice interactif pratique

Passez de la théorie à la pratique avec l’un de nos exercices interactifs

Commencer l’exercice