Abstract: A method and a terminal device for programming are provided. The method for programming includes: loading a programming driver; receiving programming instructions including programming file identification information sent by a user; sending a target programming file to a program editor via the programming driver when the target programming file is obtained from the programming file database based on the programming file identification information; receiving a customized information from the user when the target programming file is not obtained by the server from the programming file database according to the programming file identification information, and receiving a customized programming file based on the customized information, and sending the customized programming file to the program editor via the programming driver; executing a programming operation for a device based on the target programming file.