Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Using python for text replacement
#1
I want to make many ready made text be available.

So if I type #hello for example, I could have this replaced with one line or many paragraphs of text.

Is there code or libraries that will help me with this?

I use Autohotkey right now - this work OK - and I can do everything I need.
But, I needed a few extras, so I thought I might try to code in Python for that.
Like for example, I wanted a nice GUI interface where the user can use to create and edit text shortcuts.

Thanks.
Quote
#2
You don't need a library to do the replacement. The replace method of strings is probably all you need. Although, if you wanted to get fancy you could use the re regular expression module. But you don't need that just to replace #hello.

There are lots of GUI packages out there for Python: Tkinter, PyQt, wxPython, and more.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures

Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Running python from Sublime Text editor balley810 2 82 Jul-14-2019, 03:40 PM
Last Post: ThomasL
  To Copy text values to Excel using Python ksasi2k3 15 787 Jun-26-2019, 01:23 PM
Last Post: ksasi2k3
  How best to format text in a simple text file? Pedroski55 2 371 Jun-14-2019, 06:07 AM
Last Post: noisefloor
  Print to Text file in Python 3 iteachpc 2 251 May-02-2019, 04:38 AM
Last Post: perfringo
  How work with formatted text in Python? AlekseyPython 3 277 Mar-18-2019, 05:00 AM
Last Post: AlekseyPython
  Change Text Color Output in Python bluethundr 2 427 Mar-06-2019, 10:23 PM
Last Post: bluethundr
  xml replacement with python josesalazmit 3 204 Feb-24-2019, 07:28 PM
Last Post: stullis
  write each line of a text file into separate text files and save with different names Shameendra 3 267 Feb-20-2019, 09:07 AM
Last Post: buran
  Saving python cmd output into a text file with colours kapilan15 2 297 Jan-25-2019, 06:25 PM
Last Post: metulburr
  How do i read particular text from text file and update those values in MS SQL table ganeshsai2912 33 2,362 Nov-20-2018, 12:55 AM
Last Post: ganeshsai2912

Forum Jump:


Users browsing this thread: 1 Guest(s)