hello everybody here in my code i am facing some problem in this ....after clicking the button it calls the function new_proj after that a the end it calls jojo() function but it this jojo function this is a variable y which is taking the return of value of the new proj...i am not able to solve it....so pls sort it with an ease....as i am kind of begginer...

sir basically i tried str.replace thing but its not working ....basically i want to edit a .tcl file ....not a txt file ....def new_proj(): is creating a folder and copying the original file ...and will edit it (as if it is not the whole program but it is one portion init)and jojo() function will handle the edit portion.....and you said to create a function within function i am srry i cant able to do that...can you tell me where to make the edits.... ......for more understanding i am also giving the file code in which i hav to make the edits....it is .tcl file which controlls the whole xilinx ise....and my gui app will control evrything by taking entries from the user....in this x=x+"\soth.tcl"....is i am doing to point the address where i want to make edits...thanks a lot in advance

That is a text file. Just because the extension is tcl doesn't mean the content of the file isn't stored as text. It is also a small text file. If all you want to do is replace 'vitrix4' with 'vitrix5', I would just read() the file into a variable, use variable.replace('vitrix4', 'vitrix5'), and then write the variable back to the file.

Due to the reasons discussed here we will be moving to python-forum.io on October 1st, 2016.This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.

sir i have tried that one but its not working ....i know it is also a text file but its not changing it.....otherwise why i would do this coding....can you help me by just editing the program i hav posted than it will be more easy to undertand it...pls

No, you help us help you by giving use the error you are getting. Try it the way I suggested, its much simpler. If it doesn't work, show us the code you wrote and show us the error you got or exactly how the output was wrong.

Due to the reasons discussed here we will be moving to python-forum.io on October 1st, 2016.This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.