For some one looking for the solution just copy your code and paste in the python code format mentioned by @gpk2000 and paste the output under the section of the language in the conf file which is at /usr/share/geany/snippets.conf. like this may be hi=the op you got from the python
now when you use the word hi in geany type hi and then press tab to autocomplete the snippet