If only a few rows, you can create a pyodbc connection and run insert statements.
But if many rows, then a better way is to create a dataframe, and use dataframe.to_sql to write data in bulk back to the database.
Here it uses the sqlalchemy's engine as follow:
import sqlalchemy
import pandas as pd
user = 'xxx'
pwd = 'xxx'
db = 'database'
driver = 'SQL Server'
server = 'server url'
engine = sqlalchemy.create_engine(f'mssql+pyodbc://{user}:{pwd}@{server}/{db}?driver={driver}')
df = pd.DataFrame(data=[1], columns=['col'])
df.to_sql('test_table', engine, schema='dbo', if_exists='append', index=False)