THE ZEPINT NETWORK

programmer assist

Python Python XML Feeds

Python Questions Python Solutions Python Articles

Python is an interpreted, interactive programming language created by Guido van Rossum in 1990. Python is fully dynamically typed and uses automatic memory management; it is thus similar to Tcl, Perl, Scheme, and Ruby. Python is developed as an open source project, managed by the non-profit Python Software Foundation. Python 2.4.1 was released on March 30, 2005.

Connecting to MQ using python

DiggBlinkRedditDeliciousTechnorati

question by ashraf ghannam | Moderate

Hello all python lovers,
Is there a way in which I can build a client that connects to IBM websphere MQ without using MQ client , I mean without using something like pymqi , I am thinking of something like sockets , a solution in C++ will be also ok.
Thanks

Post reply Subscriptions

Re: Connecting to MQ using python

reply by Bejaan

Here are some Socket examples:
>>> import socket
>>> mySocket = socket.socket ( socket.AF_INET, socket.SOCK_STREAM )
...
...
>>> mySocket.connect ( ( 'localhost', 2727 ) )
>>> mySocket.send ( 'William Shakespeare' )
>>> mySocket.recv ( 100 )
>>> mySocket.close()
...
...
import socket
mySocket = socket.socket ( socket.AF_INET, socket.SOCK_DGRAM )
mySocket.bind ( ( '', 2727 ) )
while True:
data, client = mySocket.recvfrom ( 100 )
print 'We have received a datagram from', client
print data
mySocket.sendto ( 'Green-eyed datagram.', client )
...
...
>>> import socket
>>> mySocket = socket.socket ( socket.AF_INET, socket.SOCK_STREAM )
>>> mySocket.sendto ( 'Wherefore art thou?', ( 'localhost', 2727 ) )
>>> data, server = mySocket.recvfrom ( 100 )
>>> print data


You can check out the actual docs at: http://docs.python.org/lib/module-socket.html

Post reply Subscriptions

Got a Python Question?

Just Sign Up and ask the top Python experts!

Search via Google

User Login

Email Address

Password

Leading Experts

Rank Expert Points
#1 frankzzsword 4650
#2 Bejaan 2950
#3 csfreak 1100
#4 Anurag 700
#5 keyvez 700
#6 nnarasimha 600
#7 Nakata 600
#8 martinig 600
#9 mastercomputers 550
#10 Abhishek Chatterjee 250
#11 Abels 250
#12 Huntress 150
#13 Adkron 150
#14 Yogesh 100
#15 lexxwern 100
This is a list of overall best performing experts, how many points do you have?