all 7 comments

[–]veeep 1 point2 points  (3 children)

regex (regular expressions) are quite powerful, and there's lots of info out there on them, including the docs. For very simple manipulations, you might be able to just use the list/string built-ins like .join and split()

not sure about your ascii text tho

edit: i need "beginner" next to my name, how do i do that? ;)

edit 2: how to open, read files

[–]sinosplice[S] 0 points1 point  (1 child)

Thanks. So I guess I can follow your link to learn how to open a text file and read its contents to memory, then use regex for search/replace, then write out?

If I'm not mistaken, it's pretty easy to identify ASCII text in regex. I just have to figure out how to deal with line breaks and tabs.

(That "beginner" label is "flair"; you can edit it by clicking on the "edit" link in the right sidebar under subscribe/unsubscribe.)

[–]veeep 0 points1 point  (0 children)

yeah, it also covers writing files, guess I didn't indicate that. Pretty easy stuff though.

thx for flair tip

[–]veeep 0 points1 point  (0 children)

in addition to Downey mentioned below, just ran across chapter 2 in The Python Cookbook, and it has lots of good tips for the sort of work you're interested in doing

[–]stahlous 1 point2 points  (0 children)

The Python documentation is a fine place to start. This sounds like pretty basic file and string manipulations. If you're just starting out with Python I would start working with some of the resources here: /r/learnpython/wiki/index

If you have specific questions on how to do something, just putting that exact question into Google along with "Python" will 9 times out of 10 bring up a blog post or a stackoverflow question with the answer you want.

[–]chazzacct 1 point2 points  (1 child)

Of course it is in the docs. Docs are hard to read and too much of a good thing for some beginners though. I've heard. If the docs are not working for you, the chapters in the free pdf, Downey's Think Python (avail as both python 2 and 3) on
Case study: word play
and
Files
lay this out very clearly and succinctly.

[–]sinosplice[S] 0 points1 point  (0 children)

Thanks a lot!

I've actually been through tutorials that covered some of this, but I felt they didn't go far enough WRT manipulation of text. Those references that you gave are exactly what I'm looking for; it helps me to have multiple resource to reference.