Read files at local in Asure VM python code - python

My python program is running in Assure Virtual machine. I needs to read csv file from local machine. Develop Python code to read CSV file from local machine into Asure virtual machine. python code will runs in VM.
How can a python code running in Asure VM, can read data from local disk/local machine
develop python code to import/read data from local machine to Asure VM. While executing the code in Asure VM, data needs to import from local machine.

Related

Local notebook server using a gateway server for kernel management, writing to a local file

I have a Jupyter notebook server running on my local machine, with a gateway server running on a more powerful/remote machine.
I can write to a file on the remote machine with normal code in a normal notebook, but I can't figure out how to write to a file on my local machine. Is there some %magic command for being able to execute code locally, or any mechanism to access a local file, when using a gateway server?

Opening script saved on a cluster with local spyder installation

I have anaconda, hence spyder, installed on a local machine. What I am trying to do is to use my local spyder installation to open a .py script saved on a remote cluster (in my office) via ssh. The issues that I am encountering are the following:
I cannot run spyder from the cluster - there is no graphical device whatsoever. For example, we have actually anaconda installed on the cluster, but when I ran spyder from the command line, I get the following error message: Could not connect to any X display
I cannot mount the (remote) drivers, where the .py scripts are located, onto my local machine when I am working from home (which is the case when I am at work, connected to the internet via cable). If this was the case, I could simply launch spyder on my local machine, then open the scripts. I can only access the files on some drivers mounted onto the cluster via ssh.
As, however, I can access the .py scripts saved on the cluster via ssh (I can open then with programs installed locally e.g. vim, jpico etc), I was wondering whether it is possible to use the command line to open a script saved on a remote cluster using my local spyder installation, something like $ spyder /path/to/myScript/savedOnTheRemoteCluster.py
(Spyder maintainer here) As of May 2019 our editor is not capable of working with files on remote locations. So your best option right now is to mount your remote server with sshfs to make it appear as a local directory and then open any file present there in Spyder.

Running remote script on remote interpreter in PyCharm

I have a python script on a remote server. I would like to run it on the remote server itself. However, PyCharm is not installed on the remote server and I need PyCharm to debug the code.
I have PyCharm on my local computer and I would like to run the script (which is on remote server) on the remote server using PyCharm on my local machine. I am aware of Deployment tools and remote server host in PyCharm. I do not know how to make them work together.
Having the script on my local computer is not really an option for me as there are huge data files involved with the code and I have very limited storage on my laptop.
I'm not sure if it's absolutely necessary to use Pycharm only for debugging on your remote server but if not, you can use pdb module for debugging too: https://docs.python.org/2/library/pdb.html

Save image from python script to server without saving on local machine

Is there any way to save image from python script to server with python command without saving on local machine? For example, what would be the last line in this code:
path = 'path/to/folder/on/server'
imfile=frame.copy() #get screenshot from my webcam
magic_function(imfile, path)
Maybe I can do this with paramiko library and ssh.exec_command? What should I do in this case?
I use Ubuntu 14.04 on both local and server machine and my code is in python-2.7

run local python script from remote linux machine over ssh

I'm trying to run a python script on a remote linux machine accessed by ssh(putty). I want to change/access directory to the windows directory and run a program which converts files on the server to csv and saves them to the server.
Is it possible to run the program without moving the files from remote to local, run conversion, move local to remote?
I am not the root user and can't install anything on the linux machine.
My Windows is 64bit and the linux machine is 64bit Ubuntu. Any suggestions?
I found a way to do what I wanted. Doing what I initially wanted requires me to transfer the files from the local machine to the remote machine then running the script and transferring it back. Ultimately it's a function of how fast my internet connection is. Since my local connection isn't that strong, I realized that my initial thoughts were flawed. Eventually, I just uploaded my data to the remote machine and run the script there. It was the fastest solution

Categories