I might just be doing something very stupid, as I am pretty new to Python programming. I using Windows 10, and I am having issues getting a file to run with a double click or in a batch file. I have other python files that run fine with a double click and in batch files, but this very simple file does not run at all. I added in a print('Hello World') command and that comes up fine, but once I click enter the screen simply disappears.
The code that works in pycharm should be doing some web scraping and then saving an excel file, but since it didn't work with the double click I simplified it down to just creating an excel file and saving it, which also runs fine in pycharm, and that still doesn't work with a double click.
print("hello world")
input()
import pandas as pd
# Create the pandas DataFrame
df = pd.DataFrame([10, 20, 30, 40, 50, 60], columns=['Numbers'])
# Save File
writer = pd.ExcelWriter('test data.xlsx')
df.to_excel(writer, 'Test Data', index=False)
writer.save()`
PATH? Is it the version you expect? Does it have the required libraries installed (i.e.pandas)?.pyfile? Can you provide an example from how you're trying to use the script from a batch file? Have you tried running a simpleprint('hello world')script?try:thenexcept Exception as e:- print the error message and then callinput("press any key to terminate"). Then you'll have a better idea what went on.