Any EC2 instance, either classic or running ECS, is running in an Availability-Zone, which means a given data-center in a given region. If your real goal is to run the code in the nearest region, then you'll need to deploy in multiple regions. If your goal is to connect it closer to the client, Cloudfront could work for APIs too: GET requests will be cached depending on the cache headers, whereas PUT/POST/DELETE/HEAD/OPTIONS will not be cached. The access point will therefore be close to your user, but the request will then (unless for cached GET requests) be routed to your deployment region.
If it's a single-container simple app, I would say ECS is the way to go, because creating a task-definition is very simple JSON and will do the job for you.
That said, since the workload sounds low (your mention of a nano instance) and infrequent (you mentioned 'from time to time'), you might also consider Lambda: Python is supported, you'll be charged only for the execution time (ie no charge when no requests are received), and there's even a generous free tier which might end-up make it free if it's really "from time to time". (Please remind that, even if you don't manage any server, you still choose a region in which the lambda is managed and run)
And finaly - but it's recent and I never used it yet - there's Lambda@Edge which lets you run lambda code at Cloudfront edge location, which could be what you're looking for: running code close to the user.