I am in the process of learning blender python, and everyone suggest to use the python console in blender to test and check functionality of short line of code.
Well, I am pretty doing this, but while working on bpy.ops I faced the “context” problem.
For example I was trying something as:
but it says that the context is incorrect. So I created a short script where I switch to the GRAPH_EDITOR context and it works:
I found I was placing the () after the paste in the If statement. Now it does not give me error. Btw it is doing anything since the if statements return False (the context is incorrect and poll() return False).
Now: how can I run bpy.ops.graph.paste() from the console? I guess the only way should be using a script, which is fine, but the console cannot help me testing it before putting in a script! I’m looking for a turnaround
this doesn’t help one if you have a single view of the console, like I think this is targeted for, but you dont even have to run the gui in the first place for the api and console, simply run in the command line the python module InteractiveConsole, then you can just use the terminal for the apis you need. of course after you close the terminal python session then blender will show you the gui.