Browse Source

update readme

marion 1 year ago
parent
commit
8b43ad8aef
4 changed files with 253 additions and 4 deletions
  1. 42 4
      README.md
  2. 10 0
      __main__.py
  3. 174 0
      tmp.json
  4. 27 0
      tmp.py

+ 42 - 4
README.md

@@ -1,10 +1,48 @@
-# Python开发环境准备
+# Python Get Start
 
-安装Miniconda或Anaconda,然后通过conda添加需要的python版本的虚拟环境,便于python版本和包管理
+## 下载开发工具 VS Code
 
-## Conda 常用命令
+[此处](https://code.visualstudio.com/download) 下载安装即可
 
-[下载地址](https://docs.conda.io/en/latest/miniconda.html)
+## Python环境准备(一次性操作)
+
+下载安装最新版 [MiniConda](https://docs.conda.io/en/main/miniconda.html)
+
+打开 VS Code,切换到英文输入法
+
+快捷键 Ctrl/Command + Shift + P,在顶部弹出的选框中输入或选中 Extensions: Install Extensions,在左侧的扩展安装区域中搜索安装 Python 扩展,安装完成后重启 VS Code
+
+快捷键 Ctrl + ~  ,打开命令行终端,执行如下命令
+
+参考 [此文章](https://blog.csdn.net/takedachia/article/details/124694616) 配置 Windows PowerShell 支持 conda 命令
+
+创建 Conda 虚环境
+
+> conda create -n=test python=3.11
+
+> conda activate test
+
+快捷键 Ctrl/Command + Shift + P,在顶部弹出的选框中输入或选中 Python: Select Interpreter,再选择 test 虚环境
+
+## 编写程序
+
+用 VS Code 打开 hello-python 目录
+
+hello-python 程序入口在 __main__.py
+
+## 运行程序
+
+选中 __main__.py
+
+点击 VS Code 左侧边栏的“三角形”图标
+
+点击“运行和调试”
+
+首次运行,会弹出一个对话框,选第一行“执行当前文件”
+
+程序即会开始运行,VS Code 底部将弹出终端窗口,会输出程序打印内容或输出程序执行报错
+
+## Conda 常用命令(供参考,不是必须执行的)
 
 ### 虚拟环境
 

+ 10 - 0
__main__.py

@@ -0,0 +1,10 @@
+import time
+
+
+def main():
+    print('[{}] Hello world!'.format(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))))
+
+
+# 程序入口
+if __name__ == '__main__':
+    main()

File diff suppressed because it is too large
+ 174 - 0
tmp.json


+ 27 - 0
tmp.py

@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+
+# %% jira
+import codecs
+from jira import JIRA
+
+jira = JIRA('http://oa.wanpinghui.com', auth=('郑毅', 'GraphQL6'))
+
+issue = jira.issue('XXH-353')
+
+filename = './test.csv'
+
+
+def write_bom():
+    with open(filename, 'w') as f:  # create a new file,overwrite when the file was existed
+        f.write(codecs.BOM_UTF8)  # write utf8 BOM at starts of the file
+
+
+def write_line(*args):
+    raw = ','.join(args).encode('utf-8')  # append a line of content into the file
+    with open(filename, 'a') as f:
+        f.write('%s\n' % raw)
+
+
+write_bom()
+for i in range(5):
+    write_line(issue.fields.project.key, issue.fields.issuetype.name, issue.fields.reporter.displayName)

Some files were not shown because too many files changed in this diff