A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-June/025679.html below:

[Python-Dev] PEP 292, Simpler String Substitutions

[Python-Dev] PEP 292, Simpler String SubstitutionsFredrik Lundh fredrik@pythonware.com
Thu, 20 Jun 2002 12:52:26 +0200
christian wrote:

> > I usually mention "import" in the first hour (before methods),
> > and nobody has ever had any problem with that...
> 
> Well, same here, but that might change, since the string
> module is nearly obsolete. You can show reasonably
> powerful stuff(*) without a single import.
> 
> (*) and that's what you need to get people interested.

I usually start out with something web-oriented (which means
urllib).  how about adding a "get" method to strings?  or an "L"
prefix character that causes Python to wrap it up in a simple
URL container:

    print url"http://www.python.org".read()

:::

but in practice, if you really want people to get interested,
make sure you have a domain-specific library installed on the
training machines.  why care about string fiddling when your
second python program (after print "hello world") can be:

    import noaa
    im = noaa.open("noaa16_20020620_1021")
    im.rectify("euro")
    im.show()

</F>





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4