# This fiddle converts the content of a file to an "escaped" string # Step 1 - Click on the "Upload files" icon and select your file # Step 2 - Adjust the name of your file in the below line my_filename = "something.jpg" # Step 3 - Click on the green ▶ button to run this script # Step 4 - Copy for your need the escaped string from the script output file = open(my_filename, "rb") content = file.read() file.close() # Print the escaped content in the console print(content)