Skip to content

Instantly share code, notes, and snippets.

@bswck
Last active June 22, 2024 19:39
Show Gist options
  • Save bswck/2766881fdbecf3ad0c39ed4f35b96a98 to your computer and use it in GitHub Desktop.
Save bswck/2766881fdbecf3ad0c39ed4f35b96a98 to your computer and use it in GitHub Desktop.
import pandas as pd
x = pd.DataFrame()
def pasted_function() -> None:
print("Hello world!")
from codewriter import Code, Import, Variable
code = Code()
pd = Import("pandas", alias="pd")
x = Variable("x")
x.value = pd.DataFrame()
code.write(x)
print(code)
#########################
code = Code()
def pasted_function() -> None:
print("Hello world!")
code.paste(pasted_function)
print(code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment