- Your first post will be moderated
- You are not allowed to have a signature
If you do not find a tutorial suiting your needs. You may request one made. If you are not sure about which version to use, check here.
Homework
Naturally, we understand that some students will use this forum to get assistance with their homework, and as a community, we are happy to help. We are not, however, going to do your homework for you. Read the What to include in a post section!
If you are asking for help with homework, we ask that you be honest and admit that it's a homework related question. Show what you've done on your own, and post the code that is causing you problems. Post the exact assignment you've been given, so we know what we're working with.
If you're answering a question that seems like it might be homework, please quote the original post (unless a moderator has locked the post), so that the original question will not be lost.
How to post code
Because Python uses indentation for blocks, it is essential to use code tags when posting code in the forums. Code in code tags makes it easier for us to read, and indented the way you meant it to be.
- click post reply or post topic
- Above the text area box, there are tag buttons (B, i, u, Code, etc.)
- click the code tag "Code" to insert code tags into the text area
- You can either click the code tag, and paste your code between the two tags or:
- You can copy just your code, and click the code tag, which will wrap your code in code tags
- Code: Select all
[code]Put Your Code Here[/code]
What to include in a post
- If you can form a question with a question mark (?), that will allow some users to answer your question very quickly. It is especially important if you post a huge amount of text, since we could read the question, and then fill in the details afterward as necessary
- If you're asking a question about code, don't make a post without your own code
- Always add the entire Traceback that you get. For example, the code
- Code: Select all
1 + '2'
when put into a Python shell will give you the following traceback (the error message)- Code: Select all
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
1 + '2'
TypeError: unsupported operand type(s) for +: 'int' and 'str'
don't just post the "TypeError: unsupported operand type(s) for +: 'int' and 'str'" part - Post as much code as necessary to reproduce your error, as well as instructions for how to run that code (what input it needs, what files need to present). If "as much code as necessary" is all your code, then so be it, but if you have a thousand line script and you're getting a traceback similar to the above, you could reproduce the error in one line. (As a bonus, reducing your code like this often makes it easier for you to figure out the solution on your own!)
- For testing purposes, it often makes things easier for us if you replace a raw_input() call with a hard-coded variable that reproduces your problem
- If your program has a GUI (graphical user interface, such as Tkinter, wx, pyqt, etc.) and your problem is with something other than the GUI programming, you will be more likely to get help if you only the post code that you need help with. Separating program logic from user interface is good practice anyway
- Post any code (even if one line) in code tags to help differentiate code from text
- Based on the question sometimes its helpful to know what Operating System (OS) your on.
- Please state which python version you are using, not knowing can cause confusion when an answer is given for the wrong version that then doesn't work for you.
What to NOT include in a post
- Your own line numbers with the code
- Please do not take a screenshot of your traceback, just copy and paste the text of it in the post
Following these guidelines will make it easier for everyone to see, understand, and organize your code and help you get an answer promptly. Ignoring these guidelines will make your post turn into a mirror of these guidelines from numerous users.
