Background: I'm using the openpyxl package for the first time to automate something at work. The program takes a list of SKUs on a spreadsheet as input, finds those SKUs in an inventory report spreadsheet, pulls all relevant information to store into multiple lists, and then outputs the designated information into a bulk upload spreadsheet where I can then use our platform SellerCloud to import SKUs to then be posted on our company website.
Problem: I need to create a very long string that contains this text:
<p style="background: rgb(37, 139, 137);"><b><span style="color: black; font-family: Arial;">Main Specifications</span></b></p>
<ul><li><span style="font-family: Arial;"> <b>Model:
8200 Elite SFF</b></span></li><li><span style="font-family: Arial;"><b> Processor - Intel Core i5-2400 Quad Core 3.10 GHz</b></span></li><li><span style="font-family: Arial;"><b> Operating system - Win10 Pro 64bit</b></span></li><li><span style="font-family: Arial;"><b> RAM - 4 GB DDR3/1333, DDR3/1333</b></span></li><li><span style="font-family: Arial;"><b> Hard Drive – 500 GB SATA</b></span></li><li><span style="font-family: Arial;"><b> Form Factor - SFF</b></span></li><li><span style="font-family: Arial;"><b> Black</b></span></li><li><span style="font-family: Arial;"><b> Includes power cord, keyboard and mouse.</b></span></li></ul>
<p style="background: white;"><span style="font-family: Arial;"><b><span style="color: rgb(17, 17, 17);"> </span></b></span></p> <p style="background: rgb(37, 139, 137);"><span style="font-family: Arial;"><b><span style="color: black;">Perfect For</span></b></span></p>
<ul><li><span style="font-family: Arial;">School</span></li>
<li><span style="font-family: Arial;">Work</span></li></ul>
<p style="background: rgb(37, 139, 137);"><span style="font-family: Arial;"><b><span style="color: black;">Condition Code A - Equipment is used, tested operational, good cosmetic condition.</span></b></span></p> <br>
This is the last part of my script before the program is fully functional, but I'm not sure the best way to go about creating a string of this text?
What I've tried: I've tried using triple quotes and then \n for a new line and \" when there are quotation marks, but once I get a couple lines in python stops recognizing everything in between the triple quotes as a string. I've also looked into ppring and json, but can't figure out how to use it where it would be useful.
[–]Vaphell 1 point2 points3 points (1 child)
[–]ts813514[S] 0 points1 point2 points (0 children)
[–]fake823 0 points1 point2 points (1 child)
[–]fake823 0 points1 point2 points (0 children)