Prime power mathematical problem in Python
Welcome, there are some aspects to comment about.


First is that, you should use specific names for your functions pp is ok and sounds quite interesting, but it would be better if you use is_prime_power (as mentioned by Konrad Rudolph in the comments).
Now, for the first function, I would change only two things:

def is_prime_power(q):
    fact = factorint(q)
    p = int(list(fact.keys())[0])
    n = int(list(fact.values())[0])
    return q == p**n # this line asks 'is prime power?'

# could also be:
def is_prime_power(q):
    return q == int(list(fact.keys())[0])**int(list(fact.values())[0])
# but is quite strange because p,n are not specified.

# this inverses the boolean answer, as you see
    if q != p**n:
        return False
    else:
        return True

For the procedure, you should avoid using comparisons with True and False. If the value is a boolean, Python deduces if it is true or false, in the case of compare with False use not:

a = [1,6][-1]

b = a*2
d = 1
while d != 0:
    c = b-a
    if not is_prime_power(b) and is_prime_power(c):
        for i in range(b-1, c-1, -1):
            if i == c:
                d = 0
            elif is_prime_power(i):
                b = i+a
                break
    elif not is_prime_power(b):
        for i in range(b-1, c-1, -1):
            if i == c:
                b = b+a+1
            elif is_prime_power(i):
                b = i + a
                break
    elif is_prime_power(b):
        b = b+a
b



Well, thanks for writing easy to read code, it is so good to see something like it.