I have this password generator:
from random import sample
character = '!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{}~'
print(''.join(sample(character, 10)))
Example output: bvwy2%-?/N
However, I don't like it that the variable character is so long.
I got the content of character from this ASCII table:

I used every character except |.
My question is how can I shorten the content of character?
Something like this:
for i in range(33, 126):
    # get ASCII values ?
 
     
     
    