Using AI to Write a Python Script

Everyone’s doing it! AI tools have been around for quite a while, but they are definitely having a moment, and people are enjoying the thrill of discovery with these new tools.

I thought it would be fun to show a quick and easy way you can use Google Gemini to create a simple Python app that tells you the weather.

Google Gemini Page

Enter this:

Create a Python script that connects to the National Weather Service API and gives the next week’s forecast for a specified location.

Result

Note: The results might be slightly different each time you ask Gemini the same prompt.

Gemini Response

import requests
import json

# Define user-agent header (NWS API requires a custom User-Agent identifying your app)
# Format: (your-app-name, your-contact-email@example.com)
HEADERS = {
    "User-Agent": "(MyWeatherApp/1.0, contact@example.com)",
    "Accept": "application/geo+json"
}

def get_nws_forecast(latitude: float, longitude: float):
    """
    Retrieves the 7-day weather forecast for a given latitude and longitude
    using the National Weather Service API.
    """
    # Step 1: Query the /points endpoint to get local grid office metadata
    points_url = f"https://api.weather.gov/points/{latitude:.4f},{longitude:.4f}"

    try:
        response = requests.get(points_url, headers=HEADERS, timeout=10)
        response.raise_for_status()
        point_data = response.json()

        # Extract the specific forecast URL endpoint and location details
        forecast_url = point_data["properties"]["forecast"]
        location_info = point_data["properties"]["relativeLocation"]["properties"]
        city = location_info.get("city")
        state = location_info.get("state")

        print(f"\nFetching forecast for: {city}, {state} ({latitude}, {longitude})\n" + "=" * 60)

        # Step 2: Fetch the detailed forecast from the endpoint grid URL
        forecast_response = requests.get(forecast_url, headers=HEADERS, timeout=10)
        forecast_response.raise_for_status()
        forecast_data = forecast_response.json()

        # Extract forecast periods (contains day/night detailed breakdowns)
        periods = forecast_data["properties"]["periods"]

        for period in periods:
            name = period["name"]
            temp = period["temperature"]
            unit = period["temperatureUnit"]
            short_forecast = period["shortForecast"]
            detailed_forecast = period["detailedForecast"]
            wind_speed = period["windSpeed"]
            wind_dir = period["windDirection"]

            print(f"--- {name} ---")
            print(f"Temperature : {temp}°{unit}")
            print(f"Wind        : {wind_speed} {wind_dir}")
            print(f"Overview    : {short_forecast}")
            print(f"Details     : {detailed_forecast}\n")

    except requests.exceptions.HTTPError as http_err:
        print(f"HTTP error occurred: {http_err}")
    except requests.exceptions.RequestException as req_err:
        print(f"Request failed: {req_err}")
    except KeyError as key_err:
        print(f"Error parsing response JSON key: {key_err}")

if __name__ == "__main__":
    # Example: New York City Coordinates (40.7128° N, -74.0060° W)
    # Note: NWS API only covers US regions/territories.
    lat = 40.7128
    lon = -74.0060

    get_nws_forecast(lat, lon)

Final Details

Additional Details

Of course you also have to know how to install requests and run the Python script on your computer! But Gemini did the coding for you. Sweet!

Technical Writer Resume and Interview Tips

Writer's mindI was recently interviewed on the podcast 10-Minute Tech Comm to share insights I’ve gained through screening and interviewing dozens of technical writers during the past six years leading technical writing teams in New York.

Whether you are hiring or want to be hired, here are the top takeaways:

Resume Tips

  1. Submit an impeccable resume. No typos! Make sure all company names, tools, and technologies are capitalized correctly. Is it JavaScript or Javascript?
  2. Use parallel construction. Don’t begin four bullet points with a verb and one with a noun. This type of mistake reveals either carelessness or lack of knowledge of sound technical writing practices.
  3. Keep your verb tense consistent. Use present tense for your current role and past tense for all other roles. Don’t switch tense mid-sentence, please!

If your resume contains mistakes in any of these areas, no matter how great your experience may appear, you’re not the right person for the job.

Interview Tips

  1. Answer questions succinctly and address the question directly.
  2. If you don’t have experience using a particular tool, admit it! Then, if possible, describe experience with a similar tool, or provide an example of learning a new tool quickly.
  3. Research your interviewer and create connection through mentioning something about the interviewer’s interests or experience.

You’re being evaluated not just on your skills but on what it will be like to work with you. Be pleasant, courteous, and show your natural warmth and humor.

Listen to the podcast or read the transcript for more tips and advice.

The X-Factor in User Experience (UX) – New York UX Writer Sprinkles the Fun Flakes in the Fishbowl

This app design is pretty clear, telling the user the valid types of ID and calling for an action (to select). But it would be more clear to say “tap” than “select” since this is a phone app.

When I began looking at my writing experience from a UX perspective for a potential contract at Google, I realized that user experience permeates everything I do. It is the foundation of technical writing.

Technical writers are always asking questions about the user experience:

  • What does the user need to know?
  • What is the best way to provide the information?
  • What level of reading skills do they have?
  • What is their pre-existing experience with the subject matter?
  • How can we best accommodate different skill and experience levels?
  • How do I seamlessly provide the required info, making it findable and making sure it answers all their questions?
What is wrong with this design? What if you want to pay your Macy’s credit card statement. Would you choose “Pay Another Entity,” “Pay a Bill,” or “Pay a Business or Person”? Confusing! Frustrating! The user will likely have to try a few options before they can succeed at their desired task.

The X-factor in user experience design is one more question:

  • How do we make sure the user’s experience is positive and even  delightful?

In my opinion, the technical writer is always the user’s advocate. We have the logical mind to think through every step the user needs to do to perform a task, and on any well-functioning software, app, or web design team, the technical writer is part of the initial design process, collaborating with other experts to find the best way to help the user succeed.

Sprinkling the Fun Flakes

If empathy, logic, and flow are missing, the user is not going to have a good experience, period. If the user can’t figure out what to do, if the app leads to a dead end, if there are no clear indicators of how to find an expected function—the user will feel frustrated and won’t have a positive experience. If the wording is unclear—or worse, badly written or offensive, as in the case of the website of one “UX design expert” I recently viewed—your product is dead in the water.

So cute words, fun graphics, and pleasing haptics are useless unless there is a solid design foundation and clean, clear language.

Technical writers have been helping provide that solid foundation for decades: creating task-focused text that is clear, concise, and useful.

We are the ideal professionals to add the X-factor and sprinkle the fun flakes into the fishbowl:

  • Compelling, effective language, backed by user research.
  • Great copy and tone of voice, conveying the brand and connecting personally to the user.
  • Rewards for accomplishing the tasks. We all like a treat!

Nuff said.

 

New York Technical Writer Talks Video Storytelling

I recently took a course on video storytelling at the Craig Newmark Graduate School of Journalism at CUNY. Bob Sacha was an awesome teacher—smart, interesting, and instructive.

Sacha showed entertaining and inspiring examples of videos that have been shot on smartphones, including Hollywood blockbuster films such as Steven Soderbergh’s “High Flying Bird” and “Unsane.” Soderbergh used innovative techniques such as being pushed in a wheelchair instead of using a dolly.

6 Key Principles of Effective Video Storytelling

  • Choose an opening shot that is going to hook your viewer
  • Use a lot of close-ups and extreme close-ups to capture detail and evoke interest
  • Switch camera angles frequently to keep it interesting
  • Bring it on home with the closing shot—a reward for the viewer, with an image to remember that finishes the story
  • Use sound to help establish the mood
  • Evoke emotions in the viewer—we remember how we feel more than what we see or hear

Here’s an example of what I learned. Technical writing “how to” made into art! IMHO! 😉

Going to California” is a reference to a Led Zeppelin song lyric: “Took my chances on a big jet plane, never let ’em tell you that they’re all the same.” Each pair of students in the class made unique airplanes and unique videos!

Variations on a Theme – Adapting to Your Target Platform

Next I took the principles of great video storytelling and created 3 versions of a video:

Square for Instagram

This one is under 1 minute (timed for an Instagram feed), and square to display well in Instagram.

Short YouTube Version Captures Highlights

This is the length for my Another New York Love Affair art project, where each video is usually under two minutes. It captures the feel of the event, with behind-the-scenes warm-up and a flash on the audience at the beginning.

Full Length

This is the full length of the song. It’s my singing debut, and my Mom might want to see the whole thing!

Operating Procedures Helped New Bank to Open in NYC

CIO Linda Orlando, me, and CEO Judith Erwin on Orange Day at Grasshopper Bank
Former CIO Linda Orlando, technical writing consultant Karen Rempel, and CEO Judith Erwin celebrating Orange Day at Grasshopper Bank, May 2018 (working towards getting the bank ready for the official opening, which occurred in May 2019)

It was a day of celebration yesterday, as Grasshopper Bank completed its journey from conception to implementation. Grasshopper Bank is the first new bank to open in New York City since the housing crisis of 2008. The “C-Suite” team is led by CEO Judith Erwin, and some of the top women in the banking industry are the lights guiding this financial institution. The dynamic team, composed of industry heavyweights who have over 200 years of combined experience in commercial banking and financial services, raised close to $100 million in order to obtain OCC* approval. The bank will focus on New York’s “innovation economy,” with corporate, venture capital, and start-up clients.

I played a crucial role in helping the new bank obtain approval from the Office of the Comptroller of the Currency (OCC) and make it to the starting line. I developed over 50 required standard operating procedures, working with various roles across the bank to determine procedures that would guide staff to perform all daily operations tasks in compliance with federal banking regulations. I brought my expertise in T24 to the task, and helped develop and document software requirements as well as procedures. My role included business analysis and training as well as technical writing, and I helped the team learn end-to-end processes for all daily and monthly procedures, from taking a deposit and boarding a loan to generating a financial statement.

I worked closely with the Chief Risk Officer, Sally Myers, to develop the required procedures to provide oversight from a risk mitigation and compliance perspective. I worked with CFO Sangeeta Kishore to ensure that the Operations team provided all required data and reports to her desk in a timely manner.

It was an exhilarating challenge and a great deal of fun, working with a fantastic team of people in an extremely dynamic, fast-paced environment. My daily compadres were the Operations team, under COO Gary Blumenthal,  and it was a real pleasure to work with this group to ensure they would be able to perform all required tasks on day one.

We focused on the user experience (UX) to ensure that staff and customers will love using the bank’s internal and external banking tools, developed for mobile and the web. The team of T24 consultants under Nikki Nelson were amazing to work with, and they were instrumental in bringing the bank to the point of opening the doors yesterday.

I wish the wonderful folks at Grasshopper Bank every success as they open their doors for business. Mazel tov!

*The OCC is an independent bureau within the United States Department of the Treasury that was established by the National Currency Act of 1863 and serves to charter, regulate, and supervise all national banks and thrift institutions and the federally licensed branches and agencies of foreign banks in the United States.

New York, NY Technical Writer Looks at High Rises in the West Village

Karen Rempel New York NYC Technical Writer article for WestView NewsI recently toured one of the newest high rises that’s taking shape along the Hudson River in the West Village of New York City. 160 Leroy Street has a unique curvy design by Swiss architecture firm Herzog & de Meuron, making this star the most glamorous on the block. I wrote an article about the West Village’s new neighbor for the WestView News.

As neighbors go, 160 Leroy is more like Sophia Loren than Ralph Kramden, with the two private-elevatored penthouses selling this year for $51 million (7,750 square feet, with a rooftop pool) and $31.5 million (4,849 square feet, with a rooftop oasis), and a modest 9th floor one-bedroom (1,096 square feet, with double exposures) listed at $3.2 million. I concluded that this neighbor is going to be viewed 100 years from now as one of the most exciting architectural examples of our era.

New York, NY Technical Writer and Web Content Developer Designs Etsy Store

Krystyna's Place Etsy StoreI worked a part-time job at Krystyna’s Place on Cornelia St. in New York this summer. I wanted to connect with people on the streets of New York, as a way of solidifying my transition from Vancouver to New York. I opened and closed the store, served customers, dressed the windows, and created an online store for Krystyna’s Place on Etsy. This web content development project entailed creating all the visual and design elements for the store, including a logo and header. I photographed 30 pieces that Krystyna had selected, measured them, wrote descriptions, and fell in love with the clothes!

This was the ideal summer job, allowing me to bring together my technical writing, photography, and design skills into a practical, hands-on situation with New York people and fashion. Now I can add fashion to the list of industries I’ve written for. For a fuller account, see my Wild Visions site.