Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: [cryptography.io] How to convert DER signature to ECDSA
Post: RE: [cryptography.io] How to convert DER signature...

In the end I went for openssl with subprocess from codecs import getdecoder from re import findall from subprocess import Popen, PIPE with open('app.dat', 'rb') as dat_file: signable_content = d...
fstefanov General Coding Help 1 2,986 Jul-04-2019, 08:59 AM
    Thread: [cryptography.io] How to convert DER signature to ECDSA
Post: [cryptography.io] How to convert DER signature to ...

Hello all, According to cryptography.io documentation the signature for cryptography.hazmat.primitives.asymmetric.ec.ECDSA is a bytes object, whose contents is DER encoded and can be decoded using de...
fstefanov General Coding Help 1 2,986 Jul-02-2019, 09:27 PM
    Thread: Dashboards with html tables
Post: Dashboards with html tables

Hello folks, We are going to deprecate our Confluence instance soon. I was using a Python script to append HTML table, with static links to S3 artifacts on different Confluence Dashboards. Have to lo...
fstefanov Web Scraping & Web Development 2 2,095 May-08-2019, 02:31 AM
    Thread: unittest for nested function
Post: unittest for nested function

Hello all, Have to write couple unittests for nested function. This is simplified version def processSubscription(  self, command, **conditions ): def _matchCondition...
fstefanov General Coding Help 2 4,554 Oct-15-2018, 09:47 AM
    Thread: Replace slice in list comperhensions
Post: RE: Replace slice in list comperhensions

(Nov-06-2017, 03:29 AM)ineedastupidusername Wrote: This might be a little faster (''.join() is faster than + for strings I think): newlist=[''.join((b[0:-2],'2',b[-1])) for b in numbers if b[-2]=='1...
fstefanov General Coding Help 2 3,251 Nov-06-2017, 04:00 AM
    Thread: Replace slice in list comperhensions
Post: Replace slice in list comperhensions

Is there a better way of replacing [-2] position which is == '1' with '2'. numbers = ['10237310', '10230010'] newlist = [b[0:-2] + '2' + b[-1] for b in numbers if b[-2] == '1'] ['10237320', '10230020'...
fstefanov General Coding Help 2 3,251 Nov-06-2017, 01:48 AM
    Thread: Empty variable when using print before readline
Post: RE: Empty variable when using print before readlin...

Ahhh i see next invocation reads the next line. Never crossed my mind :) Thank you!
fstefanov General Coding Help 3 3,607 Oct-23-2017, 02:22 AM
    Thread: Empty variable when using print before readline
Post: Empty variable when using print before readline

Appreciate if someone can explain me why: **dodgy** with open('readme', 'r') as file_h:     print 'file content:', file_h.readline().strip()     content = file_h.readline().strip()     print 'from va...
fstefanov General Coding Help 3 3,607 Oct-22-2017, 10:51 PM
    Thread: requests digest auth with netrc
Post: RE: requests digest auth with netrc

Ok at this time Requests does not enable the use of Digest Auth with ~/.netrc So i came up with simple function do to the job for me def password_from_netrc(remote_url):    rec = re.compile(r"https?...
fstefanov Networking 1 4,699 Jun-05-2017, 08:40 PM
    Thread: requests digest auth with netrc
Post: requests digest auth with netrc

Hello, According to the documentation for requests: netrc Authentication If no authentication method is given with the auth argument, Requests will attempt to get the authentication credentials for ...
fstefanov Networking 1 4,699 Jun-05-2017, 12:43 AM
    Thread: more pythonic way
Post: RE: more pythonic way

Great, thank you all !!! This is my new version for now. sys.path.insert(0, './libs') from artifactory import ArtifactoryPath, md5sum, _ArtifactoryAccessor server = '192.168.10.2' server_url = 'http...
fstefanov Homework 8 6,076 Apr-24-2017, 05:15 PM
    Thread: more pythonic way
Post: more pythonic way

Hello all, I'm trying to improve my python skills and I made one small script and like to share it with you guys If someone can give me some remarks how to improve it and make it more Pythonic I'm e...
fstefanov Homework 8 6,076 Apr-24-2017, 06:57 AM

User Panel Messages

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