On 11/25/18 10:58 AM, srinivasan wrote:
> Even only with "*proc.decode("utf-8")"* in the above code still it seems to
> throw the error
>
> #return proc.strip().decode("utf-8")
> #return proc.decode("utf-8").strip()
> *return proc.decode("utf-8")*
>
> Error:
> /home/srinivasan/Downloa
On Mon, Nov 26, 2018 at 5:40 AM srinivasan wrote:
>
> Dear Karsten,
>
> With the help of Mrab Inputs, I tried Even with "return
> stdout.strip().decode("utf-8")", it still seems to be an issue, I am using
> python 3.6, is this causing a issue?
No, it isn't. Two things are causing most of your is
Dear Karsten,
With the help of Mrab Inputs, I tried Even with "return
stdout.strip().decode("utf-8")", it still seems to be an issue, I am using
python 3.6, is this causing a issue?
/home/srinivasan/Downloads/wifidisconnectissuenov23_homework/venv/bin/python
/home/srinivasan/Downloads/wifidiscon
Dear Mrab,
Even with "return stdout.strip().decode("utf-8")", it still seems to be an
issue, I am using python 3.6, is this causing a issue?
/home/srinivasan/Downloads/wifidisconnectissuenov23_homework/venv/bin/python
/home/srinivasan/Downloads/wifidisconnectissuenov23_homework/qa/test_library/t
Thanks a lot for your quick responses Mrab and appreciate the same.
I changed the snippet as below, still it seems to be an issue,
I am using python3 version:
def main(ssid, pw):
try:
cmd = "nmcli device wifi connect '%s' password '%s'" % (ssid, pw)
proc = subprocess.Popen(
> Even only with "*proc.decode("utf-8")"* in the above code still it seems to
> throw the error
No it does not. It throws the same TYPE of error due to the same
SORT of mistake you made.
You need to read carefully and try to think about what you read.
Karsten
--
https://mail.python.org/mailman/
On 2018-11-25 17:54, srinivasan wrote:
Hope now I have changed on the string output as below, could you
please correct me if am still wrong?
import sys
import subprocess
interface = "wlan0"
def main(ssid, pw):
try:
cmd = "nmcli device wifi connect '%s' password '%s'" % (ssid, pw
Even only with "*proc.decode("utf-8")"* in the above code still it seems to
throw the error
#return proc.strip().decode("utf-8")
#return proc.decode("utf-8").strip()
*return proc.decode("utf-8")*
Error:
/home/srinivasan/Downloads/wifidisconnectissuenov23_homework/venv/bin/python
/home
Hope now I have changed on the string output as below, could you please
correct me if am still wrong?
import sys
import subprocess
interface = "wlan0"
def main(ssid, pw):
try:
cmd = "nmcli device wifi connect '%s' password '%s'" % (ssid, pw)
proc = subprocess.Popen(cmd, st
On 2018-11-25 17:13, srinivasan wrote:
Dear Python Experts Team,
As am newbie still learning the python syntax from past 2 weeks, Excuse me,
If this might be silly question, As I am trying to execute shell command
(ie, nmcli) using "subprocess.Popen".
1. Am trying to improve the below code with
> Kindly do the needful as am stuck with this issue from 2 days
How about YOU do the needful and post code that can actually be tested.
Karsten
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, 25 Nov 2018 22:43:10 +0530, srinivasan wrote:
> Dear Python Experts Team,
>
> As am newbie still learning the python syntax from past 2 weeks, Excuse me,
> If this might be silly question, As I am trying to execute shell command
> (ie, nmcli) using "subprocess.Popen".
>
> *return pro
Dear Python Experts Team,
As am newbie still learning the python syntax from past 2 weeks, Excuse me,
If this might be silly question, As I am trying to execute shell command
(ie, nmcli) using "subprocess.Popen".
1. Am trying to improve the below code with "try" and "exception", could
you please
13 matches
Mail list logo