HoneyMoose
  • 首页
  • Java
  • Jersey
  • Jira
  • Confluence
  • U.S.
    • USRealEstate
    • U.S. Travel
    • H1B
  • 项目和网站
    • CWIKI.US
    • OSSEZ 社区
    • WIKI.OSSEZ.COM
    • BUG.OSSEZ.COM
    • RSS.OSSEZ.COM
BLOG.OSSEZ.COM
A responsive blog theme focused om user reading experience
  1. Home
  2. Computer Science
  3. This article

Python 项目结构

2020年06月06日 398Browse 0Like 0Comments

可能是因为有 Java 项目的开发习惯,很多时候都希望能够有一个标准或者通用点的 Python 项目结构。

这样的好处是所有你的项目都会从这个结构开始,你的思路会更加清晰。

但是找来找去,Python 并不是和 java 一样有 lib ,有构建等的强依赖。

但是我们还是找的了一篇文章:

https://docs.python-guide.org/writing/structure/

如你希望查看中文版的,你可以单击下面的链接:

https://pythonguidecn.readthedocs.io/zh/latest/writing/structure.html

在上面的文章中,提到了一个示例的代码仓库 https://github.com/kennethreitz/samplemod

我们将上面的代码仓库 fork 后重新编辑并且上传到 GitHub 上了。

我们修改后上传的项目地址为:

https://github.com/ossez-com/python-project-structure-sample

 

Python 的项目目录可以比较灵活,但是有约束的项目结构其实是非常有必要的,能够更快更好的表达你的项目。同时也可以让你的项目能够更好的被管理和编辑。

python-project-structure-sample-01

你可以在 IntelliJ 中将这个示例项目导入进去。

如我们常见的套路,导入这个项目后,你可以写一个 print 语句进行输出。

python-project-structure-sample-02

如上图,你的 py 程序将会输出一个 Hello Python

https://www.ossez.com/t/python/137

Tags: None
Last updated:2020年06月06日

Kratos

stay absorbed stay excellent

Like
< Previous
Next >

Comments

Cancel reply

Newest Hotspots Random
Newest Hotspots Random
网络编程常用的几种字符编码 Java 中的 String Pool 简介 有关 Java 9 的 String Java String 性能和优化 Java String 手工引用指针 Java String 文字(Literal)和 对象(Object)初始化
Jenkins 通过检查代码提交自动触发编译IntelliJ IDEA 2022 年版本中的作者提示Discourse 新用户可插入媒体的数量Discourse 的信任级别Java 使用 char[] Array 还是 String 存储字符串密码Java 字符串引用(String Interning)
Confluence 6 考虑使用自定义 CSS Java 面试都只是背答案不 Confluence 6 LDAP 连接池配置参数 Confluence 6 外部参考 Discourse Refused to load the script 错误 Rx 和 Tx 是什么
Categories
  • Akka
  • Algorithm(算法)
  • AMQP
  • Angular
  • CI
  • Compile And CI
  • Computer Science
  • Confluence
  • DataBase
  • Gradle
  • H1B
  • Hibernate
  • IDE
  • Java
  • Jersey
  • Jira
  • MariaDB
  • PrestaShop
  • Spring
  • Spring Batch
  • U.S.
  • U.S. Travel
  • USRealEstate
  • 我的小厨

COPYRIGHT © 2020 HoneyMoose. ALL RIGHTS RESERVED.

THEME CWIKIUS.CN MADE BY VTROIS