这是崔斯特的第三十五篇原创文章
到底哪错了 (๑• . •๑)
问题无处不在
我: “大佬,帮我看看这个问题错在哪了?”
大佬: “你的代码呢、你的错误提示呢?”
我: “好的,我发给你”
大佬: “。。。 再见”
留下一脸懵逼的我
如何解决问题
最简单的方法是根据错误提示,查看对应位置的代码,Pycharm会提示具体是哪一行代码有问题,并抛出错误。
找到错误首先应自己想办法解决,自己解决又分为几种:有经验的大佬看到Error
就知道是哪里有问题了,没经验怎么办,那就自己去搜索了。
下个结论,你遇到的问题,前人一定遇到过。
所以你只需要把你的错误提示搜索就好了。
注意下面,你懂的。(给自己一个好点的环境)
Google > 百度
stackoverflow > 知乎
github > CSDN
Github上有一个很有用的 trending ,可以显示今天或本周或本月最火的项目,例如:
Github 作为全球最大的同性交友网站,上面有很多值得我们好好学习的东西。
如何向别人提问
如果你真的像上面哪样,发一张照片,估计大佬都要吐血了。
在这里推荐大家使用Github上的 gist ,很适合分享代码片段。
Instantly share code, notes, and snippets.
例如这样
这样看起来是不是舒服多了
如何才能 永无bug
1、佛祖保佑 永无bug
|
|
2、佛系编程 永无bug
No Code
No code is the best way to write secure and reliable applications. Write nothing; deploy nowhere.
Getting Started
Start by not writing any code.
|
This is just an example application, but imagine it doing anything you want. Adding new features is easy too:
|
The possibilities are endless.
Building the Application
Now that you have not done anything it’s time to build your application:
|
Yep. That’s it. You should see the following output:
|
Deploying
While you still have not done anything it’s time to deploy your application. By running the following command you can deploy your application absolutely nowhere.
|
It’s that simple. And when it comes time to scale the application, all you have to do is:
|
I know right?
Contributing
You don’t.