print("Before diving into any module, use help() to get documentation:") print(" help(socket) - Shows all socket module functions and classes") print(" help(datetime ...
普段趣味でプログラミングをぼちぼちやってます。 その中で勉強した事を素人なりにnoteにまとめています。 これからプログラミングを始めてみよう!と思っている人や、プログラミング初心者の人など、色んな人の役に立てば良いなと思っています。
Pythonは特にAI(人工知能)分野で注目されているが、他にも様々な種類のプログラムを書くことができる。例えば、Webサーバーなどのネットワークソフトも書ける。 TCP/IPで通信するネットワークソフトをPythonで作る場合は、基本的にはsocketモジュールを使う。
第12回は少し趣向を変えて、ネットワークサーバのHello Worldです。具体的には、socketを使って所定のTCPのポートへの接続を待ち受け、そのポートへの接続が行われると、接続相手のクライアントに対してHello Worldのメッセージを返すようなプログラムを作成し ...
Uses multi-threading to handle multiple clients simultaneously. Listens for incoming connections and prints out client messages. Cleanly disconnects clients when the "Disconnect" message is received.
Once you know how to add and use a Python module, you will greatly extend the capabilities of the language. A Python module is an external class or set of functions that exist outside the main file of ...