Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the differences between python packages and folders

Shulou Source: shulou.com Published: 2022-06-03 09:38:35 11月15日 Update

This article mainly introduces the difference between python package and folder, which has certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let Xiaobian take you to understand it together.

One or more folders make up a module, and a module combination makes up a package published in a public directory.

The package must have an__init__file, otherwise it is a folder.

examples

import pynvmlpynvml.nvmlInit()#where 1 is GPU idhandle = pynvml.nvmlDeviceGetHandleByIndex(1)meminfo = pynvml.nvmlDeviceGetMemoryInfo(handle)print (meminfo.total) #Total memory size of the second graphics card print (meminfo.used)#Here are bytes, so to get megabytes you need to divide by 1024**2print (meminfo.free) #The remaining memory size of the second graphics card Thank you for reading this article carefully, I hope Xiaobian shared "What is the difference between python package and folder" This article is helpful to everyone, but also hope that everyone will support, pay attention to the industry information channel, more relevant knowledge waiting for you to learn!

Tags: Files folders articles size graphics card video memory modules values interests units at the same time multiple bytes instances that is want more friends directories knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Shulou Technology OPPO Reno macOS Redmi