Pass string to python

What is the best way to pass a file name string from Arduino code to python code?

I am logging data to an SD card which gets a unique file name each time the code runs. After the code is completed I am uploading that unique file to Dropbox.

I am still learning the python so lots of explanation is probably needed :sunglasses:

Thank you in advance for any help.

Use current day or hour as unique file name, no need pass from arduino:

nano timefilename.py
from datetime import datetime, timedelta
yesterday = datetime.now() - timedelta(days=1)
yesterdayfilename=yesterday.strftime('%m%d%y')+".log"
print yesterdayfilename
today = datetime.now()
todayfilename=today.strftime('%m%d%y')+".log"
print todayfilename
python timefilename.py
121214.log
121314.log

use todayfilename to save log, and use yesterdayfilename by cron ( schedule service ) upload previous day log file into dropbox.

Sonnyyu,

Am I following your code logic correctly?

First, in SSH we make a call to write to the "timefilename.py" file using the nano command. Then we write the second code block to the file?

http://forum.arduino.cc/index.php?topic=224609.msg1627106#msg1627106

Replace '/mnt/sda1/datalog.csv' by todayfilename (convert it into absolute path).

every 10 seconds arduino send 2 parameters ( you could code as n parameters) back to Yun.

int parameter1 = analogRead(A0);
int parameter2 = analogRead(A1);
...