{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "8e82214d-6c64-433d-800f-2dde5f4a18bc",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "import pandas as pd \n",
      "import numpy as np\n",
      "\n",
      "def method_a():\n",
      "    print(\"method_a print hello world!\")\n"
     ]
    }
   ],
   "source": [
    "\n",
    "with open('D://jupyterProject//jyProject//algorithm_platform//docker_bulid//method_a.py', 'r') as file:\n",
    "    data = file.read()\n",
    "\n",
    "print(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "2d45d74a-1157-4226-9aec-a11e39b1e143",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "method_a print hello world!\n",
      "None\n"
     ]
    }
   ],
   "source": [
    "# file2.py\n",
    "import sys\n",
    "import os\n",
    "\n",
    "# 将 file1.py 所在目录添加到 Python 路径\n",
    "sys.path.append(os.path.abspath(\"D://jupyterProject//jyProject//algorithm_platform//docker_bulid\"))\n",
    "\n",
    "# 导入 file1.py 中的方法\n",
    "import method_a\n",
    "\n",
    "# 使用 file1 中的方法\n",
    "print(method_a.method_a())"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python (panddlets)",
   "language": "python",
   "name": "panddlets"
  },
  "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.9.19"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
