Create creds.py in the same directory, with contents like this:
ACCESS_TOKEN = "myaccesstoken..."
Check syntax by running it:
python3 creds.py
It will be importable into your original source.
However, I doubt whether this is a good pattern for security. All it does is separate the access token from your main source file by "hiding" it in another source file. Hopefully someone with a strong background in security will pipe up with a better pattern. It's the kind of thing that is very easy to "make work" but "get wrong".
This might be a case where simple is OK, though, assuming that the creds are your creds and not a customer's creds, and the platform you're running the python code on is secure.