I have an issue on my github project that is meant to maintain a EJS syntax definition file for Sublime Text editor. (https://github.com/samholmes/EJS.tmLanguage/issues/1)
The issue is that users want to be able to customize what the opening and closing tags should be in EJS. I've set it to <? and ?> respectively, because I prefer this personally. However, the "correct" or should I say the recommended default open and closing tags are <% and %> as you'll find on the EJS website.
So, what I'm wondering is if there is a way to customize this per installation of this package? I wouldn't know how this would work though. tmLanguage files are just XML files. So, my question is. On this line:
https://github.com/samholmes/EJS.tmLanguage/blob/master/EJS.tmLanguage#L579
Is there a way to make the regular expression generated by some setting file?
Any ideas on how I could solve this would be highly appreciated. I'm not familiar with Sublime's features or python API, so anyone with more information on this, please let me know what it is you think I should do.
Related
I have a quite complex software system which was developed in ruby and has been now all "translated" and transported into python. The last thing which is left is a series of *.txt.erb templates. I would like to leave them as they are but have a python library which does what the old ruby routine was doing, that is creating a series of *.txt files which follow the *.erb templates structure. I have looked a lot around but I cannot find an answer.
Probably for a more expert python programmer this might be a simple question.
Thanks a lot for your help!
I've solved the problem changing the *txt.erb templates into *.txt files and I've coded a python script which reads the file and substitute the general variable into the specific variable I want to, for both file content and file name.
Thank you for the help!
I'm trying to write an application that scans a word .docx file and offers suggestions. I want to ideally put the suggestions on the document itself using MS Word's annotation functionality. (Here is an image of what I'm talking about if i'm not being clear -
MS Word Annotation Functionality
My question is how do I achieve this in Python. I looked through Python-docx's functionality, but didn't find anything there.
Alternatively, I was thinking of manually doing it, where I'd programmatically go into the docx file, go into the xml file, and add the comment that way but I'm not sure how to approach this and I'm not sure if there is a better way to do it.
Please advise :)
Appreciate the help in advance!
for anyone else looking, this is a fork from python-docx that implements comment functionality.
I am trying to read .one file(OneNote files) and want to write its content into a text file, but didn't find a single way to do it using Python. Please help me with this.
Try to get the content of your notes calling:
./me/onenote/pages/1-1c13bcbae2fdd747a95b3e5386caddf1!1-xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx/content?includeIDs=true&includeInkML=true&preAuthenticated=true
It will give you text/html, which you can parse with https://pypi.org/project/lxml/
I didn't find a good way to decode .one file.
But I find another way to workaround it.
Install OneNote 2016 and sync the contents.
Install the Evernote legacy version
Import data from OneNote to Evernote. (There's a button on GUI).
Export notes to html from Evernote.
Then you can do whatever you want. Yeah!
This isn't Python, but for other internet voyagers trying to escape Microsoft's iron grip this PowerShell script is pure magic.
https://passbe.com/2019/bulk-export-onenote-2013-2016-pages-as-html/
I am looking for a Python module and some examples on how to add Text to an existing PDF. The PDF file is an one page PDF and I would need to add the info at a predetermined position. The text can be added as part of the document or as a comment.
I would also need to read the comments that are in this document.
What is the best Python module that I can use for this? The environment is Windows 7 and Python 2.7 x64.
I have tried to compile poppler but it is a nightmare
The other libraries that I have looked at are pyPDF2 and PDF1.0 but I could not locate the objects and the methods that I need to use to achieve my task. My level is "beginner" so please if I overlooked anything is because of this.
This question has been asked, and was very thoroughly answered. Check it out here! The first answer is nicely general, and walks you through each step of the process. The second answer is instead straight code that you can run. Both are valuable and well-written; choose whichever works best for you. (Or both!)
I need to learn/write XML and I already have python downloaded as I am also learning python. I did notice that there was another question on stackoverflow about xml writers and python but I didn't get the idea that there was real consensus on what's easiest to use? That is, I would ideally like an XML editor that highlights my errors and helps with formatting as it can be very tedious. Should I stick with python's element tree xml app or download one of the following that I was told about? Thanks.
http://netbeans.org/downloads/index.html
download Java SE and just use its editor
XML Notepad 2007
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=72d6aa49-787d-4118-ba5f-4f30fe913628&DisplayLang=en#AffinityDownloads
You're asking about two separate things.
XML Notepad and the NetBeans utility are apps for visually creating and editing XML.
Python's ElementTree is a library for programmatically creating and parsing XML.
Which one you need depends on what you want to do - create XML in an editor, or do it inside your program.
I use IntelliJ (community edition should be fine) and emacs for XML editing.
I used the Altova XMLSpy family back in the days I used windows.