{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "b5dac332",
   "metadata": {},
   "source": [
    "# 15-19 · Teczki: exists(), is_file(), mkdir()\n",
    "\n",
    "Praktyka do sekcji [„Folders: exists(), is_file(), mkdir()”"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "516fdd5d",
   "metadata": {},
   "source": [
    "## Sprawa robocza"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "34551b4b",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-18T15:53:02.729341Z",
     "iopub.status.busy": "2026-08-18T15:53:02.729211Z",
     "iopub.status.idle": "2026-08-18T15:53:02.768630Z",
     "shell.execute_reply": "2026-08-18T15:53:02.768038Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "False True\n"
     ]
    }
   ],
   "source": [
    "from pathlib import Path\n",
    "\n",
    "p = Path(\"nesuschestvuyuschaya_papka\")\n",
    "exists_before = p.exists()\n",
    "\n",
    "Path(\"vlozhennaya/papka\").mkdir(parents=True, exist_ok=True)\n",
    "created = Path(\"vlozhennaya/papka\").is_dir()\n",
    "print(exists_before, created)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5637e8f1",
   "metadata": {},
   "source": [
    "## Podstawowa praktyka zadań ★"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "90487427",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-08-18T15:53:02.769712Z",
     "iopub.status.busy": "2026-08-18T15:53:02.769519Z",
     "iopub.status.idle": "2026-08-18T15:53:02.772098Z",
     "shell.execute_reply": "2026-08-18T15:53:02.771666Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True\n"
     ]
    }
   ],
   "source": [
    "from pathlib import Path\n",
    "\n",
    "Path(\"vlozhennaya/papka/fajl.txt\").write_text(\"ok\", encoding=\"utf-8\")\n",
    "is_file_check = Path(\"vlozhennaya/papka/fajl.txt\").is_file()\n",
    "print(is_file_check)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Cartesian Python 3.14",
   "language": "python",
   "name": "cartesian-python314"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.14.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
