I think this is best illustrated with an example. I have the RE pattern choco_icecream = "(do|does) w+ (loves|love|likes|like) (choco|chocolate) (ice-cream|icecream|ice cream)". I want to check if example = "Does Jessica like Chocolate Icecream".lower() is a match for choco_icecream. The example is a match of choco_icecream, but I want to know which word of example ..
I want to make a program that detects duplicate words as in the following example: "At least one value must be entered entered in order to compute the average" We can see that "entered" is repeated and I want to find a way to detect this type of cases. archivo = str(input("Ingrese la ubicación del ..
My python code is import win32com.client as win32 import sys import pywintypes WordApp=win32.DispatchEx("Word.Application") WordApp.Visible = True doc = WordApp.Documents.Open(r’test.docx’, ReadOnly=1) WordApp.Application.Run(‘Normal.NewMacros.test1’) # no error WordApp.Application.Run(‘Normal.NewMacros.test2′,’22’)#error WordApp.Application.Run(‘Normal.NewMacros.test2′,[’22’])#error WordApp.Application.Run(‘Normal.NewMacros.test2’,22)#error WordApp.Application.Run(‘Normal.NewMacros.test2("22")’)#error WordApp.Application.Run(‘Normal.NewMacros.test2’)#error WordApp.Application.Run(‘Normal.NewMacros.test2(22))#error My vba word code is Sub test2(Var2 As String) MsgBox Var2 End Sub Error is self.oleobj.InvokeTypes(dispid, 0, wFlags, retType, argTypes, *args), … Source: Python..
I don’t know why this code changes some cells’ setting but doesn’t do some cells’. especially, the font "돋움" isn’t applied on the some cells what could be the reason? this is the part of the code to change cells’ settings(?). i is for row, 3 is for column cell(0, 3) and cell(4, 3) don’t ..
I know how to add a picture into a cell of a table in a word file. The codes are shown below. import docx pic = "some_picture.jpg" document = docx.Document() tbl = document.add_table(rows=1, cols=1) row_cells = tbl.add_row().cells paragraph = row_cells.paragraphs run = paragraph.add_run() run.add_picture(pic, width = 1400000, height = 1400000) # use add_picture function document.save("demo.docx") ..
I’ve heard about inflect and Text Blob, but I have gotten errors when trying to do similar work on a dataframe with words. Basically I have dataframe with one column being just words in all lowercase, and I need to make the proper nouns have their first letter capitalized. I also want to skip capitalizing ..
I wrote a code that creating a new word file and writing text into it. But I have a problem that when I use the rtl to write to the docx the font.name and the size does not working and geting back to defult Someone know how can I fix that? if I removing the ..
Fair warning: Only started learning Python a couple of weeks ago. I’m wondering if I can use the Mailmerge function to edit fields in an excel worksheet that is embedded inside a Word document. This will help me edit all fields within Word and the excel template at the same time. I’m using this to ..
I am trying to compute a similarity matrix from a list of words of 12k elements. I am using a wordnet similarity using Sematch tool. With a few words I am using this line of code: wns_matrix = [[wns.word_similarity(w1, w2, ‘li’) for w1 in words] for w2 in words] The thing is, this code is ..
Input: ID aa AA Homo sapiens DR ac BB ad FT ae // ID ba AA mouse DR bc BB bd FT be // ID ca AA Homo sapiens DR cc BB cd FT ce // Expected output: DR ac FT ae // DR cc FT ce // Code: word = ‘Homo sapiens’ with open(input_file, ..