× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On Thu, Jan 24, 2019 at 11:21 AM Jim Oberholtzer
<midrangel@xxxxxxxxxxxxxxxxx> wrote:

I have followed this thread with interest, and aside from "python can do
that" and some examples of how to use python from various places, no one
really answered the question in the original post.

What would the python code look like to convert a name in all upper case to
mixed case?

Justin Taylor and I both provided actual, working Python code. Check
the archives.

so:

s = "JIM OBERHOLTZER";
print s.capitalize()

Results in "Jim Oberholtzer". It does what the original post was asking
about.

Well, for "simple" names, yes; and that is precisely what Justin's code does.

I think people who say "...but I don't see any examples!" are actually
having trouble seeing how the examples that ARE provided fit into
their RPG-centric approach.

And THAT is why there was so much discussion about how to call Python
from other places.

It occurs to me that the "titlecase()" might do it.

That is not something provided with Python. I suppose you might have
found this project:

https://github.com/ppannuto/python-titlecase

or this blog post which points to the above project:

https://muffinresearch.co.uk/titlecasepy-titlecase-in-python/

In either case, if you're going to resort to a third-party package
(which I personally think is a good idea, because the built-ins are
very naive), you might as well go with one which was designed for
names of people, not names of books or articles. And that is also
something that I presented earlier:

https://pypi.org/project/nameparser/

I also covered how to install it, which was one line at a PASE command prompt.

What I didn't cover is how to *use* that package, once you've
installed it. The main reason is that the first order of business is
whether or not OP is interested in using Python at all; and then if
they are, the second order of business is how they want to connect it
to their existing processing. Again, the bulk of the discussion is
about that second order of business, because that's really the tricky
part. Once you're "in Pythonland", it's pretty smooth sailing. Getting
in and out of Pythonland takes a little bit of figuring.

John Y.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.