Home > other >  'new for help, how python implementation class browser CTRLF function
'new for help, how python implementation class browser CTRLF function

Time:11-25

萌新求救有没有大佬知道怎么在Python中实现跟浏览器差不多的ctrl+f的查找定位功能,(或者给定一个中文词语,然后在一个txt文本里找出这个词语出现的次数,不用分词有没有办法实现)

CodePudding user response:

You want is this?
 
Val_test='sprouting new SOS have bosses know how in Python implementation with browser almost CTRL + f locating function, (or given a Chinese word, and then in a TXT text to find the number of occurrences of a word, no word segmentation is there a way to realize)'

Print (val_test. Count (' implementation '))

Print (val_test. Count (' in '))

  • Related