Getting Help

This document is intended to provide you with the information you need to get help as quickly and effectively as possible. If you're stuck on a problem or you just don't understand something, feel free to join us and ask for help - you can use this as a reference when forming your question.

Much of this document is based on the sentiments expressed by Eric Steven Raymond and Rick Moen in their essay, How To Ask Questions The Smart Way. Please note that the essay is very long and may be considered rude by some. Additionally, the people behind that essay are in no way affiliated with us - please do not bother them with your Python problems.

Before You Ask

Before you ask your question, there are a few things you can do to find an answer on your own. Experienced developers will do the following:

  • Read the official documentation for whatever you're working with
  • Use a debugger to inspect your code
  • Examine the traceback when your code raises an exception
  • Do some research online - for example, on Stack Overflow
  • Read the source code for whatever you're working with
  • Search the message history of the help channels

Essentially, doing your research is the first step towards a solution to any problem. If your problem isn't extremely general, we're going to be doing exactly these steps ourselves when you ask, so doing the legwork beforehand saves everyone a lot of time.

Creativity requires input, and that's what research is. You're gathering material with which to build.

Gene Luen Yang

If you're an absolute beginner, take a moment to step back from the problem. Have you read a book or done a tutorial? There's a huge amount of resources out there, many of which are going to help you a lot more than us answering the beginners' questions for you. If you're following a tutorial, book or course and you don't understand something, then that is the correct time to ask a beginners' question. Of course, we won't turn you away if you do have a beginners' question — by all means, come to us if you do have a problem.

Have you read the official documentation for the module or technology you're working with? The official Python 3 docs are a fantastic and valuable resource, so if you're using a bundled module, your first port of call should be there. If you're using a third-party library, often they will have some official documentation uploaded somewhere — try having a Google around, or take a look at PyPi in case they've linked it from there.

If you can't find the documentation or you find it lacking, the next place to look is the source code. Grab a decent IDE (we recommend PyCharm Community) and a coffee, download a copy of the project and open it up, and get to browsing!

If you're still confused, try searching the Internet for people that have already had the same problem. Often, you won't be the only person to have encountered the issue you're dealing with - more often than not, you'll find a GitHub issue or a StackOverflow question along with a fix or answer to your question already posted.

If none of the above helps you or you're lost, scared and alone, feel free to continue on to the Discord server. You can use the search feature (the at the top right) to check whether someone else has asked your question recently, or just feel free to pick one of the help channels and ask your question.

A Good Question

When you're ready to ask a question, there's a few things you should have to hand before forming a query.

  • A code example that illustrates your problem
    • If possible, make this a minimal example rather than an entire application
  • Details on how you attempted to solve the problem on your own
  • Full version information — for example, "Python 3.6.4 with discord.py 1.0.0a"
  • The full traceback if your code raises an exception
    • Do not curate the traceback as you may inadvertently exclude information crucial to solving your issue

Your question should be informative, but to the point. More importantly, how you phrase your question and how you address those that may help you is crucial. Courtesy never hurts, and please type using correctly-spelled and grammatical language as far as you possibly can.

When you're inspecting a problem, don't be quick to assume that you've found a bug, or that your approach is correct. While it helps to detail what exactly you're trying to do, you should also be able to give us the bigger picture - describe the goal, not just the step. Describe the problem's symptoms in chronological order - not your guesses as to their cause.

Bad Questions

Good Questions

Where can I find information on discord.py?

This question suggests that the person asking it hasn't done any research, or even a simple Google search.

I used Google to try to find more information about "discord.py 1.0.0a", but I couldn't really find anything useful. Does anyone know where I might find a guide to writing commands using this library?



Pillow puts my text at the bottom of the image instead of where I wanted it. Why is it broken?

This question assumes that the problem is with Pillow itself, and that it isn't the questioner's fault. It also doesn't provide enough information on the problem.

Pillow appears to insert text at the bottom of the image if the given X coordinate is negative. I had a look at the documentation and searched Stack Overflow, but I couldn't find any information on using negative coordinates to position text. Has anyone attempted this?



I'm having some trouble writing a YouTube random URL generator - can anyone help?

This question provides no information on the problem, and asks for help in a way that isn't engaging - some people will find this annoying, as answering your question is guaranteed to result in another question.

My YouTube random URL generator appears to be returning false positives for tested URLs, stating that a URL points to a real video when that video doesn't actually exist. Obviously there's some issue with how this is checked, but I can't put my finger on it. Is there anything I can check?



I want to share a YouTube video with my friend, but the video doesn't move when I print the page. How do I make the video move?

This question assumes a specific (wrong) approach, and isn't open-ended enough to account for the possibility of a better solution.

I'm attempting to figure out the best way to share a YouTube video with my friend that doesn't have the Internet at home. I can't think of a better approach than printing the page, which obviously doesn't help much given that the video doesn't move on the paper - can anyone think of a better approach to this?



I was given this assignment by my teacher, but I'm not sure how to approach it. Does anyone have any ideas?

This question is clearly a homework question. Homework is supposed to challenge you, and we will not provide solutions to homework. Instead, ask a more general question.

I have a list of numbers - how do I calculate how many of them are even? Is there a way to remove all the odd numbers from my list? Are there quick ways to find the average of a list of numbers, or add them all together?

Interpreting Answers

Programmers have a certain set of mannerisms. While we all try to be as courteous with our replies as possible, occasionally it may seem as if a helper is annoyed or disinterested in your question. This isn't personal - it's just part of our culture. Remember that the people you're asking for help are humans and that they're here voluntarily, in their free time.

If you've asked a question and you're told to read the documentation or search the web, you should do that. When this happens, it's often the case that the person responding has the information you need open in their web browser and either thinks that it's very easy to find, or that you would learn more from seeking out the source of the information yourself. If you've already done this, you should tell us by including it in your question!

If you don't understand an answer, don't immediately bounce back and demand clarification. Use the tools available to you (the internet, documentation, source code) to help you understand the answer, and if you still can't figure it out, ask for clarification and provide any relevant information you learned during your research.

Successful people ask better questions, and as a result, they get better answers.

Tony Robbins

Much of what looks like rudeness within programming communities is not intended to be offensive and it's often just a product of the down-to-earth, direct style of communication that is typical in a community that is more concerned with solving problems than anything else. If you perceive rudeness, try to react calmly. If a user really is acting out, then chances are that a member of staff will call them out on it. If this doesn't happen, contact a member of staff directly and they will try to clarify this with you.

It's okay to mess up. It happens to all of us. That said, if you mess up badly enough, it's likely that you will be corrected there and then, in public and with a verbal scalpel. Take this as a learning experience and don't let it get to you - this is a common and appropriate response in many programming circles. Community standards do not maintain themselves - they're maintained by people applying actively them, visibly, in public.

What Not To Ask

Can I ask a question?

Yes. Always yes. Just ask it.

Can I use str() on a discord.py Channel object?

Try it yourself and see. Experimentation is a great way to learn, and you'll save a lot of time by just trying things out. Don't be afraid of your computer!

My code doesn't work

This isn't a question, and it provides absolutely no context or information. Depending on the moods of the people that are around, you may even find yourself ignored. Don't be offended by this - just try again with a better question.

So much of life isn’t about having the right answer; it’s about knowing the right question.

Duane Hewitt

Can anyone help me break into someone's Facebook account?
Can anyone help me download anime from this streaming site's listing page?
How do I write a virus?

We will absolutely not help you with hacking, pirating, or any other illegal activity. A question like this is likely to be followed up with a ban if the person asking it doesn't back down quickly.

Can I send you a private message?

No. We do not provide one-on-one tutoring - you can hire someone locally if you really need that. We also prefer that questions are answered in a public channel as it means that everyone else present is able to learn from them. If you're working with code that you are unable to disclose for any reason, you should try to make your question more general and write a separate, small piece of code to illustrate your problem.

Can you help me over Teamviewer?

No. We will not help you by accessing your computer remotely, or watching a video stream of your problem, unless the problem is something that inherently requires that. The reason for this is that our time is limited, and watching a video or participating in a screen-sharing session means that we have to focus on you, instead of being able to deal with other people while you're figuring out an answer. If your problem is graphical and you can't adequately describe it without a visual, take a screenshot or provide a short screen recording to illustrate your problem.

Examining Tracebacks

Usually, the first sign of trouble is that when you run your code, it raises an exception. For beginning programmers, the traceback that's generated for the exception may feel overwhelming and discouraging at first. However, in time, most developers start to appreciate the extensive information contained in the traceback as it helps them track down the error in their code. So, don't panic and take a moment to carefully review the information provided to you.

Reading the traceback

Traceback (most recent call last):
  File "my_python_file.py", line 6, in <module>
    spam = division(a=10, b=0)
  File "my_python_file.py", line 2, in division
    answer = a / b
ZeroDivisionError: division by zero

In general, the best strategy is to read the traceback from bottom to top. As you can see in the example above, the last line of the traceback contains the actual exception that was raised by your code. In this case, ZeroDivisionError: division by zero, clearly indicates the problem: We're trying to divide by zero somewhere in our code and that obviously can't be right. However, while we now know which exception was raised, we still need to trace the exception back to the error in our code.

To do so, we turn to the lines above the exception. Reading from bottom to top again, we first encounter the line where the exception was raised: answer = a / b. Directly above it, we can see that this line of code was line 2 of the file "my_python_file.py" and that it's in the scope of the function division. At this point, it's a good idea to inspect the code referenced here to see if we can spot an obvious mistake:

1| def division(a, b):
2|    answer = a / b
3|    return answer

Unfortunately, there's no obvious mistake in the code at this point, although one thing we do see here is that this function divides a by b and that the exception will only occur if b is somehow assigned the numeric value 0.

Keeping that observation in the back of our minds, we continue reading the traceback from bottom to top. The next thing we encounter is spam = division(a=10, b=0) from line 6 of the file "my_python_file.py". In this case, <module> tells us that the code is in the global scope of that file. While it's already clear from the traceback what's going wrong here, we're passing b=0 to the function division, inspecting the code shows us the same:

5| spam = division(a=10, b=0)
6| print(spam)

We have now traced back the exception to a line of code calling the division function with a divisor of 0. Obviously, this is a simplified example, but the exact same steps apply to more complex situations as well.

The error is sometimes in the line before the line in the traceback

Sometimes, the actual error is in the line just before the one referenced in the traceback. This usually happens when we've inadvertently omitted a character meant to close an expression, like a brace, bracket, or parenthesis. For instance, the following snippet of code will generate a traceback pointing at the line after the one in which we've missed the closing parenthesis:

1| print("Hello, world!"
2| print("This is my first Python program!")

File "my_python_file.py", line 2
    print("This is my first Python program!")
        ^
SyntaxError: invalid syntax

The reason this may happen is that Python allows for implicit line continuation and will only notice the error when the expression does not continue as expected on the next line. So, it's always a good idea to also check the line before the one mentioned in the traceback!

More information on exceptions

Further information on exceptions can be found in the official Python documentation:

  • The built-in exceptions page lists all the built-in exceptions along with a short description of the exception. If you're unsure of the meaning of an exception in your traceback, this is a good place to start.
  • The errors and exceptions chapter in the official tutorial gives an overview of errors and exceptions in Python. Besides explaining what exceptions are, it also explains how to handle expected exceptions graciously to keep your application from crashing when an expected exception is raised and how to define custom exceptions specific to your application.

If you encounter an exception specific to an external module or package, it's usually a good idea to check the documentation of that package to see if the exception is documented. Another option is to paste a part of the traceback, usually the last line, into your favorite search engine to see if anyone else has encountered a similar problem. More often than not, you will be able to find a solution to your problem this way.