how to generate structure file from blast results of an input sequence
If you the DNA/RNA crystal structure:

Simply change the nt in NCBIWWW.qblast("blastn", "nt", sequence_data) to pdbnt to get the nucleotide sequence in a chain.
The PDB code will be the accession ID with an underscore plus chain letter.
Do note that the PDB structure may be offset.

If you want the crystal structures of the encoded protein:

blastx (translation) on the pdbaa database. As above the PDB code will be as above.

If you want a model of the encoded protein:

Check Swissmodel for a pre-existing close threaded model, else check out I-Tasser (best), Phyre (fast).

If you want a model of the DNA/RNA:

You are running blast without special settings —its not a short motif—, so these things may be long, so do be weary of any result. There are a few RNA folding prediction tools online (e.g. RNAFold).