Writing text files to a predetermined directory (Python) (Cloud9 IDE)?

The project I’m working on involves hooking sensors up to a Beagle Bone Black (Debian, Rev C) and saving the data the sensors receive to a text file. I’ve been able to get my code to execute, but the issue is how it’s executing. I’m writing and uploading code (python) to the Beaglebone using the Cloud9 IDE (enter 192.6…etc into browser bar).
The below example snippet of code illustrates how I’m trying to do this:

`

import os

name = raw_input('name the file: ')
final_name = os.path.join(‘C:’, ‘Users’, ‘CPU’, ‘Desktop’, name + ‘.txt’) #save location
data = open(name + ‘.txt’, ‘a+’)

x = [i for i in range(0,50)] #basically here for testing purposes

data.write(str(x) + ‘\n’)
data.close()

`

As you can see, the goal is to save the text file the Beaglebone creates to the desktop of the computer it is attached to. This code does create and save a text file, but it isn’t on the desktop of my CPU. It ends up placed in the side bar of the IDE in the same folder, and there is nothing in sight on my CPU’s desktop. The image below should help clarify what I mean:

Am I using the os.path.join function incorrectly? I feel like this wouldn’t even create a file if I misused that function.

Any help is appreciated.

I’m sorry to see it looks like there was no response to your question! I’m actually trying to do the very same thing (but not with cloud9, I’m ssh-ing into the beaglebone black through a putty terminal window). But I am trying to create and manipulate a text document in my PC with beaglebone, did you ever find a way to do this? Thanks for reading!

Evan

On Sat, 7 Oct 2017 12:53:32 -0700 (PDT),
evangrcarter@gmail.com declaimed the
following:

I'm sorry to see it looks like there was no response to your question! I'm
actually trying to do the very same thing (but not with cloud9, I'm ssh-ing
into the beaglebone black through a putty terminal window). But I am trying
to create and manipulate a text document *in my PC *with beaglebone, did
you ever find a way to do this? Thanks for reading!

  You will have to either:
a) create the file locally (IE, on the BBB);
    have an FTP server running on the Windows box;
    issue an FTP command on the BBB to transfer the file from the BBB
to the Windows box

b) make the disk/directory on the Windows box network sharable;
    use Linux commands to mount the Windows disk/directory (Samba/NFS)
somewhere on the BBB

  That a BBB is involved is irrelevant -- you'd have the same problem
with a shell account at an ISP (any one remember those), or at any
web-server... the computers are effectively independent, with only the
IP/Port used by SSH (putty) or web-server (Cloud9) known to both sides.

https://www.howtogeek.com/176471/how-to-share-files-between-windows-and-linux/