#socket connection and threading within python
65 messages · Page 1 of 1 (latest)
https://realpython.com/intro-to-python-threading/
@fluid hollow
Sure you can come up with something after reading this.
that is complex
Yeah
You should make simpler stuff before than jumping to your goal too quickly
im trying to wrap my head around it
i dont know if its neccesary for all those functions
The thing you have to focus on rn is the .start i guess. I am ignorant regarding threadings. There are some projects to help you improve in this concept
T.tag projects
Tim started a series covering beginner python projects recently, see that here https://www.youtube.com/watch?v=7R-CfL21zIY for more project ideas type "t.tag project 1" in #bot-commands without the quotes (there are 8 projects as of now, "t.tag project 2", etc.). There will not be a premade project for everything so I recommend trying to think of something you want to do and coming up with your own projects that will teach you. There are also coding practice websites you can find on google with small example problems for practice. We also host weekly coding challenges and code jams here, see #challenge for the weekly challenges and #code-jams for the code jams.
One of them is on threading as far as i remember.
im watching the video now
the thing im trying to do is have socket connection handled by threads
is a new thread required for each new connection?
how to spawn a new thread
when a new connection connects to server
tim made a video on sockets and threads but it was only 1 thread
which is somewhat right because only 1 thread can run at one time
@fluid hollow can u send the code if u dont mind
Ig u can just create several thread instances and start them?
Not sure cuz i havent tinkered with it but i have seen others' code and sorta be like this
Here's a list of pastebin alternatives that don't suck.
https://gist.github.com
https://paste.pydis.com
https://mystb.in
For large projects, use https://github.com
yea no worries
<script src="https://gist.github.com/dariusss185/56df85dd9a9d9ecd51010bf6174fd91d.js"></script>
server
<script src="https://gist.github.com/dariusss185/9388fdf4953c43a985e9c3438aa5e9a6.js"></script>
client
Giving 404 error
Not found actually
that should work now
sever client
so to build on the communication i have another file which implements file download and upload
So you want
Like everytime it connects you want to still being able to input
Not possible, but you can probably uhhh use a function
I want only the server to send commands out and for clients to respond to those commands accordingly
You enter info first. And then connect all in the same time
i got it done with just 1 client
Then what are threads for
Threading concept in a simple way to say, its running things at the same time. So see where you need this
Wrong
thats what he said in video