Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Post Request containing username/password using python for jwt
Post: RE: Post Request containing username/password usin...

Ooops... sorry for bothering you guys, got the solution, below code worked for me import requests url = "https://xx.23.105.xx:446/nmsnbi-rest/tapi/data/context/auth-context/auth-token" payload = {...
anna Networking 1 4,023 Oct-18-2022, 04:06 PM
    Thread: Post Request containing username/password using python for jwt
Post: Post Request containing username/password using py...

Hi All, I am trying to get token through requests with user and password, there one small javascript provided by Vendor (this was demo in postman). How can I send this script through API call to get ...
anna Networking 1 4,023 Oct-18-2022, 02:24 PM
    Thread: python3 regular expression.. support to improve
Post: python3 regular expression.. support to improve

Hi All, I am parsing below logs lines, regex is working, checked on online regex editor(https://regex101.com/), please lets know any suggestion. Working regex (re.search) ------------------ CAM ID...
anna General Coding Help 0 1,511 Jul-07-2020, 09:40 AM
    Thread: python realtime parsing logs
Post: RE: python realtime parsing logs

Hi All, @ibreeden - tried if 'string1' or 'string2' in line: still unwanted data was coming, as i want only 'New' and 'Clear' alarm, regex implemented. I am parsing ever growing log file from remot...
anna General Coding Help 2 2,846 Jul-05-2020, 06:36 AM
    Thread: python realtime parsing logs
Post: python realtime parsing logs

I am reading and parsing real time logs from remote server. I am getting huge logs and wanted to parse only New Alarm and Clear alarm. I have tried 'New Alarm' or 'Clear to Alarm' in line, but not wor...
anna General Coding Help 2 2,846 Jul-03-2020, 04:40 AM
    Thread: python3 emulate tail -f on remote server... support required
Post: python3 emulate tail -f on remote server... suppor...

Hi All, My source OS is Linux and destination OS Sunos. I am logging to remote server and tailing log file. my issue 1) I am not able to read tail data line by line 2) Lines are not being split as ...
anna General Coding Help 0 1,655 Jul-01-2020, 06:42 AM
    Thread: threading for method outside class
Post: threading for method outside class

Hi All, I have modified original script to work with ZyXEL DSLAM devices, need to guidance to implement threading for method of class but outside of the class import threading import sys import os ...
anna General Coding Help 0 1,397 Nov-17-2019, 07:05 AM
    Thread: class AttributeError:
Post: RE: class AttributeError:

got the solutions... working on the same.
anna General Coding Help 2 1,767 Nov-02-2019, 11:30 AM
    Thread: class AttributeError:
Post: class AttributeError:

Hi All, I am polling Nokia Router device for port optical details through snmp. This router is having 52 ports, all details will be fetched if port status in operational. currently returning few deta...
anna General Coding Help 2 1,767 Nov-02-2019, 07:51 AM
    Thread: first try with python class, suggestion for improvement please
Post: RE: first try with python class, suggestion for im...

Thanks, Yoriz,Gribouillis,ichabod801,buran got some knowledge on Class, method.
anna General Coding Help 18 5,938 Nov-01-2019, 11:16 AM
    Thread: first try with python class, suggestion for improvement please
Post: RE: first try with python class, suggestion for im...

(Oct-27-2019, 05:06 PM)Gribouillis Wrote: I don't understand the output that you want. Obviously the method already returns a dict. but i want return dict values from class itself, instead of conver...
anna General Coding Help 18 5,938 Oct-27-2019, 05:37 PM
    Thread: first try with python class, suggestion for improvement please
Post: RE: first try with python class, suggestion for im...

thanks,Gribouillis and all admin and moderator Changed code, its working for me, but having small question, how can I can parse data inside class and return dict. from easysnmp import Session impor...
anna General Coding Help 18 5,938 Oct-27-2019, 04:07 PM
    Thread: first try with python class, suggestion for improvement please
Post: RE: first try with python class, suggestion for im...

thanks, got some idea... will let you know.
anna General Coding Help 18 5,938 Oct-27-2019, 01:57 PM
    Thread: first try with python class, suggestion for improvement please
Post: RE: first try with python class, suggestion for im...

Thanks, something is going wrong and not able to understand, if I am accessing class in loop and get class method variable values. from easysnmp import Session import time from datetime import dateti...
anna General Coding Help 18 5,938 Oct-27-2019, 08:13 AM
    Thread: first try with python class, suggestion for improvement please
Post: RE: first try with python class, suggestion for im...

is this way? class host: fan_speed = { '0':'Not Applicable', '1':'Unknown', '2':'Half Speed', '3':'Full Speed', '4':'Low S...
anna General Coding Help 18 5,938 Oct-27-2019, 06:10 AM
    Thread: first try with python class, suggestion for improvement please
Post: RE: first try with python class, suggestion for im...

still struggling
anna General Coding Help 18 5,938 Oct-26-2019, 03:27 PM
    Thread: first try with python class, suggestion for improvement please
Post: RE: first try with python class, suggestion for im...

sorry.. changed as suggested. # return fan speed and parameter will be oid value def get_fan_speed(self, value): return self.fan_speed.get(value,"other") #return fan sta...
anna General Coding Help 18 5,938 Oct-26-2019, 11:12 AM
    Thread: first try with python class, suggestion for improvement please
Post: RE: first try with python class, suggestion for im...

thanks, some changes done 1) try/except taken out of class 2) comments are added whenever required but getting error from easysnmp import Session import time from datetime import datetime import d...
anna General Coding Help 18 5,938 Oct-26-2019, 05:04 AM
    Thread: first try with python class, suggestion for improvement please
Post: first try with python class, suggestion for improv...

Hi All, this is my first script with python class. Thanks all forum admin. I have few questions 1) is it good practice to have multiple class in single script? 2) how can i return converted values w...
anna General Coding Help 18 5,938 Oct-24-2019, 11:03 AM
    Thread: namedtuple help
Post: RE: namedtuple help

Hi Buran, is there another way? I am following below post, assigning value to variable before print. https://python-forum.io/Thread-how-to-co...5#pid41095 regards Anna
anna General Coding Help 5 2,765 Oct-19-2019, 04:51 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020