Pythonanywhere api for new console

Thanks for your GREAT Service. is there anyway to create a new console ( or run a custom console or even run a python script) with the API?

See the api documentation for how to create a console


Thanks for detail but I'm new to Python and i wrote this but It doesn't work :(

import requests
import urllib
my_domain = ''
username = 'xxxx'
token = 'xxx'
params = urllib.parse.urlencode({'executable': 'python3.6', 'arguments': '-i /home/dopes/', 
'working_directory': '/home/xxxx'})
response ='{username}/consoles/'.format(username=username),params ,headers={'Authorization': 'Token {token}'.format(token=token)})

what do you expect to happen and what happens instead? is there an error stacktrace?

actually It doesn't work ( i mean it doesn't create a new console ) it just gives me List of all my consoles

>>> import requests
>>> import urllib
>>> params = urllib.parse.urlencode({'executable': 'python3.6', 'arguments': '-i /home/dopes/', 
'working_directory': '/home/xxxx'})

>>> response ='',params 
,headers={'Authorization': 'Token xxxxxxxxxxxxxxxx'})
>>> print(response)
<Response [200]>
>>> print(response.content)


As the docs say: That creates the console, but does not start it. We do not have an API endpoint for starting consoles at the moment.

I just wanted to add that without the ability to start a console via the API, the opportunities to use the API in any sort of automation are limited - you need to either resort to scheduled tasks only, or to having a pre-created console (whose ID at any time you might discover via the API).

thanks- we are aware of this problem with the console API. the API is in beta, and tweaking/expanding the API is definitely on our list of things to do.

Hello guys, is there any progress in terms of starting a new console from your API?

No, not at the moment.