from qiskit import *
from qiskit.quantum_info import Statevector
from math import pi

qc=QuantumCircuit(3)
qc.h(range(2))
qc.x(2)
qc.draw(output="mpl")

print(qc.qasm())

qc_qasm=qc.qasm(filename='sample.qasm')

print(qc_qasm)

qc1=qc.from_qasm_file("./sample.qasm")

qc1.draw(output="mpl")

qc2=qc.from_qasm_str(qc.qasm())

qc2.draw(output="mpl")