On 12/02/13 04:27, richard kappler wrote:
ports to a python program on the laptop. Someone suggest using sockets,
with which I am completely unfamiliar. I've read the socket docs and
admit I find them quite confusing. Can someone point me to a/some good
beginner tutorials on sockets/networking f
On Mon, Feb 11, 2013 at 11:27 PM, richard kappler wrote:
> I've read the socket docs and admit I find them quite confusing. Can someone
> point me to a/some good beginner tutorials on sockets/networking for me to
> look at?
Try Doug Hellmann's Python Module of the Week:
http://www.doughellmann.c
I want to be able to communicate between a raspberry pi and a laptop
running ubuntu, transferring text from the pi to the laptop. Specifically
the Pi would be running poscketsphinx speech rec and would send the
generated text through the crossover between the two ethernet ports to a
python program
> Look at the example in my tutorial. It doesn't use threads but
What is the link for the tutorial?
In my sig.
Go to the V2 version and look for the Network Programming topic.
> what is a context? I dealt with them a lot in Android programming
Nothing to do with Android contexts I'm simply u
On 6/4/10, Alan Gauld wrote:
>
> "Alex Hall" wrote
>
>> connect to you as a client. It appears, though, that I need a loop
>> to
>> have a server make any sense at all, to handle incoming data and
>> connection requests.
>
> You need to listen then process incoming messages then listen some
> mor
"Alex Hall" wrote
connect to you as a client. It appears, though, that I need a loop
to
have a server make any sense at all, to handle incoming data and
connection requests.
You need to listen then process incoming messages then listen some
more, so yes you will need a loop. Probaqbly an i
Thanks for the suggestions, everyone. For now, more as a way to
introduce myself to all this, I am going to have my program
automatically start a server and pop up that server's ip. Then, if you
want, you can type in an ip and connect to the server at that ip
(ports are hard-coded at ). That wa
On Thu, 3 Jun 2010 18:03:34 -0400
Alex Hall wrote:
> Hi all,
> I am a CS major, so I have had the required networking class. I get
> the principles of networking, sockets, and packets, but I have never
> had to actually implement any such principles in any program. Now I
> have this Battleship ga
"Alex Hall" wrote
*somehow, your instance of the program starts up a server that
broadcasts something; your enemy has selected "client", and is now
(SOMEHOW) listening for the signal your server is broadcasting
*the signal is picked up, and, SOMEHOW, you and your opponent
connect
and can sta
Hi all,
I am a CS major, so I have had the required networking class. I get
the principles of networking, sockets, and packets, but I have never
had to actually implement any such principles in any program. Now I
have this Battleship game (not a school assignment, just a summer
project) that I am t
"Linus Nordström" <[EMAIL PROTECTED]> wrote
> im having problem whit recv. It will not break the loop if ther are
> nothing more to recive.
Take a look at the client side of the address book
example in my network profgramming topic. It shows
an example of breaking out of a recv loop.
Another opt
gusse i use this thread as my own little help thread.. :)
im having problem whit recv. It will not break the loop if ther are
nothing more to recive. It dose recv all tit should, but then it go
another round in the loop and get stuck on recv, as far as print
debugging has showed, Dont realy know
Oh, thank you, exactly what i was looking for :)
On 6/18/07, Andreas Kostyrka <[EMAIL PROTECTED]> wrote:
> Tip: consult the documentation of the struct module.
>
> Andreas
>
> -- Ursprüngl. Mitteil. --
> Betreff:[Tutor] sockets
> Von:"Linus Nordst
Tip: consult the documentation of the struct module.
Andreas
-- Ursprüngl. Mitteil. --
Betreff:[Tutor] sockets
Von:"Linus Nordström" <[EMAIL PROTECTED]>
Datum: 17.06.2007 22:47
Hello
I'm trying to rewrite a chat-program i did in school this spring
Hello
I'm trying to rewrite a chat-program i did in school this spring in
python, the school program was in java. All this to leran python.
Anyway. I m trying to send a message using udp to a server that
conntains the message 3 0 0 0, it has to be in network byte order and
unsigned. I have tried t
server = SocketServer.TCPServer( ('', 79), FingerHandler)
server.serve_forever()
Matt wrote ---
Date: Thu, 04 May 2006 09:23:38 -0700
From: Matt Richardson <[EMAIL PROTECTED]>
Subject: Re: [Tutor] sockets
To: Tutor@python.org
Message-ID: <[EMAIL PROTECTED]>
Content-Type: tex
Matt Richardson wrote:
> I need to send some data, 2 strings and a list, to a remote computer.
> After thinking about it some last night, it wouldn't be hard to just
> send it all as a string and then parse it on the receiving end.
Well if the excercise itself is not parsing a string, you can ju
Kent Johnson wrote:
>
> This would be very easy to do with XML-RPC. On the server side, writ a
> function that takes three parameters - the IP address, MAC address, and
> traceroute dump - and saves them to a database. Use SimpleXMLRPCServer
> to expose the function. On the client side, gather
Matt Richardson wrote:
> I need to send some data, 2 strings and a list, to a remote computer.
> After thinking about it some last night, it wouldn't be hard to just
> send it all as a string and then parse it on the receiving end.
>
> I'm writing a program for work (and for a class project, so
I need to send some data, 2 strings and a list, to a remote computer.
After thinking about it some last night, it wouldn't be hard to just
send it all as a string and then parse it on the receiving end.
I'm writing a program for work (and for a class project, so no answers!)
that will provide s
Matt Richardson wrote:
> Just verifying what I looked up earlier: are strings and binary
> (through struct.pack) the only data types that can be sent through a
> socket? This is my first crack at socket programming, so I'll probably
> have lots of questions to bug you with.
The socket library
Just verifying what I looked up earlier: are strings and binary
(through struct.pack) the only data types that can be sent through a
socket? This is my first crack at socket programming, so I'll probably
have lots of questions to bug you with.
thanks,
Matt
__
Danny! I couldn't resist trying threading again, now that the
mysterious single-threading behavior is gone.
I didn't put any locks anywhere.
And it runs like a champ.
Like a super champ.
Either I had to put back threading or I had to make a family of
socket-readers, or lose some functionality
On Wed, 19 Jan 2005, Danny Yoo wrote:
> On Wed, 19 Jan 2005, Marilyn Davis wrote:
>
> > class Exim:
> > def __init__(self):
> > self.fdin = None
> > self.err_flush = []
> > self.stdout, self.stdin, self.stderr = popen2.popen3('%s -t' %
> > MAILER)
> > se
On Wed, 19 Jan 2005, Marilyn Davis wrote:
> class Exim:
> def __init__(self):
> self.fdin = None
> self.err_flush = []
> self.stdout, self.stdin, self.stderr = popen2.popen3('%s -t' %
> MAILER)
> self.fdin = self.stdin.fileno()
> self.fdout = s
Thank you Kent.
On Wed, 19 Jan 2005, Kent Johnson wrote:
> Marilyn Davis wrote:
> >>few lines up, right where 'client_socket' is initialized. Like this:
> >>
> >>###
> >>try:
> >>client_socket, client_addr = self.server_socket.accept()
> >>Spawn(client
>
> > What about when I do an explicit call to a close inside a __del__. Is
> > that a bad idea?
>
> I usually prefer to add a close() method to my objects that releases
> resources, rather than __del__(), because it's more visible.
>
OK Danny! I found it! When I was almost asleep last night
Marilyn Davis wrote:
few lines up, right where 'client_socket' is initialized. Like this:
###
try:
client_socket, client_addr = self.server_socket.accept()
Spawn(client_socket).start()
except socket.error, msg:
time.sleep(.5)
On Tue, 18 Jan 2005, Marilyn Davis wrote:
> while 1:
> if log.level & log.calls:
> log.it("fd%d:py_daemon.py: Waiting ...", self.descriptor)
> try:
> client_socket, client_addr = self.server_socket.accept()
> except (EOF
Thank you so much Danny. I know how hard it is to look at and comment
on other people's code. You know I teach C and Python and I have to
say, though, that reading students' Python is 100 times easier than
reading their C.
And, I hope you're feeling better. I hate to think of you struggling
thr
On Tue, 18 Jan 2005, Danny Yoo wrote:
> In fact, as far as I can tell, none of the Spawn() threads are
> communicating with each other. As long as your threads are working
> independently of each other --- and as long as they are not writing to
> global variables --- you do not need locks.
>
>
Hi Marilyn,
[Long program comments ahead. Please forgive me if some of the comments
are overbearing; I'm trying to get over a cold, and I'm very grumpy.
*grin*]
Some comments on the code follow. I'll be focusing on:
> http://www.maildance.com/python/doorman/py_daemon.py
One of the import
On Sat, 15 Jan 2005, Danny Yoo wrote:
>
>
> > I have only wrapped my lock around file-descriptor creations. Should I
> > wrap it around closings too? Or the whole open -> close transaction?
> > It sounds like error-prone work to do the latter. What am I missing?
>
> Hi Marilyn,
>
> Can you
> I have only wrapped my lock around file-descriptor creations. Should I
> wrap it around closings too? Or the whole open -> close transaction?
> It sounds like error-prone work to do the latter. What am I missing?
Hi Marilyn,
Can you send a link to the source code to the Tutor list? I'm ge
p.p.s.
I have only wrapped my lock around file-descriptor creations. Should
I wrap it around closings too? Or the whole open -> close
transaction? It sounds like error-prone work to do the latter. What
am I missing?
What should I be reading to get a better clue?
I'll do some googling.
Thank
Dearest Tutors,
Bah! It's not over yet. I don't know why, but again my file
descriptors are being trampled upon now and then.
This time I can see in my log that I'm not trampling on them myself,
like I used to do, unless I'm making calls to the system that I'm not
aware of.
And, first I get th
Whew! What a trip this bug has been!
Danny was exactly right here:
> is exactly the sort of thing I'd expect if two threads were
> contending for the same resource, so let's see if the bug has to do
> with this.
This bug drove me nuts. (it's a short drive)
So I started wrapping my file open
> Where did my 'ooo' go?
>
> #! /usr/bin/env python
> import os
>
> fobj = open('/tmp/xxx','w')
> fobj.write('ooo\n')
fobj.flush()
File objects use buffered IO and by changing from using file
objects to file descriptors half way through the buffer
could be in any state. You need to flush() to
On Wed, 12 Jan 2005, Marilyn Davis wrote:
> I was looking at my use of file objects and file descriptors and I wrote
> this sample program and was very surprised by the result -- which makes
> me think there's something here that I don't understand. Where did my
> 'ooo' go?
>
> #! /usr/bin/env p
On Wed, 12 Jan 2005, Danny Yoo wrote:
Thank you so much for thinking about this Danny.
> > When stuff was read from the exim socket, it was stored in a tempfile,
> > so that I could release the exim process, then I lseek to the front of
> > the tempfile and have it handy. I see from all my debu
> Just double checking something: are you dealing with threads?
Hi Marilyn,
Argh, that was a dumb question. Pretend I didn't ask it that way.
*grin*
I meant to ask:
How do you deal with threads? Is the temporary file a global resource
that the threads all touch? If so, have you done any sy
On Wed, 12 Jan 2005, Marilyn Davis wrote:
> When stuff was read from the exim socket, it was stored in a tempfile,
> so that I could release the exim process, then I lseek to the front of
> the tempfile and have it handy. I see from all my debugging and logging
> that the file descriptor for th
Hello Tutors,
I've been banging my head against this bug for 4 days.
I can't think of how to ask for help except to give a birds eye view
of the situation.
I have a python daemon that is listening on a UNIX socket for
communication with exim, my Mail Transfer Agent.
Each mail message has its ow
43 matches
Mail list logo