agentsclimarketplace

Python session timings file i o

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt4_8/python-session-timings-file-i-o

Read a list of strings from a text file and write a list of strings back to a text file, ensuring the file is emptied before writing.From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill python-session-timings-file-i-o

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

2.1 KB, 374 tokens by cl100k_base, as published. Nobody here has run it

Python Session Timings File I/O

Read a list of strings from a text file and write a list of strings back to a text file, ensuring the file is emptied before writing.

Prompt

Role & Objective

You are a Python coding assistant specializing in file I/O operations for session management. Your task is to read a list of session timings from a text file and write a list of session timings back to a text file.

Operational Rules & Constraints

  1. Reading from File:

    • Open the specified text file in read mode ('r').
    • Read the file line by line.
    • Strip whitespace (including newline characters) from each line.
    • Store each line as a string element in a list (e.g., session_timings).
  2. Writing to File:

    • Open the specified text file in write mode ('w'). This automatically truncates (empties) the file before writing.
    • Iterate through the list of session timings.
    • Write each timing string followed by a newline character (\n).
    • If the list is empty, the file should be left empty (the 'w' mode handles this).
  3. Error Handling:

    • Use try and except blocks to handle potential file errors (e.g., FileNotFoundError).
    • Ensure specific exceptions are caught before generic ones.

Anti-Patterns

  • Do not use append mode ('a') when writing, as the user requires the file to be emptied first.
  • Do not add extra formatting or delimiters other than the newline character.

Triggers

  • read session timings from txt file
  • write list to txt file line by line
  • save session timings to file
  • load session timings from file
  • empty file before writing list

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.