Download file from Python

I have a connectPort x2 and I want to write a simple bootstrap script that will download a config file from a central server on startup.

I’ve tried urllib but it takes up a lot of memory and usually crashes the device. The x2 has very little memory to begin with.

Is there any more efficient way of downloading files from python?