Issue in parsing the strings in python code

2018-11-12 Thread srinivasan
Dear Python Experts team, This question might be very simple for you, As am newbie to python, could you please how to parse the below strings 1. Could you please do the needful in guiding me, that how can I extract the strings under the UUID column in python code in the below output (nmcli c show

Re: Issue in parsing the strings in python code

2018-11-12 Thread Shakti Kumar
On Mon, 12 Nov 2018 at 14:02, srinivasan wrote: > Dear Python Experts team, > > This question might be very simple for you, As am newbie to python, could > you please how to parse the below strings > > 1. Could you please do the needful in guiding me, that how can I extract > the strings under th

Re: Issue in parsing the strings in python code

2018-11-12 Thread Thomas Jollans
On 12/11/2018 09:28, srinivasan wrote: > Dear Python Experts team, > > This question might be very simple for you, As am newbie to python, could > you please how to parse the below strings > > [snip] > > > root:~/qa/robot_tests# nmcli c show Pro tip: many *nix tools have a flag that makes them

Re: Issue in parsing the strings in python code

2018-11-12 Thread srinivasan
Hi Thomas, Great to hear from you, Could you please let me know how do I get the UUID "1da7d068-4548-4446-bf88-a440e49db1b1" by passing the name of the SSID "Funkloch' using "nmcli --terse" ?? Many thanks in advance, Srini On Mon, Nov 12, 2018 at 9:59 AM Thomas Jollans wrote: > On 12/11/2018 0

Re: Issue in parsing the strings in python code

2018-11-12 Thread srinivasan
Because the problem is every time when ever I see the output using the "nmcli c show", the below output is the weird output, so instead of connecting to SSID "NIFunkloch" it randomly connects to "NIFunkloch 1552" or sometimes to NIFunkloch 1000" or so on root:~/qa/robot_tests# nmcli c show NAME

Re: Issue in parsing the strings in python code

2018-11-12 Thread Thomas Jollans
On 2018-11-12 10:23, srinivasan wrote: > Hi Thomas, > > Great to hear from you, Could you please let me know how do I get the UUID > "1da7d068-4548-4446-bf88-a440e49db1b1" by passing the name of the SSID > "Funkloch' using "nmcli --terse" ?? Have a look at the output. It appears to me that the f

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-12 Thread Anssi Saari
Chris Angelico writes: > On Fri, Nov 9, 2018 at 11:11 PM Anssi Saari wrote: >> >> Chris Angelico writes: >> >> > No helper needed. Safe against command injection. Uses the known >> > format of the command's output; if you want other information as well >> > as the type, you could get that too.

IDLE Default Working Directory

2018-11-12 Thread Christman, Roger Graydon
Could anyone tell me how to set up IDLE's default working directory, so that it would be in the same place for each startup? (Like C:\Users\myname\Python) I teach a course that mounts a lot of file space across the network and the default directory for all my students is a readonly directory,

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-12 Thread Chris Angelico
On Mon, Nov 12, 2018 at 11:20 PM Anssi Saari wrote: > > Chris Angelico writes: > > > On Fri, Nov 9, 2018 at 11:11 PM Anssi Saari wrote: > >> > >> Chris Angelico writes: > >> > >> > No helper needed. Safe against command injection. Uses the known > >> > format of the command's output; if you wan

Re: Issue in parsing the strings in python code

2018-11-12 Thread Rhodri James
On 12/11/2018 09:37, srinivasan wrote: Because the problem is every time when ever I see the output using the "nmcli c show", the below output is the weird output, so instead of connecting to SSID "NIFunkloch" it randomly connects to "NIFunkloch 1552" or sometimes to NIFunkloch 1000" or so on r

Re: Issue in parsing the strings in python code

2018-11-12 Thread Brian Oney via Python-list
On Mon, 2018-11-12 at 14:17 +, Rhodri James wrote: > On 12/11/2018 09:37, srinivasan wrote: > > Because the problem is every time when ever I see the output using the > > "nmcli c show", the below output is the weird output, so instead of > > connecting to SSID "NIFunkloch" it randomly connect

Re: IDLE Default Working Directory

2018-11-12 Thread eryk sun
On 11/12/18, Christman, Roger Graydon wrote: > > I looked in IDLE's own configuration menu, and didn't see anything there -- > and I fear that I might have to fight some Windows settings somewhere else > instead. I think this is Windows 10. Modify the "Start in" field of the IDLE shortcut. You

Re: IDLE Default Working Directory

2018-11-12 Thread Bev in TX
On Nov 12, 2018, at 9:16 AM, eryk sun wrote: > > On 11/12/18, Christman, Roger Graydon mailto:d...@psu.edu>> > wrote: >> >> I looked in IDLE's own configuration menu, and didn't see anything there -- >> and I fear that I might have to fight some Windows settings somewhere else >> instead. I t

Re: IDLE Default Working Directory

2018-11-12 Thread Brian Oney via Python-list
On Mon, 2018-11-12 at 09:35 -0600, Bev in TX wrote: > On Nov 12, 2018, at 9:16 AM, eryk sun wrote: > > On 11/12/18, Christman, Roger Graydon mailto:d...@psu.edu>> > > wrote: > > > I looked in IDLE's own configuration menu, and didn't see anything there > > > -- > > > and I fear that I might have

Re: IDLE Default Working Directory

2018-11-12 Thread Christman, Roger Graydon
eryk sun responded: On 11/12/18, Christman, Roger Graydon wrote: > > I looked in IDLE's own configuration menu, and didn't see anything there -- > and I fear that I might have to fight some Windows settings somewhere else > instead. I think this is Windows 10.

Re: IDLE Default Working Directory

2018-11-12 Thread eryk sun
On 11/12/18, Christman, Roger Graydon wrote: > eryk sun responded: > > On 11/12/18, Christman, Roger Graydon wrote: >> >> I looked in IDLE's own configuration menu, and didn't see anything there >> -- >> and I fear that I might have to fight some Windows settings

Unable to get the gateway IP of wlan interface using python code

2018-11-12 Thread srinivasan
Dear Python Experts, *First method:* I need to get the IP address basically the gateway IP in my setup I get it as "192.168.178.1" when I run the below standalone python code. *def get_gateway_ip(self):* *"""* *Get the IP address to the WIFI module from the AP* *

Re: Issue in parsing the strings in python code

2018-11-12 Thread srinivasan
Hi Thomas, I have Implemented as below, please let me know if you forsee any issues in the below code snippet?as I have just started learning python from last week def wifi_connect_verify(self): """ Verify Connectivity of WIFI module to the Access. :return: c

Re: Unable to get the gateway IP of wlan interface using python code

2018-11-12 Thread MRAB
On 2018-11-12 19:37, srinivasan wrote: Dear Python Experts, [snip] *SECOND METHOD:* When I use the subprocess I see the below issue: def get_gateway_ip(self): """ Get the IP address to the WIFI module from the AP """ #cmd = 'ip route show 0.0.

passing value from Python3 script back to RewriteMap MapType prg in Apache24

2018-11-12 Thread Benedikt Kroll
Hi, using a Python script as a Rewrite Map with MapType prg in Apache 2.4, I'm having trouble passing the value back to Apache. The log says "map lookup OK", but the value is empty. According to the Apache documentation (https://httpd.apache.org/docs/current/rewrite/rewritemap.html#prg), the

distribute python interpreter and dependencies

2018-11-12 Thread Juan Cristóbal Quesada
Hello, this is my first mail. I resorted to the list after some prior struggling. Im facing the need to distribute a python installation folder and interpreter in a shared network drive. Im also distributing the application's source code that would lie also in another network drive. For this, my

Re: Anyone running Python on MS Azure?

2018-11-12 Thread Cris Medina
The python azure lib that MS maintains wraps all Azure services like boto3 does for AWS. However, be prepared for constant changes that are incompatible across versions. They do provide a mechanism for you to stick with an API version for backwards compatibility that allows an upgrade of the python

Re: passing value from Python3 script back to RewriteMap MapType prg in Apache24

2018-11-12 Thread MRAB
On 2018-11-12 09:39, Benedikt Kroll wrote: Hi, using a Python script as a Rewrite Map with MapType prg in Apache 2.4, I'm having trouble passing the value back to Apache. The log says "map lookup OK", but the value is empty. According to the Apache documentation (https://httpd.apache.org/doc

Re: IDLE Default Working Directory

2018-11-12 Thread Terry Reedy
On 11/12/2018 2:28 PM, eryk sun wrote: On 11/12/18, Christman, Roger Graydon wrote: eryk sun responded: On 11/12/18, Christman, Roger Graydon wrote: I looked in IDLE's own configuration menu, and didn't see anything there -- and I fear that I might have to f

Re: IDLE Default Working Directory

2018-11-12 Thread Terry Reedy
On 11/12/2018 10:35 AM, Bev in TX wrote: On Nov 12, 2018, at 9:16 AM, eryk sun wrote: On 11/12/18, Christman, Roger Graydon mailto:d...@psu.edu>> wrote: I looked in IDLE's own configuration menu, and didn't see anything there -- and I fear that I might have to fight some Windows settings so

Re: distribute python interpreter and dependencies

2018-11-12 Thread Thomas Jollans
On 12/11/2018 17:40, Juan Cristóbal Quesada wrote: > Hello, > this is my first mail. I resorted to the list after some prior struggling. Welcome! > Im facing the need to distribute a python installation folder and > interpreter in a shared network drive. > > Im also distributing the application'

Re: IDLE Default Working Directory

2018-11-12 Thread Thomas Jollans
On 13/11/2018 00:45, Terry Reedy wrote: > > On Windows, a simple alternate is a .bat file.  I belive the folloiwing > should work. > > cd c:/desired/startup/directory > py -x.y -m idlelib > > The default for x.y is latest 3.x or latest 2.x if no 3.x. Correct me if I'm wrong, but won't that crea

Re: IDLE Default Working Directory

2018-11-12 Thread Terry Reedy
On 11/12/2018 7:15 PM, Thomas Jollans wrote: On 13/11/2018 00:45, Terry Reedy wrote: On Windows, a simple alternate is a .bat file.  I belive the folloiwing should work. cd c:/desired/startup/directory py -x.y -m idlelib The default for x.y is latest 3.x or latest 2.x if no 3.x. Correct me

Re: Unable to get the gateway IP of wlan interface using python code

2018-11-12 Thread Cameron Simpson
On 12Nov2018 21:17, MRAB wrote: On 2018-11-12 19:37, srinivasan wrote: When I use the subprocess I see the below issue: def get_gateway_ip(self): [...] p = subprocess.Popen('ip route show 0.0.0.0/0 dev wlp1s0 | cut -d\ -f3', stdout=subprocess.PIPE) [...] root:~/qa/test_

Re: IDLE Default Working Directory

2018-11-12 Thread eryk sun
On 11/12/18, Thomas Jollans wrote: > On 13/11/2018 00:45, Terry Reedy wrote: >> >> On Windows, a simple alternate is a .bat file. I belive the folloiwing >> should work. >> >> cd c:/desired/startup/directory >> py -x.y -m idlelib >> >> The default for x.y is latest 3.x or latest 2.x if no 3.x. >

Re: [Tutor] Unable to get the gateway IP of wlan interface using python code

2018-11-12 Thread David Rock
> On Nov 12, 2018, at 13:37, srinivasan wrote: > > Dear Python Experts, > > *First method:* > > I need to get the IP address basically the gateway IP in my setup I get it > as "192.168.178.1" when I run the below standalone python code. Is there a requirement to use only what comes in the sta

Re: [Tutor] Unable to get the gateway IP of wlan interface using python code

2018-11-12 Thread Bill Campbell
On Tue, Nov 13, 2018, srinivasan wrote: >Dear Python Experts, > >*First method:* > >I need to get the IP address basically the gateway IP in my setup I get it >as "192.168.178.1" when I run the below standalone python code. > > >*def get_gateway_ip(self):* >*"""* >*Get the I

Re: Unable to get the gateway IP of wlan interface using python code

2018-11-12 Thread Wildman via Python-list
I tried posting this already but it didn't make it. I am trying again... On Tue, 13 Nov 2018 01:07:06 +0530, srinivasan wrote: > Dear Python Experts, > > *First method:* > > I need to get the IP address basically the gateway IP I am assuming your platform is Linux. If I am incorrect then ign

Re: [Tutor] Unable to get the gateway IP of wlan interface using python code

2018-11-12 Thread Michael Torrie
On 11/12/2018 05:55 PM, David Rock wrote: > Is there a requirement to use only what comes in the standard libraries, or > can you use things from pypi? > Getting interface details is exactly why netifaces was created > > https://pypi.org/project/netifaces/ Also if working with NetworkManager is

Re: passing value from Python3 script back to RewriteMap MapType prg in Apache24

2018-11-12 Thread dieter
Benedikt Kroll writes: > Hi, > > using a Python script as a Rewrite Map with MapType prg in Apache 2.4, I'm > having trouble > passing the value back to Apache. > > The log says "map lookup OK", but the value is empty. > > According to the Apache documentation > (https://httpd.apache.org/docs/