I'm connecting remotely to a server and executing script. I am also see the
output on my web2py page, but the problem is when I use view then instead
of aligning things in new lines I see "/n" and lines are not separated.
Pls let me know how can I get the actual new line instead of "/n"
characters.
BTW I'm new to web2py and web development.
Here is the controller code and view code.
-- Controller
def run_cmd():
import paramiko
import os
hostis = session.server_name
useris = session.user_name
passis = session.user_pass
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname=hostis , username=useris , password=passis )
stdin, stdout, stderr = ssh.exec_command("/opt/home/ggs/poc/t1 \"info
all\" /opt/home/ggs/ggs.env")
data = stdout.readlines()
return dict(data=data)
-- View
{{extend 'layout.html'}}
<h1>Welcome to my new app</h1>
<FONT FACE= "Courier New" COLOR='green'> {{=data}} </FONT>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.