Are you not mixing between command line and console ?
For example, how can you execute this request via electrum command line
for x in range(0, 50):
print wallet.create_new_address(False)
You'd need to do that from a shell script (or batch file)... using the appropriate scripting language for your OS.
Is there any reason why you can't do it in the GUI?