Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert code to exe or GUI app [closed]

I am a beginner to programming, and I have started to learn Python. I am trying to create a search and replace application, which allows us to select a number of files and then replaces the words or phrases that we want.

I have already written that script, but I want to make something which works in Windows XP. Actually I want it to be a GUI application that works in Windows. So what am I supposed to do? Here's the code that I have written:

#replace.py
import string
def main():
    filez = raw_input("which files do you want processed?")
    f=open(filez,"r")
    data=f.read()
    w1=raw_input("what do you want to replace?")
    w2= raw_input("what do you want to replace with?")
    print data
    data=data.replace(w1,w2)
    print data
    f=open(filez,"w")
    f.write(data)
    f.close()
main()
like image 914
faraz Avatar asked Jun 28 '26 17:06

faraz


1 Answers

Python has quite a few gui options, these in my mind are the most prolific.

  • Tkinter
  • wxPython
  • pygtk
  • pyqt

since you said your a beginner I'd recommend using Tkinter as it comes built into python. Here is a tutorial to get you started.

like image 71
John Avatar answered Jun 30 '26 08:06

John



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!