commit
8f488f88bf
|
@ -0,0 +1,66 @@
|
|||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 14,
|
||||
"id": "74865d41-5998-4606-b87f-fd306a0a9742",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"hola, soy el hilo 1 \n",
|
||||
"hola, soy el hilo 2\n",
|
||||
"hola, soy el hilo 3 y ultimo\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import threading\n",
|
||||
"\n",
|
||||
"# método al que se va a aosciar el hilo\n",
|
||||
"def Saludo3():\n",
|
||||
" print(\"hola, soy el hilo 3 y ultimo\")\n",
|
||||
"def Saludo2():\n",
|
||||
" print(\"hola, soy el hilo 2\")\n",
|
||||
" t = threading.Thread(target=Saludo3)\n",
|
||||
" t.start()\n",
|
||||
"\n",
|
||||
"# creamos un hilo asociado a una función\n",
|
||||
"t = threading.Thread(target=Saludo2)\n",
|
||||
"print (\"hola, soy el hilo 1 \")\n",
|
||||
"t.start()\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "ae656164-65d7-40ba-a091-43156bdb6a78",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"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.13.0"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
Loading…
Reference in New Issue