php


UnicodeEncodeError: 'ascii' codec can't encode characters in position 360-362: ordinal not in range(128)


I tried running python via PHP I kept getting
UnicodeEncodeError: 'ascii' codec can't encode characters in position 360-362: ordinal not in range(128)
I tried
php
$command = "python ".public_path().'/python/start_clientsim.py 2>&1';
$result = exec($command);
python (start_clientsim.py)
import paramiko
import time
import sys
import os
import pdb
# Note
# sudo pip install --user paramiko
ip = "172.1.1.1"
un = "root"
pw = "123"
key_filename='/Users/keys/id_rsa'
def ssh_con (ip, un, pw):
global ssh
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(ip, username=un, password=pw, key_filename=key_filename)
def cmd_io (command):
global ssh_cmd
ssh_cmd.send("%s \n" %command)
time.sleep(1)
output = ssh_cmd.recv(10000).decode("utf-8")
print (output)
ssh_con(ip,un,pw)
ssh_cmd = ssh.invoke_shell()
cmd_io("clientsim cli")
cmd_io("start subscriber-group dth-sub start-traffic udp")
cmd_io("exit")

Related Links

PHP explode function takes in more than 1 whitespace, PHP, EXPLODE, WHITESPACES
PHP json_encode() vs empty NSDictionary
How to select two tables and determine if the data is < or =
Optimize MySQL code
Why doesn't this work? PHP random bg image CSS. Laravel Slim Twig
Pass Variable to Register Sidebar?
Doctrine DBAL prepared query
PHPExcel Display Charts not working
Compare current time with values in an array true/false
Passing IPPReferenceType for parentref but the still sub customer data is not adding up in Quickbook API online
WordPress - archive side list not linking correctly
PHP undefined class for config file
Can't install Mediawiki Extension?
Error undeclared variable when select using limit
How can i get output in oop program in php
Cakephp 3.0: rewrite .htaccess rule to allow new folder access?

Categories

HOME
nam
opencart
yii
d3.js
filesize
azure-data-lake
linker
tweepy
tfs2010
siesta
xades4j
xbap
outlook-restapi
sonata
fresco
twisted
kaggle
generator
channel
sybase-ase
nurbs
pubxml
tracing
high-availability
morris.js
bobo-browse.net
amazon-cloudtrail
spring-annotations
jsonresult
intune
google-play-developer-api
winsock
image-optimization
custom-keyboard
autoencoder
dreamfactory
des
landscape
bluemixtools
strapi
microsoft-ui-automation
ejml
hypothesis-test
haar-classifier
fluid-mac-app-engine
moinmoin
nuclio
dredd
embedded-v8
pen
mechanicalturk
kendo-treeview
annotatorjs
petsc
controllers
qtcpsocket
jtag
node-glob
swiffy
as3-api
jsr363
onepage-checkout
flush
django-validation
msgpack
juniper-network-connect
html.actionlink
lowercase
http.client
wlanapi
compositetype
mod-auth-openidc
dos2unix
string.format
n-tier-architecture
tabris
visual-c++-2012
nidaqmx
webmethod
two.js
screwturn
nodeload
tabletools
xmi
usb-flash-drive
lsa
progress-db
background-thread
live-wallpaper
jzmq
hardcode
wcf-callbacks
gwt-celltable
dynamic-c
expression-web
will-paginate
glassfish-esb
groovy-console
firefly-mv
fragment-identifier
gaelyk
mygeneration
getimagesize
suggestbox
community-server

Resources

Encrypt Message