- Daniel Arbuckle's Mastering Python
- Daniel Arbuckle
- 135字
- 2021-07-02 21:09:37
Creating an empty package
The first section of this chapter deals with creating a simple empty package, which won't do anything yet, but by the time we're done, we'll be able to import the empty package into the Python shell.
Simple Python projects may consist of a single code module, but normally there are multiple modules combined together into a package. A package can contain as many modules as we need it to. Packages start their lives as folders on the filesystem, which means we can make them just as we would make any other folder.
If you prefer to use your operating system's file browser to make folders, that's fine, but I usually use the command line. For example let's run a demo package:
$ mkdir demopackage
This is shown as the following screenshot:

推薦閱讀
- Node.js 10實(shí)戰(zhàn)
- Dynamics 365 Application Development
- Boost C++ Application Development Cookbook(Second Edition)
- 深入淺出Java虛擬機(jī):JVM原理與實(shí)戰(zhàn)
- Java加密與解密的藝術(shù)(第2版)
- Web Application Development with MEAN
- Bootstrap Essentials
- 人人都懂設(shè)計(jì)模式:從生活中領(lǐng)悟設(shè)計(jì)模式(Python實(shí)現(xiàn))
- SQL Server 2016數(shù)據(jù)庫應(yīng)用與開發(fā)
- Windows內(nèi)核編程
- 智能手機(jī)APP UI設(shè)計(jì)與應(yīng)用任務(wù)教程
- INSTANT Silverlight 5 Animation
- Julia 1.0 Programming Complete Reference Guide
- Qlik Sense? Cookbook
- Emotional Intelligence for IT Professionals