tarpelite / huawei_ch Goto Github PK
View Code? Open in Web Editor NEW华为软件精英挑战赛2019
License: MIT License
华为软件精英挑战赛2019
License: MIT License
1. 将输入文本复制至如下目录
“SDK/SDK_python/CodeCraft-2019/config/car.txt”
“SDK/SDK_python/CodeCraft-2019/config/road.txt”
“SDK/SDK_python/CodeCraft-2019/config/cross.txt”
2. 执行如下命令进行运行:
“python CodeCraft-2019.py ../config/car.txt ../config/road.txt ../config/cross.txt ../config/answer.txt”
摘自 工程编译指导书-python
根据官方指导书中的声明, 我们可以得知 Python 运行的根目录是 SDK/SDK_python/CodeCraft-2019/src
(因为 CodeCraft-2019.py
在这个目录内)
鉴于 python 内置的 sys.path
环境变量会在顶部自动加入运行时的根目录并根据该目录进行module查询,因此我们在src
目录下新建hwdata
和 hwalgorighm
两个 sub-package
, 并在import 时使用类似于 import hwdata.Cross as cr
的文法。
如果 linter
提示无法import,大概率是因为IDE自动将../SDK/
而非 SDK/SDK_python/CodeCraft-2019/src
作为python运行的根目录,这会导致无法找到项目添加的模块。
Visual studio code
请考虑设置 PYTHONHOME
环境变量Pycharm
请将SDK/SDK_python/CodeCraft-2019/src
标记为 Sources Root
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.