Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
4027 Lượt xem

hello , i trying to overwrite a py file , can i do that when install of a new specifique module ?

i need to overwrite .py file ( in /tools directory ) i try to use f= open(filename,"w") ....

but an error appear

thks , if someone have an idea

Ảnh đại diện
Huỷ bỏ

You should write your own python classes that inherit and override the classes you want to change. Which file are you trying to replace and why?

What Ray suggest is correct

Tác giả

thks for ur replay, i am trying to overwrite ( amount_to_text.py , you can find it in /tools/amount_to_text ) i would overwrite it when installing a module , not to do it manually

can i use read and write file like that : fichier = open("fichier.py", 'w')...

??

No. You should not do this (and I don't know how to do it anyway). Other parts of the product that need these functions will act unpredictably if you make any changes. If your module needs different functions, write them in your module. If you are trying to fix something, submit a bug.

Câu trả lời hay nhất

You should write your own python classes that inherit and override the classes you want to change. Which file are you trying to replace and why?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

your question is not clear would you explain your scenario more clearer ?

Ảnh đại diện
Huỷ bỏ