Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

as all know it is impossible to write long python script directly on Linux machine with vi editor

so we use (win editor) tools as visual studio / Pycharm and so on ....

so my question is how to execute python script on WIN from Visual studio with Linux environment?

For example

The following python code was written on the visual studio

import os
f = os.popen('date')
now = f.read()
print "Today is ", now

Usually after I write the code on the visual studio, then I send the python file to the Linux machine and I run the python on Linux environment

And that because we cant run python code that fit for linux on win

Please advice if there are some alternative to run the python on Visual studio or other editors with Linux environment?

share|improve this question
    
I write all my python code using vi on a linux machine, so I definitely don't agree with the first sentence at least. Also, why can't you save that to a file and run it on Linux? Copying that to a file and running python sample.py worked fine on my Linux machine, so what is it that's preventing you from running it? Perhaps an example that doesn't work and the accompanying error message would help –  Eric Renouf Aug 17 at 16:42
    
sorry but I don't agree , there are many problem as indenting and so on , so from VI you cant see if your syntax is wrong , working from vi is not good idea –  maihabunash Aug 17 at 16:46
    
Alright, that's not really relevant to your question though, so we'll just disagree about that. What is actually preventing you from running your python code on a linux system after writing it with Visual Studio? The code you provided runs fine on my linux system, so I still don't understand the question –  Eric Renouf Aug 17 at 16:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.