Skip to content

Instantly share code, notes, and snippets.

View nnnolan's full-sized avatar
🌟
college student

nnnolan

🌟
college student
View GitHub Profile
#quick fix for export pdf's still having the extension, we don't want that
directory = os.fsencode(os.path.join("exports"))
for file in os.listdir(directory):
filename = os.fsdecode(file)
if filename.endswith(".pdf"): #filename.pdf
os.rename(os.path.join("exports", filename), os.path.join("exports", filename.split(".")[0]))
if filename.endswith(")"): #filename.pdf(1)
@nnnolan
nnnolan / xml_editor.py
Last active March 7, 2023 14:00
xml editor for spring api, allows for the bean name to be changed dynamically and updates a process-conf
import os
import shutil
import xml.etree.ElementTree as ET
import subprocess
import pandas as pd
def xml_editor(beanname: str, dataframe: pd.DataFrame, id_column_name: str):
"""This function edits the process-conf.xml file to change the filter of the beanname passed in.
It then runs the process.bat file to run the beanname passed in."""
for i in lines:
print(f"i: {i}") // i: 72-77,20-77
split = i.split(",")
print(f"split: {split}") // split: ['72-77', '20-77']
print(len(split)) // 2
print(type(split)) // <class 'list'>
print(split[0]) // 72-77
![guestbook](https://user-images.githubusercontent.com/89788103/148635288-42a736b5-82d8-4c59-90d4-2e9163eb8ab4.gif)
sign here :D
guestbook