讲解Python for Finance留学生、辅导python编程、讲解sub-packages、辅导Python
- 首页 >> Python编程Python for Finance
Assignment 1
Name: _____________
Student ID: ___________
1. Modules
1.1 Show the python path (list of strings) of your computer (take a snapshot and insert it below).
1.2 Install the module “requests”, and take a snapshot to prove you can successfully import the module.
1.3 Find the directories where “requests” module is installed. Take a snapshot and insert it below.
1.4 Write your own module (contain only one function), prove you can successfully import the module, and call the functions within the module. Take a snapshot and insert it below.
2. Package
Suppose we are developing a game, one possible organization of packages and modules could be as shown in the figure below.
2.1 Create a package named as “Game”, create all the sub-packages and modules, and organize them according to the file structure shown as above figure. Replace below figure with your own snapshot of Game package.
2.2 Define a function in Sound->load.py, name the function as “sound_load”. Within the function, print out your student ID. Import the “Game” package, and call the function by Game.sound_load(). Take a snapshot and insert it below to prove the function can be successfully loaded.