Running python script


I’m trying to download an image from S3 and save it to SD card using Boto library. Here is my python script,

from boto.s3.connection import S3Connection
print ‘script begins’
b = conn.get_bucket(‘BUCKET_NAME’) # substitute your bucket name here

from boto.s3.key import Key
k = Key(b)
k.key = ‘samplesound.caf’
print ‘script ends’

When I run the script above directly from ssh by typing python, the file is downloaded from S3 and saved to sd card. However, when I run it from sketch like the follow, the python script executes (since it prints debug string within the script), but the file is never saved.

#include <Bridge.h>
#include <Process.h>
#include <Console.h>

void setup() {


void loop() {


void downloadFromS3 {
Console.println(“Download S3 begins!”);
digitalWrite(13, HIGH);
Process p;

while (p.available()) {
char c =;


Can anyone tell me why?

I appreciate any feedback in advance. Thank you.

Change to absolute path:


Absolute path & relative path

Thank you so much. It seems to work! :slight_smile:

As a bit of explanation: when you run the script manually from an SSH connection, you have switched to a directory, and the script is running from that current directory. When it goes to save a file that has no path information,MIT puts it in the current directory. Since you are there, you find the file.

But when you run it from the Process object, you are not running from the same directory. Instead, the current directory is buried down in the system tree. The file is still being created, but not in the directory you expect, so you can't find it and you think the operation has failed.