-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Guillaume Aubert
committed
Jun 25, 2010
1 parent
631c49d
commit df6fe7d
Showing
5 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>rodd</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.python.pydev.PyDevBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.python.pydev.pythonNature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<?eclipse-pydev version="1.0"?> | ||
|
||
<pydev_project> | ||
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property> | ||
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.6</pydev_property> | ||
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH"> | ||
<path>/rodd/src</path> | ||
</pydev_pathproperty> | ||
</pydev_project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Echo server program | ||
import socket | ||
|
||
HOST = '' # Symbolic name meaning the local host | ||
PORT = 9001 # Arbitrary non-privileged port | ||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
s.bind((HOST, PORT)) | ||
s.listen(1) | ||
print "listenning on %s , port = %d"%(HOST,PORT) | ||
while 1: | ||
conn, addr = s.accept() | ||
print 'Connected by', addr | ||
while 1: | ||
try: | ||
data = conn.recv(1024) | ||
print "received = ", data | ||
if data[:4] == "QUIT": | ||
conn.send("BYE BYE") | ||
conn.close() | ||
if not data: break | ||
conn.send(data) | ||
except : | ||
print "exception received" | ||
break | ||
conn.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import MySQLdb | ||
|
||
#conn = MySQLdb.connect (host = "localhost", user = "testuser", passwd = "testpass", db = "test") | ||
conn = MySQLdb.connect (host = "127.0.0.1", user="root", db = "rodd") | ||
cursor = conn.cursor () | ||
cursor.execute ("SELECT VERSION()") | ||
row = cursor.fetchone () | ||
print "server version:", row[0] | ||
cursor.close () | ||
conn.close () |