Thứ Hai, 8 tháng 10, 2018

Automate the Boring Stuff with Python Programming

If you can’t find the answer by searching online, try asking people in a web forum such as Stack Overlow (http://stackoverflow.com/) or the “learn programming” subreddit at http://reddit.com/r/learnprogramming/. But keep in mind there are smart ways to ask programming questions that help others help you. Be sure to read the Frequently Asked Questions sections these websites have about the proper way to post questions.
When asking programming questions, remember to do the following:
  • Explain what you are trying to do, not just what you did. This lets your helper know if you are on the wrong track.
  • Specify the point at which the error happens. Does it occur at the very start of the program or only after you do a certain action?
  • Copy and paste the entire error message and your code to http://pastebin.com/ or http://gist.github.com/.
    These websites make it easy to share large amounts of code with people over the Web, without the risk of losing any text formatting. You can then put the URL of the posted code in your email or forum post. For example, here some pieces of code I’ve posted: http://pastebin.com/SzP2DbFx/ and https://gist.github.com/asweigart/6912168/.
  • Explain what you’ve already tried to do to solve your problem. This tells people you’ve already put in some work to figure things out on your own.
  • List the version of Python you’re using. (There are some key differences between version 2 Python interpreters and version 3 Python interpreters.) Also, say which operating system and version you’re running.
  • If the error came up after you made a change to your code, explain exactly what you changed.
  • Say whether you’re able to reproduce the error every time you run the program or whether it happens only after you perform certain actions. Explain what those actions are, if so.
Always follow good online etiquette as well. For example, don’t post your questions in all caps or make unreasonable demands of the people trying to help you.