Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1077,7 +1077,7 @@ def save_file_to_hostinger(save_file_path):
|
|
1077 |
ftp_host = 'ftp.redmindtechnologies.com' # Replace with your FTP server address
|
1078 |
ftp_user = 'u852023448.redmindGpt' # Replace with your FTP username
|
1079 |
ftp_pass = 'RedMind@505' # Replace with your FTP password
|
1080 |
-
remote_file_path = '/
|
1081 |
|
1082 |
# Create an FTP connection
|
1083 |
ftp = FTP(ftp_host)
|
@@ -1107,8 +1107,18 @@ def handle_large_dataset(df):
|
|
1107 |
# 4. Add SNo (serial number) as the first column, starting from 1
|
1108 |
limited_data_without_first_column.insert(0, 'SNo', range(1, len(limited_data_without_first_column) + 1))
|
1109 |
# 3. Save the full dataset to a downloadable file
|
1110 |
-
|
1111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1112 |
# 4. Create a summary and table of the first 10 rows for display
|
1113 |
|
1114 |
columns = list(df.columns)
|
|
|
1077 |
ftp_host = 'ftp.redmindtechnologies.com' # Replace with your FTP server address
|
1078 |
ftp_user = 'u852023448.redmindGpt' # Replace with your FTP username
|
1079 |
ftp_pass = 'RedMind@505' # Replace with your FTP password
|
1080 |
+
remote_file_path = '/RedMindGPT/Output.xlsx' # Replace with the desired path on the server
|
1081 |
|
1082 |
# Create an FTP connection
|
1083 |
ftp = FTP(ftp_host)
|
|
|
1107 |
# 4. Add SNo (serial number) as the first column, starting from 1
|
1108 |
limited_data_without_first_column.insert(0, 'SNo', range(1, len(limited_data_without_first_column) + 1))
|
1109 |
# 3. Save the full dataset to a downloadable file
|
1110 |
+
# Get the current working directory
|
1111 |
+
current_directory = os.getcwd()
|
1112 |
+
|
1113 |
+
# Define the filename
|
1114 |
+
filename = 'output_data.xlsx'
|
1115 |
+
|
1116 |
+
# Create the complete path by joining the current directory with the filename
|
1117 |
+
file_path = os.path.join(current_directory, filename)
|
1118 |
+
|
1119 |
+
|
1120 |
+
df.to_excel(file_path, index=False)
|
1121 |
+
save_file_to_hostinger(file_path)
|
1122 |
# 4. Create a summary and table of the first 10 rows for display
|
1123 |
|
1124 |
columns = list(df.columns)
|