Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: pytest loop through multiple tests?
Post: pytest loop through multiple tests?

I'm trying to convert some code I have to loop through and check an array of hostnames with pytest. I'm getting a chicken-and-egg problem, where the test function is complaining about values not being...
burvil General Coding Help 0 4,330 Sep-26-2019, 11:42 PM
    Thread: LDAP code to query for host not returning data
Post: RE: LDAP code to query for host not returning data

I was able to parse and get the information I need by parsing ldap_dump as follows: while l: result_type, result_data = l.result(ldap_dump, 0) if (result_data == [] )...
burvil General Coding Help 2 3,785 Oct-17-2018, 10:03 PM
    Thread: LDAP code to query for host not returning data
Post: RE: LDAP code to query for host not returning data

I changed the initialization to a more verbose loglevel: l = ldap.initialize(uri, trace_level=4, trace_file=sys.stderr) added this to try block: l.set_option(ldap.OPT_REFERRALS, 0) I also added on...
burvil General Coding Help 2 3,785 Oct-16-2018, 01:28 AM
    Thread: LDAP code to query for host not returning data
Post: LDAP code to query for host not returning data

I’m having an issue where the python-ldap module is returning no results, even though I am able to get results through other methods. I use the same parameters as ldapsearch, but the python code turn...
burvil General Coding Help 2 3,785 Oct-10-2018, 09:50 PM
    Thread: Why is ssh connecting but giving no output?
Post: RE: Why is ssh connecting but giving no output?

Updated working code below. Primary reason is stdin is spelled wrong above. ##################################################### # IN: hostname to connect to, username to connect as, string of com...
burvil Networking 2 9,741 Oct-04-2018, 10:08 PM
    Thread: Why is ssh connecting but giving no output?
Post: Why is ssh connecting but giving no output?

I have the code below that runs without errors, but doesn't seem to give any output after establishing the connection, nor after running exec_command to execute the command. Any thoughts on why that ...
burvil Networking 2 9,741 Oct-02-2018, 11:44 PM
    Thread: Libraries needed for python install?
Post: RE: Libraries needed for python install?

Thanks. I ended up getting the libraries I needed from the Satellite server. But I'll keep pyenv in mind.
burvil General Coding Help 7 20,166 Oct-18-2017, 04:55 AM
    Thread: Pip install for mysqlclient not working
Post: Pip install for mysqlclient not working

I'm trying to install the mysqlclient with Pip, and get an error as follows. $ pip3.4 install mysqlclient Downloading/unpacking mysqlclient Downloading mysqlclient-1.3.12.tar.gz (89kB): 89kB downl...
burvil General Coding Help 4 50,749 Oct-17-2017, 08:47 PM
    Thread: Libraries needed for python install?
Post: RE: Libraries needed for python install?

I ended up getting our Satellite server updated with the latest RPMs, which solved my dependencies and this problem.
burvil General Coding Help 7 20,166 Oct-17-2017, 08:35 PM
    Thread: Libraries needed for python install?
Post: RE: Libraries needed for python install?

I get the following errors which prevent install when I run: yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-d...
burvil General Coding Help 7 20,166 Oct-02-2017, 05:35 PM
    Thread: Libraries needed for python install?
Post: Libraries needed for python install?

I'm getting the following when trying to install Python 3.6.2 on RHEL 6.7/ CentOS 6.7: Python build finished successfully! The necessary bits to build these optional modules were not found: _lzma ...
burvil General Coding Help 7 20,166 Sep-30-2017, 05:15 PM
    Thread: # of Positional arguments to pass for creating an object?
Post: RE: # of Positional arguments to pass for creating...

Thanks. I double checked my reference; I was using https://stackoverflow.com/questions/2466...-in-python as a model. I matched the syntax, and it works now.
burvil General Coding Help 2 3,852 Sep-09-2017, 06:43 PM
    Thread: # of Positional arguments to pass for creating an object?
Post: # of Positional arguments to pass for creating an ...

I'm getting an error when trying to instantiate a class, where I pass two arguments, and the third one (for self) is implicit. When I only pass in one variable (hostname), it runs, but doesn't pass in...
burvil General Coding Help 2 3,852 Sep-09-2017, 04:56 AM
    Thread: 'str' object is not callable
Post: RE: 'str' object is not callable

Thanks! Replacing that worked.
burvil General Coding Help 2 26,304 Sep-07-2017, 01:17 AM
    Thread: 'str' object is not callable
Post: 'str' object is not callable

I'm having issues with my code where I'm getting 'str' object is not callable error, but I'm not assigning anything to str, and the rest of the variable assignments look right. Likewise, parentheses ...
burvil General Coding Help 2 26,304 Sep-06-2017, 11:31 PM
    Thread: Additional slashes being added to string
Post: RE: Additional slashes being added to string

Yes, I know the slash is a special character, and needs to be escaped. However, I'm not wanting to escape it; rather, I'm using it to escape the period in the domain name that it precedes. What's ha...
burvil General Coding Help 8 13,886 Aug-03-2017, 07:41 PM
    Thread: Additional slashes being added to string
Post: RE: Additional slashes being added to string

So, anybody know what the full rule is? It seems that whenever the string is assigned as an element in a dictionary, python adds an extra slash to '\.' to make '\\.'. I know this can't be just a re...
burvil General Coding Help 8 13,886 Aug-03-2017, 01:49 AM
    Thread: Additional slashes being added to string
Post: RE: Additional slashes being added to string

OK, thanks. So I take it that in certain circumstances, i.e. if it's printed or writing to a file, there may appear two slashes, but there is really only one in memory? Most of all, I'm trying to fig...
burvil General Coding Help 8 13,886 Aug-02-2017, 02:40 AM
    Thread: Additional slashes being added to string
Post: Additional slashes being added to string

I have the following code, where I have the variable domain_with_escapes the way I want it. When I add it as part of a value in a dictionary, there are additional slashes that are getting added, and ...
burvil General Coding Help 8 13,886 Aug-01-2017, 05:21 AM

User Panel Messages

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