[Pythoneers] pythoneers meeting today at 11 in 1.4.27
Michael Hartl
hartl at mpe.mpg.de
Thu Mar 5 14:57:01 CET 2015
On 05.03.2015 10:19, mhabibi at mpe.mpg.de wrote:
> Hi all,
>
> We will have our pythoneers meeting in ~45 minute. Mike will
> tell us about his attempts to program Python sockets. Since the meeting
> rooms on our floor were full we can meet in the aquarium room third floor
> (1.4.27).
>
> Cheers,
>
>
Hi all,
please find enclosed the files from our todays meeting.
!!! PLEASE USE AT YOUR OWN RISK !!!
A few sources I used and copy/pasted/stole code snippets from:
THE authoritative (and - I think - most useful) reference:
https://docs.python.org/2/howto/sockets.html
And a few books on Python I found - more or less - useful:
W. Chun; Core Python Applications Programming
http://proquest.tech.safaribooksonline.de/book/programming/python/9780132779371
Network programming:
http://proquest.tech.safaribooksonline.de/book/programming/python/9780132779371/general-application-topics/ch02
D. Beazley; Python Essential Reference
http://proquest.tech.safaribooksonline.de/book/programming/python/9780768687040
D. Beazley; Python Cookbook
http://proquest.tech.safaribooksonline.de/book/programming/python/9781449357337
M. Lutz; Programming Python:
http://proquest.tech.safaribooksonline.de/book/programming/python/9781449398712
For sockets, see:
http://proquest.tech.safaribooksonline.de/9781449398712/id3918472
M. Hammond, and A. Robinson; Python Programming on Win32
For an intro to Windows COM, see:
http://proquest.tech.safaribooksonline.de/1-56592-621-8/ch05-88403
And, Python distributions for Windows:
Python(x,y):
https://code.google.com/p/pythonxy/
WinPython:
Versions <= 2.7.6/3.3.5:
http://winpython.sourceforge.net/
Versions >= 2.7.8/3.4.1
http://winpython.github.io/
WinPython might be installed in a local directory w/o registering the application.
Regards
Mike
-------------- next part --------------
{
"metadata": {
"name": "tcpclt"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": [
"from tcpclt import clt_open, clt_send, clt_requ, clt_close"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"Python TCP client demo\n",
"\n",
"DISCLAIMER: USE CODE AT YOUR OWN RISK!\n",
"!!! OPENS _HUGE_ SECURITY HOLE !!!\n",
"* work in progress\n",
"* no functional error handling, client disconnecting, etc.\n",
"* world read and writable ports\n",
"\n",
"2015-03-05 - Michael Hartl <hartl at mpe.mpg.de>\n",
"\n",
"Usage: tcpclt <host> <port>\n",
"\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"clt_open('localhost',8579)"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 3
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"clt_send('a = 7')\n",
"clt_send('b = 9')\n",
"clt_send('c = a*b')\n",
"clt_requ('c')"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "pyout",
"prompt_number": 4,
"text": [
"'63'"
]
}
],
"prompt_number": 4
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"clt_close()"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 5
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tcpclt.py
Type: text/x-python
Size: 2240 bytes
Desc: not available
URL: <https://lists.mpe.mpg.de/pipermail/pythoneers/attachments/20150305/a50a583b/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tcpsrv.py
Type: text/x-python
Size: 1512 bytes
Desc: not available
URL: <https://lists.mpe.mpg.de/pipermail/pythoneers/attachments/20150305/a50a583b/attachment-0001.py>
More information about the Pythoneers
mailing list