Re: Transitioning from Linux to Windows

2017-06-05 Thread Irmen de Jong
On 3-6-2017 15:44, chitt...@uah.edu wrote:
> Ideally, I would like to set up the user on their Windows 7/10 system so that 
> they can "login" to the ubuntu system (say putty) - change working directory 
> (to where desired) - run the script (on the ubuntu system) - and scp the file 
> back to the windows desktop.


You can use Pyro4 to directly call the python scripts running on your ubuntu 
system from
python code on the windows machines, thereby avoiding the hassle of having to 
deal with
a remote shell session.
It does require you to run a Pyro4 daemon on the linux box and deal with 
security in
some other way.

Irmen
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Transitioning from Linux to Windows

2017-06-04 Thread Thomas Jollans
On 05/06/17 00:35, chitt...@uah.edu wrote:
> It is not difficult (for me) - I developed the scripts to analyze files 
> created by two different linux boxes (why two boxes is a longer story) (these 
> are linux machines connected to gene sequencers) - the users are likely going 
> to be fairly naive when it comes to running/using programs - and while the 
> files can be transferred to the windows machine and then analyzed/examined, 
> was trying to see if the windows machines can be used as simply a front end 
> (no file transfers/etc) - but yes, it is indeed a solution that can be 
> implemented - get the files over, run the script on windows machines (even as 
> it makes me nervous to run scripts on windows systems - with or without 
> anaconda - I am so used to being in the Linux environment that dealing with 
> windows makes me nervous :(

I see. Well, if you're going to be building a user-friendly user
interface anyway, it shouldn't make much of a difference (development
work load wise) whether you use web technologies (as discussed here),
Tkinter, PyQt, or something else, unless you're already familiar with
one of them.

(if you're still toying with the idea of hacking together something with
PuTTy and the users SSHing in from Windows, then a command line script
on the user's PC might actually be more user-friendly...)




> 
> On Sunday, June 4, 2017 at 5:05:49 PM UTC-5, Thomas Jollans wrote:
>> On 04/06/17 22:56, I wrote:
>>> I was looking for the "simplest" possible solution to take a script that 
>>> runs on a Linux box and figure out a way to have it run from a windows 
>>> client 
>>
>> Care to comment on why getting the script to run on Windows directly is
>> so difficult? I'm sure you can build something that does the job with
>> Django/Flask/whatever, but it doesn't sound like it's necessarily the
>> simplest solution.
>>
>>
 On Mon, Jun 5, 2017 at 2:41 AM, Michael Torrie wrote:
> I'm confused why you would need to ssh anywhere.  Command-line programs
> in Python should work perfectly fine in Windows and work about the same
> as on Linux, if you wrote them in a portable way.  I don't understand
> the need to complicate things with ssh, django, x2go, or any of the
> other suggestions here.  I also don't understand why you'd need the
> Anaconda distro.  Why won't standard Python from python.org work?
> 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Transitioning from Linux to Windows

2017-06-04 Thread chitturk
It is not difficult (for me) - I developed the scripts to analyze files created 
by two different linux boxes (why two boxes is a longer story) (these are linux 
machines connected to gene sequencers) - the users are likely going to be 
fairly naive when it comes to running/using programs - and while the files can 
be transferred to the windows machine and then analyzed/examined, was trying to 
see if the windows machines can be used as simply a front end (no file 
transfers/etc) - but yes, it is indeed a solution that can be implemented - get 
the files over, run the script on windows machines (even as it makes me nervous 
to run scripts on windows systems - with or without anaconda - I am so used to 
being in the Linux environment that dealing with windows makes me nervous :(

On Sunday, June 4, 2017 at 5:05:49 PM UTC-5, Thomas Jollans wrote:
> On 04/06/17 22:56, I wrote:
> > I was looking for the "simplest" possible solution to take a script that 
> > runs on a Linux box and figure out a way to have it run from a windows 
> > client 
> 
> Care to comment on why getting the script to run on Windows directly is
> so difficult? I'm sure you can build something that does the job with
> Django/Flask/whatever, but it doesn't sound like it's necessarily the
> simplest solution.
> 
> 
> >> On Mon, Jun 5, 2017 at 2:41 AM, Michael Torrie wrote:
> >>> I'm confused why you would need to ssh anywhere.  Command-line programs
> >>> in Python should work perfectly fine in Windows and work about the same
> >>> as on Linux, if you wrote them in a portable way.  I don't understand
> >>> the need to complicate things with ssh, django, x2go, or any of the
> >>> other suggestions here.  I also don't understand why you'd need the
> >>> Anaconda distro.  Why won't standard Python from python.org work?

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Transitioning from Linux to Windows

2017-06-04 Thread Thomas Jollans
On 04/06/17 22:56, chitt...@uah.edu wrote:
> I was looking for the "simplest" possible solution to take a script that runs 
> on a Linux box and figure out a way to have it run from a windows client 

Care to comment on why getting the script to run on Windows directly is
so difficult? I'm sure you can build something that does the job with
Django/Flask/whatever, but it doesn't sound like it's necessarily the
simplest solution.


>> On Mon, Jun 5, 2017 at 2:41 AM, Michael Torrie wrote:
>>> I'm confused why you would need to ssh anywhere.  Command-line programs
>>> in Python should work perfectly fine in Windows and work about the same
>>> as on Linux, if you wrote them in a portable way.  I don't understand
>>> the need to complicate things with ssh, django, x2go, or any of the
>>> other suggestions here.  I also don't understand why you'd need the
>>> Anaconda distro.  Why won't standard Python from python.org work?


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Transitioning from Linux to Windows

2017-06-04 Thread chitturk

Precisely - (as Chris wrote) - the problem is NOT python itself (and yes, it 
can indeed run on windows machines - though I have run into some minor issues) 
- it is about the "user"/"users" who are pretty clueless if there is no "GUI" - 
several have suggested django (am going through the tutorial), cherrypy looks 
"simple" - perhaps even x2go ... 

I was looking for the "simplest" possible solution to take a script that runs 
on a Linux box and figure out a way to have it run from a windows client (yes, 
putty/ssh can work - and files can be scp'ed back and so on) (someone also 
referenced "fabric" (which uses paramiko) ... 

And yes, I was indeed trying to avoid spending time on the "UI" beyond simple 
text messages - asking for user input/etc and printing messages (errors) and if 
the computation was successful etc etc - django does seem powerful, and perhaps 
I may (just may) try that or cherrypy or whatever works best (!)

On Sunday, June 4, 2017 at 12:48:40 PM UTC-5, Chris Angelico wrote:
> On Mon, Jun 5, 2017 at 2:41 AM, Michael Torrie wrote:
> > I'm confused why you would need to ssh anywhere.  Command-line programs
> > in Python should work perfectly fine in Windows and work about the same
> > as on Linux, if you wrote them in a portable way.  I don't understand
> > the need to complicate things with ssh, django, x2go, or any of the
> > other suggestions here.  I also don't understand why you'd need the
> > Anaconda distro.  Why won't standard Python from python.org work?
> 
> If I'm understanding the OP correctly, the intention is to leave the
> script where it is on the Linux box, but trigger it (and maybe provide
> some parameters) from a Windows box. That by definition means some
> sort of network connection, hence SSH or HTTP or some other protocol.
> 
> ChrisA

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Transitioning from Linux to Windows

2017-06-04 Thread Chris Angelico
On Mon, Jun 5, 2017 at 2:41 AM, Michael Torrie  wrote:
> I'm confused why you would need to ssh anywhere.  Command-line programs
> in Python should work perfectly fine in Windows and work about the same
> as on Linux, if you wrote them in a portable way.  I don't understand
> the need to complicate things with ssh, django, x2go, or any of the
> other suggestions here.  I also don't understand why you'd need the
> Anaconda distro.  Why won't standard Python from python.org work?

If I'm understanding the OP correctly, the intention is to leave the
script where it is on the Linux box, but trigger it (and maybe provide
some parameters) from a Windows box. That by definition means some
sort of network connection, hence SSH or HTTP or some other protocol.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Transitioning from Linux to Windows

2017-06-04 Thread Michael Torrie
On 06/03/2017 07:44 AM, chitt...@uah.edu wrote:
> I stumbled onto "paramiko" - is that a possible answer?  

I'm confused why you would need to ssh anywhere.  Command-line programs
in Python should work perfectly fine in Windows and work about the same
as on Linux, if you wrote them in a portable way.  I don't understand
the need to complicate things with ssh, django, x2go, or any of the
other suggestions here.  I also don't understand why you'd need the
Anaconda distro.  Why won't standard Python from python.org work?

If you want a little GUI frontend, make it in Tkinter.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Transitioning from Linux to Windows

2017-06-04 Thread Akira Li
chitt...@uah.edu writes:

> ...
> Ideally, I would like to set up the user on their Windows 7/10 system
> so that they can "login" to the ubuntu system (say putty) - change
> working directory (to where desired) - run the script (on the ubuntu
> system) - and scp the file back to the windows desktop.
>
> ("porting" the ubuntu script to anaconda(3) on the windows desktop IS
> possible (but it has not been as easy as I had hoped!) (django and
> programs like that do seem to provide a "GUI" to have python scripts
> run on ubuntu/systems - but the setup looks mysterious/complicated (to
> me anyway))
>
> I stumbled onto "paramiko" - is that a possible answer?  
> ...


You could use "fabric" http://www.fabfile.org/ to automate running shell
commands (such as python scripts) via ssh.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Transitioning from Linux to Windows

2017-06-04 Thread Pavol Lisy
If I understand well then you like to have simple quick solution
without need to learn much.

And that you don't need to support big traffic...

Maybe cherrypy ( http://cherrypy.org/ ) is what you like to look at.

Probably this is good enough on your ubuntu:

sudo apt-get install python3-cherrypy3

You could simply run:
python3 cherry_test.py  # source code bellow

and open web page http://localhost:8080/ in your browser.

  cherry_test.py
import string
import os
import os.path

import cherrypy
from cherrypy.lib import static

localDir = os.path.dirname(__file__)
absDir = os.path.join(os.getcwd(), localDir)

class StringGenerator(object):
@cherrypy.expose
def index(self):
return """
  
  

  
  Give it now!

  
"""

@cherrypy.expose
def generate(self, filename='test.txt'):
with open(filename, 'w') as f:
f.write('test')  # generate simple output file
path = os.path.join(absDir, filename)
return static.serve_file(path, 'application/x-download',
 'attachment', os.path.basename(path))


if __name__ == '__main__':
cherrypy.quickstart(StringGenerator())
###

Simple isn't it?

But don't forget to think about security! :)

On 6/3/17, chitt...@uah.edu  wrote:
> I am looking for suggestions, ideas.
>
> I have developed python (3.6.x, 2.7.x) scripts that run well as a user on an
> ubuntu/16.04 system - the scripts look for files, parses the files,
> assembles an output for the user.
>
> I first cd into a particular directory on the system (where I know the files
> exist) and run the script - the final result is in my working directory.
>
> What I am now trying to do is ... figure out the least painful way to have
> other users do the same - BUT sitting in front of a Windows desktop (7 or
> 10).
>
> Ideally, I would like to set up the user on their Windows 7/10 system so
> that they can "login" to the ubuntu system (say putty) - change working
> directory (to where desired) - run the script (on the ubuntu system) - and
> scp the file back to the windows desktop.
>
> ("porting" the ubuntu script to anaconda(3) on the windows desktop IS
> possible (but it has not been as easy as I had hoped!) (django and programs
> like that do seem to provide a "GUI" to have python scripts run on
> ubuntu/systems - but the setup looks mysterious/complicated (to me anyway))
>
> I stumbled onto "paramiko" - is that a possible answer?
>
> Any suggestion/ideas would be greatly appreciated!
>
> (I am perfectly willing to stick to 3.6.x, unless there is a clean/easy
> solution using 2.7.x)
>
> krishnan
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Transitioning from Linux to Windows

2017-06-03 Thread Wolfgang Maier

On 03.06.2017 15:44, chitt...@uah.edu wrote:

I am looking for suggestions, ideas.

I have developed python (3.6.x, 2.7.x) scripts that run well as a user on an 
ubuntu/16.04 system - the scripts look for files, parses the files, assembles 
an output for the user.

I first cd into a particular directory on the system (where I know the files 
exist) and run the script - the final result is in my working directory.

What I am now trying to do is ... figure out the least painful way to have 
other users do the same - BUT sitting in front of a Windows desktop (7 or 10).

Ideally, I would like to set up the user on their Windows 7/10 system so that they can 
"login" to the ubuntu system (say putty) - change working directory (to where 
desired) - run the script (on the ubuntu system) - and scp the file back to the windows 
desktop.

("porting" the ubuntu script to anaconda(3) on the windows desktop IS possible (but it 
has not been as easy as I had hoped!) (django and programs like that do seem to provide a 
"GUI" to have python scripts run on ubuntu/systems - but the setup looks 
mysterious/complicated (to me anyway))

I stumbled onto "paramiko" - is that a possible answer?

Any suggestion/ideas would be greatly appreciated!

(I am perfectly willing to stick to 3.6.x, unless there is a clean/easy
solution using 2.7.x)

krishnan



An alternative to writing your own server app using django, though 
admittedly less exciting from a developer's point of view, could be
x2goclient/server (http://wiki.x2go.org/doku.php/start). That would be 
more like your putty suggestion, but a lot more user-friendly.


Wolfgang

--
https://mail.python.org/mailman/listinfo/python-list


Re: Transitioning from Linux to Windows

2017-06-03 Thread Chris Angelico
On Sun, Jun 4, 2017 at 12:24 AM,   wrote:
> On Saturday, June 3, 2017 at 8:50:27 AM UTC-5, Chris Angelico wrote:
>
>> Hmm. ISTM the easiest way would be to run an explicit server, probably
>> HTTP (hence Django as you mentioned), and then you can have people
>> access it using a client on Windows. With HTTP, that client would
>> simply be a web browser. I would advise picking up a quick tutorial on
>> Django or Flask, and seeing how easy it is to spin up an app and start
>> responding to requests.
>>
>> ChrisA
>
> Yes, "django" indeed seems to be a good solution - But I am having a tough 
> time understanding how to set it up :( ...
>
> All I need is a simple example (say in django) with explicit directions 
> "django for dummies" - that shows how to set it up - access is using http(s) 
> and execute on the server/ubuntu ... I have indeed looked far and wide for 
> the "simplest" example in django I can learn from/adapt ... it is something I 
> have struggled with for sure ... (number crunching is what I do know, UI's 
> are strange to me!)

There are some great Django tutorials out there; I believe the Django
Girls tutorial is a great one (whether you're a girl or not):

https://tutorial.djangogirls.org/en/

Alternatively, Flask tends to be simpler to set up than Django is.
Here's a simple app I built a while ago that uses Flask:

https://github.com/Rosuav/Flask1

As you can see, all the code resides in a single file. (That's not how
I would structure a full-size app, but for what you're doing here, it
would be fine.) You don't need to worry about WSGI or anything, just
run your program directly; when it hits app.run() down the bottom,
it'll process requests until you halt it with Ctrl-C.

The Web is an important part of today's world, and time spent getting
familiar with the use of a web browser as your UI is time well spent.
You should be able to master this in a weekend, I would guess.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Transitioning from Linux to Windows

2017-06-03 Thread justin walters
On Jun 3, 2017 7:28 AM,  wrote:

On Saturday, June 3, 2017 at 8:50:27 AM UTC-5, Chris Angelico wrote:

> Hmm. ISTM the easiest way would be to run an explicit server, probably
> HTTP (hence Django as you mentioned), and then you can have people
> access it using a client on Windows. With HTTP, that client would
> simply be a web browser. I would advise picking up a quick tutorial on
> Django or Flask, and seeing how easy it is to spin up an app and start
> responding to requests.
>
> ChrisA

Yes, "django" indeed seems to be a good solution - But I am having a tough
time understanding how to set it up :( ...

All I need is a simple example (say in django) with explicit directions
"django for dummies" - that shows how to set it up - access is using
http(s) and execute on the server/ubuntu ... I have indeed looked far and
wide for the "simplest" example in django I can learn from/adapt ... it is
something I have struggled with for sure ... (number crunching is what I do
know, UI's are strange to me!)
--
https://mail.python.org/mailman/listinfo/python-list


Lucky for you!

I work with django almost every single day!

The best place to get started is the official tutorial.
https://docs.djangoproject.com/en/1.11/intro/tutorial01/


Or should take a couple of hours to get through it, but it will teach you
all the basics.

After that, you want to learn how to set up gunicorn to serve a local unix
socket. Then you need to set up nginx to proxy all requests to that socket.
You can use certbot with letsencrypt dor ssl.

Alternatively, i believe heroku has a prebuilt django deployment you can
use.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Transitioning from Linux to Windows

2017-06-03 Thread chitturk
On Saturday, June 3, 2017 at 8:50:27 AM UTC-5, Chris Angelico wrote:

> Hmm. ISTM the easiest way would be to run an explicit server, probably
> HTTP (hence Django as you mentioned), and then you can have people
> access it using a client on Windows. With HTTP, that client would
> simply be a web browser. I would advise picking up a quick tutorial on
> Django or Flask, and seeing how easy it is to spin up an app and start
> responding to requests.
> 
> ChrisA

Yes, "django" indeed seems to be a good solution - But I am having a tough time 
understanding how to set it up :( ... 

All I need is a simple example (say in django) with explicit directions "django 
for dummies" - that shows how to set it up - access is using http(s) and 
execute on the server/ubuntu ... I have indeed looked far and wide for the 
"simplest" example in django I can learn from/adapt ... it is something I have 
struggled with for sure ... (number crunching is what I do know, UI's are 
strange to me!) 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Transitioning from Linux to Windows

2017-06-03 Thread Chris Angelico
On Sat, Jun 3, 2017 at 11:44 PM,   wrote:
> Ideally, I would like to set up the user on their Windows 7/10 system so that 
> they can "login" to the ubuntu system (say putty) - change working directory 
> (to where desired) - run the script (on the ubuntu system) - and scp the file 
> back to the windows desktop.
>
> ("porting" the ubuntu script to anaconda(3) on the windows desktop IS 
> possible (but it has not been as easy as I had hoped!) (django and programs 
> like that do seem to provide a "GUI" to have python scripts run on 
> ubuntu/systems - but the setup looks mysterious/complicated (to me anyway))
>

Hmm. ISTM the easiest way would be to run an explicit server, probably
HTTP (hence Django as you mentioned), and then you can have people
access it using a client on Windows. With HTTP, that client would
simply be a web browser. I would advise picking up a quick tutorial on
Django or Flask, and seeing how easy it is to spin up an app and start
responding to requests.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Transitioning from Linux to Windows

2017-06-03 Thread chitturk
I am looking for suggestions, ideas.

I have developed python (3.6.x, 2.7.x) scripts that run well as a user on an 
ubuntu/16.04 system - the scripts look for files, parses the files, assembles 
an output for the user.

I first cd into a particular directory on the system (where I know the files 
exist) and run the script - the final result is in my working directory.

What I am now trying to do is ... figure out the least painful way to have 
other users do the same - BUT sitting in front of a Windows desktop (7 or 10).

Ideally, I would like to set up the user on their Windows 7/10 system so that 
they can "login" to the ubuntu system (say putty) - change working directory 
(to where desired) - run the script (on the ubuntu system) - and scp the file 
back to the windows desktop.

("porting" the ubuntu script to anaconda(3) on the windows desktop IS possible 
(but it has not been as easy as I had hoped!) (django and programs like that do 
seem to provide a "GUI" to have python scripts run on ubuntu/systems - but the 
setup looks mysterious/complicated (to me anyway))

I stumbled onto "paramiko" - is that a possible answer?  

Any suggestion/ideas would be greatly appreciated!

(I am perfectly willing to stick to 3.6.x, unless there is a clean/easy
solution using 2.7.x)

krishnan
-- 
https://mail.python.org/mailman/listinfo/python-list