Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bcp.exe console keep popping up when executing bcp.to_sql #204

Open
magicaly2 opened this issue Aug 18, 2024 · 1 comment
Open

bcp.exe console keep popping up when executing bcp.to_sql #204

magicaly2 opened this issue Aug 18, 2024 · 1 comment

Comments

@magicaly2
Copy link

magicaly2 commented Aug 18, 2024

i wrote a program and compiled it into .exe using nuitka with --windows-console-mode=disable
when i run the program, another console (from bcp.exe) keep popping up every time my code execute bcpandas.to_sql
how do i hide/not show the bcp.exe console?

my code:
bcpandas.to_sql(df, schema=schema, table_name=table_name, creds=creds, index=False, if_exists='append', print_output=False, encoding=encoding)

note:
when i run my code in visual studio code, i dont see bcp.exe console

@magicaly2
Copy link
Author

magicaly2 commented Aug 18, 2024

after some research, it seems like we can use creationflags from subprocess when executing cmd.
is there already a way to achieve something like this that i missed?

in run_cmd:

from subprocess import CREATE_NO_WINDOW
proc = Popen(
cmd,
stdout=PIPE,
stderr=STDOUT,
encoding="utf-8",
errors="utf-8",
shell=with_shell,
creationflags=CREATE_NO_WINDOW -- add this
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant