DONAŢIE RECURENTĂ
Donează lunar pentru susţinerea proiectului NeculaiFantanaru.com
Ny toetra tena ilaina amin'ity boky ity raha ampitahaina amin'ny hafa eny an-tsena amin'ny sehatra iray ihany dia ny famariparitana amin'ny alalan'ny ohatra ny fahaiza-manaon'ny mpitarika iray. Tsy nilaza mihitsy aho hoe mora ny ho tonga mpitarika tsara, fa raha tian'ny olona...
Nanoratra ity boky ity aho izay mampifandray amin'ny fomba tsotra ny fivoaran'ny tena manokana amin'ny fitarihana, toy ny piozila, izay tsy maintsy ampifandraisinao ny ampahany rehetra mba hamerenana ny sary ankapobeny.
Ny tanjon'ity boky ity dia ny hanome anao vaovao amin'ny alalan'ny ohatra mivaingana ary hampiseho aminao ny fomba hahazoanao ny fahaiza-manao hahatonga ny hafa hahita zavatra mitovy amin'ny anao.
Raha tsy mihevitra azy io ho fifanarahana, ny boky dia maneho ny andrana ny olon-tsotra iray - ny mpanoratra - izay amin'ny alalan'ny teny tsotra, zava-misy sy ny ohatra mahazatra mampianatra ny olon-tsotra herim-po sy ny fanantenana amin'ny fikatsahany manokana ho tompony sy izay mahalala. .. mety ho mpitarika mihitsy aza.
Azonao atao ny mijery ny kaody feno:HTTPS: // passin.com / 3pn Oracle NC import re def read_text_from_file(file_path): """ This function returns the contents of a file. """ with open(file_path, 'r') as f: text = f.read() return text def write_to_file(text, file_path): """ This function writes text to a file. text: the text you want to write """ with open(file_path, 'w') as f: f.write(text) def reverse_words(file_path): """ This function inverts all words in a file. """ text = read_text_from_file(file_path) words = set(re.findall(r'[A-Za-z0-9\-\']+', text)) for word in words: reversed_word = ''.join(reversed(word)) text = text.replace(word, reversed_word) # we write the modified text in the file !!! attention, the content is overwritten !!! write_to_file(text, file_path) if __name__ == '__main__': # the path of your file file_path = 'd:\Exercises\1' reverse_words(file_path) Other examples: https://superuser.com/questions/1684040/ https://community.notepad-plus-plus.org/topic/22054/ That's all folks. If you like my code, then make me a favor: translate your website into Romanian, "ro". Ary koa, misyVersion 2amin'ity code ity naVersion 3naVersion 4naVersion 5naVersion 6 Latest articles accessed by readers:
Donează prin Paypal
DONAŢIE RECURENTĂDonează lunar pentru susţinerea proiectului NeculaiFantanaru.com DONAŢIE SINGULARĂDonează suma dorită pentru susţinerea proiectului NeculaiFantanaru.com Donează prin Transfer BancarCont Lei: RO34INGB0000999900448439
Deschis la ING Bank
|
|||||||||||
![]() |
|||||||||||