Feb-02-2024, 06:21 PM
(This post was last modified: Feb-02-2024, 07:22 PM by deanhystad.)
Hello, everyone. I am new to Python and recently I tried to write a script inside the Python shell of my Windows 11 computer, in order to combine different spreadsheets; though when I run it I receive a syntax error, and I do not know why. Your help in solving this would be appreciated. I am running Python 3.12.1; and this is the code that I wrote:
import os import pandas as pd data_file_folder= "C:/Users/Py/Documents/Work/Portfolio" df= [] for file in os.listdir(data_file_folder): if file.endswith(".xlsx"): print("Python at work {0}...".format(file)) df.append(os.path.join(data_file_folder, file), sheet_name="data"))
deanhystad write Feb-02-2024, 07:22 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.