Python Forum
Using python for text replacement
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.
Reply
#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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  String replacement in DB WJSwan 0 711 Dec-28-2022, 05:31 AM
Last Post: WJSwan
Exclamation IndexError: Replacement index 2 out of range for positional args tuple - help? MrKnd94 2 5,954 Oct-14-2022, 09:57 PM
Last Post: MrKnd94
  Extract the largest value from a group without replacement (beginner) preliator 1 2,037 Aug-12-2020, 01:56 PM
Last Post: DPaul
  Simple automated SoapAPI Call with single variable replacement from csv asaxty 1 2,056 Jun-30-2020, 06:38 PM
Last Post: asaxty
  line replacement help mdalireza 8 3,352 Nov-11-2019, 12:54 PM
Last Post: mdalireza
  xml replacement with python josesalazmit 3 8,311 Feb-24-2019, 07:28 PM
Last Post: stullis
  Best replacement for pyzmail in lines 15 and 16 Pedroski55 0 2,460 Nov-03-2018, 06:12 AM
Last Post: Pedroski55
  Is pathlib a viable replacement for os.path? j.crater 4 9,906 Jan-13-2018, 09:49 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020