Compare commits

...

2 Commits

Author SHA1 Message Date
Jon Ander 8d9092af03 wip 2024-11-30 18:48:03 +01:00
jon ander 6768381bd0 wip 2024-11-30 17:27:14 +01:00
8 changed files with 27 additions and 6 deletions

View File

@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.13" jdkType="Python SDK" />
<orderEntry type="jdk" jdkName="Python 3.11" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -3,5 +3,5 @@
<component name="Black">
<option name="sdkName" value="Python 3.13" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11" project-jdk-type="Python SDK" />
</project>

View File

@ -16,6 +16,7 @@ def tareaUno():
return
Done = False
hilos = list()
for i in range(50):
t = threading.Thread(target=tareaUno)

0
ejercicios/__init__.py Normal file
View File

View File

@ -0,0 +1,3 @@
from ejercicios.paralelismo02.ej01.ej01 import MiScraping
hilo = MiScraping("")

View File

@ -0,0 +1,20 @@
import threading
import requests
from bs4 import BeautifulSoup
import re
class MiScraping(threading.Thread):
def __init__(self,url):
threading.Thread.__init__(self)
self.url = url
self.links =[]
def run(self):
response = requests.get(self.url)
soup = BeautifulSoup(response.text,"html.parser")
self.links = [a['href'] for a in soup.find_all('a', href=True) if re.match(r'http[s]?://', a['href'])]
def get_links(self):
return self.links

View File

View File

@ -1,4 +1 @@
def my_function(*child):
print("The youngest child is " + child[1])
my_function("a","b")
print("Hello World!")