生成给定类型的随机字典的简单python包。

random-dict的Python项目详细描述


Travis CI buildSonarCloud QualitySonarCloud MaintainabilityCodacy MaintainabilityMaintainabilityPypi projectPypi total project downloads

生成给定类型的随机字典的简单python包。

如何安装此软件包?

像往常一样,只需使用pip:

pip install random_dict

测试覆盖率

由于某些软件处理覆盖有时会得到稍有不同的结果,下面是其中的三个:

Coveralls CoverageSonarCloud CoverageCode Climate Coverate

用法示例

随机字符串dict

此函数将生成一个字典,其中最大值为max_depthmax_height类型为string

fromrandom_dictimportrandom_string_dictfromrandomimportrandintrandom_string_dict(randint(1,10),randint(1,10))

随机布尔dict

此函数将生成一个字典,其中最大值为max_depthmax_height类型为bool

fromrandom_dictimportrandom_bool_dictfromrandomimportrandintrandom_bool_dict(randint(1,10),randint(1,10))

随机浮点指令

此函数将生成一个字典,其中最大值为max_depthmax_height类型float

fromrandom_dictimportrandom_float_dictfromrandomimportrandintrandom_float_dict(randint(1,10),randint(1,10))

随机指令

此函数将生成一个字典,其中最大值为max_depthmax_height类型int

fromrandom_dictimportrandom_int_dictfromrandomimportrandintrandom_int_dict(randint(1,10),randint(1,10))

随机指令

此函数将生成一个字典,其中最多给定混合类型的max_depthmax_height

fromrandom_dictimportrandom_dictfromrandomimportrandintrandom_dict(randint(1,10),randint(1,10))

一些生成的示例可以在examples文件夹中找到。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
反射Java反射:高负载下的NoSuchMethodException   java RxJava:one request>list of Integer>sequence of requests for each int>result to list   java为什么循环之前索引会增加   JavaSpring远程处理和RESTfulURL   java Hibernate搜索仅对我的实体的一部分进行索引   使用DPAD快速滚动时,java RecyclerView onCreateViewHolder调用过多   java将JSON解析到一个表中   java导航抽屉标题textview nullpointerexception   基于接口的Java链接队列   java Guice运行时依赖项参数重新注入   java展平/压缩ZSH中的深度嵌套目录   JavaSpring:Http406此请求标识的资源只能   java如何制作Android启动器图标   Java代码在windows上显示不正确(包含希腊语句子)   使用yourkit进行内存分析所用的java时间   java为什么可以序列化属性而不能序列化对象本身?