Using Plotly I generate HTML files containing plots of data.
Plotly also provides an option that automatically asks the user to download the plot as .svg file when the HTML file is opened.
Is there a way to open these HTML files with python and then automatically save the generated .svg file to some location?
Related
I have a python app and I'm using xlwings to write to an Excel file. I am trying to create a link to another file. For now, I am trying to link to an Excel file. I am using the code:
ws.range(15, 8).value = '=HYPERLINK("C:\\file.xlsx")'
This creates a link but when I click the link I get the error "cannot open the specified file". The cell value is =HYPERLINK("C:\file.xlsx"). If I create a link to the same file using the "Insert Link" button in Excel it works and both cells show the same file path. Also I will need to create a link to a non-excel file that needs to be opened with a different program. How can I do this?
You should use the add_hyperlink method.
Example:
ws.range(15, 8).add_hyperlink("C:\\file.xlsx")
You need to specify a protocol - specifically, file.
Changing your link to file:///C:/file.xlxs would likely solve your problem. Non excel files would be opened with the default program for that file type (e.g. .txt would open notepad)
I have to download the file from this url using python.
https://icms.bombinoexp.in/ImageHandler.ashx?ID=37997&Type=BOE&FileExt=.pdf
Here's my code:
response = requests.get(url)
open('pdf_file.pdf','wb').write(response.content)
File is downloaded successfully and i can open it using the Adobe and can see the contents, but when I'm processing this file using PyPDF2, it is giving
PyPDF2.utils.PdfReadError: EOF marker not found
I had one PDF file and it was processed smoothly with PyPDF2, and when I cross-checked both files, I can see new PDF file has extra information.
Also, if you click the above PDF link, it will be opened in Chrome PDF Viewer, if you click save button and then open the PDF file in sublime or any other editor, you can see the extra data. But If I save this file with printer option and instead of printing, If I Save as PDF, it is saved successfully and also processed successfully. I'm unable to understand the difference, can anyone please point me in right direction?
When I browse my file system through a jupyter notebook server I can view and edit HTML and other text files in addition to ipynb files. However I want to view the files as rendered HTML instead of viewing them as a editable HTML.
In other words, how can I make a jupyter notebook server serve static content?
It already does, under /files. For example, when https://tmp39.tmpnb.org/user/IgoeEDdRLpRG/edit/featured/pandas-cookbook/README.md is the URL for editing a file, https://tmp39.tmpnb.org/user/IgoeEDdRLpRG/files/featured/pandas-cookbook/README.md is that file served up as-is (the first two segments of this example file path are specific to tmpnb servers).
I'm using leaflet with omnivoire to display maps online.
As part of this I have three python files that take .gpx satnav data and turn it into co-ordinantes and markers for my leaflet map.
The problem seems to that the three files export.py, gpxplot.py and gpxplot.pyc aren't being parsed by MAMP.
If I change the file suffix to cgi then the .py files work, but what do I do about the .pyc file?
How does one convert a .pages file to a .doc or .pdf file using Python? My use case is basically:
User uploads a .pages file to my service
My service converts the .pages to a .pdf`
The .pdf is rendered in browser using a browser-based .pdf viewer
I've never done it, but it appears the .pages file already contains a pdf version if you unzip the file: http://blog.cleverly.com/
A complete native solution in python will be difficult.
Appropriate solution would be to look at how you can automate pages to export the file in pdf or ms word.
For that, there seems to be an available solution:
pyobjc
Three is an example that automates pages using pyobjc: http://www.mugginsoft.com/kosmictask/help/automation-python