KDevelop currently autocompletes the Python shebang and the encoding declaration, at appropriate places in the file and if they aren't already present. It would be useful to also complete other common boilerplate constructs, such as: if __name__ == "__main__": which checks if the current module is being executed directly by the Python interpreter, and not imported from something else. Maybe it could complete the == "__main__" part after seeing the "if __name__" part.