diff --git a/Tools/css_beautifier.py b/Tools/css_beautifier.py new file mode 100644 index 0000000..a9675e5 --- /dev/null +++ b/Tools/css_beautifier.py @@ -0,0 +1,11 @@ +from yattag import indent +with open("E:/python/Tools/style.css", "r") as file: + data = file.read() + +result = indent( + data, + indentation=' ', + newline='\r\n', + indent_text=True +) +print(result) diff --git a/Tools/csv_to_pdf.py b/Tools/csv_to_pdf.py new file mode 100644 index 0000000..2aede6b --- /dev/null +++ b/Tools/csv_to_pdf.py @@ -0,0 +1,15 @@ +# program to convert CSV file into PDF file +from fpdf import FPDF +import csv + +with open("e:/python/tools/SampleData.csv", "r") as csv_file: + data = csv.reader(csv_file) + for row in data: + print(row) + + +pdf = FPDF(orientation='P', unit='mm', format='A4') # P -potrait L-Landscape +pdf.add_page() +pdf.set_font("Arial", size=12) +pdf.cell(200, 10, txt=str(data), ln=1, align="C") +pdf.output("simple_demo.pdf") diff --git a/Tools/html_beautifier.py b/Tools/html_beautifier.py new file mode 100644 index 0000000..99a292b --- /dev/null +++ b/Tools/html_beautifier.py @@ -0,0 +1,11 @@ +from yattag import indent +with open("E:/python/Tools/index.html", "r") as file: + data = file.read() + +result = indent( + data, + indentation=' ', + newline='\r\n', + indent_text=True +) +print(result) diff --git a/Tools/style.css b/Tools/style.css new file mode 100644 index 0000000..6b03f93 --- /dev/null +++ b/Tools/style.css @@ -0,0 +1,2 @@ +.underline {position: relative; margin-bottom:30px;} +.underline::after{ display: block; content: ''; width: 50px; height: 1px; background: #F27316; position: absolute;bottom: -15px;left: 0%;margin-bottom: ;} \ No newline at end of file diff --git a/Tools/tempCodeRunnerFile.py b/Tools/tempCodeRunnerFile.py new file mode 100644 index 0000000..e7bd741 --- /dev/null +++ b/Tools/tempCodeRunnerFile.py @@ -0,0 +1,21 @@ +# python program to convert any csv file into html file +# made by : rakesh kumar + +import csv +html = "" +with open("E:/python/Tools/SampleData.csv") as csv_file: + csv_data = csv.reader(csv_file) + count = 1 + for row in csv_data: + html += "" + if count == 1: + for y in row: + html += "" + else: + for y in row: + html += "" + html += "" + count += 1 + +html += "
"+y+""+y+"
" +print(html) \ No newline at end of file diff --git a/Tools/xml_beatifier.py b/Tools/xml_beatifier.py index 14b565d..83ca603 100644 --- a/Tools/xml_beatifier.py +++ b/Tools/xml_beatifier.py @@ -1,3 +1,11 @@ +from yattag import indent with open("E:/python/Tools/sample.xml", "r") as file: data = file.read() - print(data) + +result = indent( + data, + indentation=' ', + newline='\r\n', + indent_text=True +) +print(result)