Fwd: Sockets: Receiving C Struct

2011-08-05 Thread Johnny Venter
I was not sure if this message was sent before my membership was accepted.

Please disregard if it's a duplicate.

Thanks

Begin forwarded message:

> From: Johnny Venter 
> Date: August 5, 2011 8:15:53 AM EDT
> To: python-list@python.org
> Subject: Sockets: Receiving C Struct
> 
> New to python and would like to test network/sockets with it.
> 
> I am having a problem where I have setup the following:
> 
> import socket, sys, struct
> 
> HOST = '1.1.1.1'
> PORT = 153
> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> s.connect((HOST, PORT))
> 
> data = struct.unpack('!I',s.recv(4))[0]
> 
> s.close()
> 
> print data
> 
> 
> What I would like to do is take the input from the server, and store it in an 
> array.  The type of data is int.
> 
> Can someone help?
> 
> 
> Thanks, Johnny
> 



PGP.sig
Description: This is a digitally signed message part
-- 
http://mail.python.org/mailman/listinfo/python-list


Sockets: Receiving C Struct

2011-08-05 Thread Johnny Venter
New to python and would like to test network/sockets with it.

I am having a problem where I have setup the following:

import socket, sys, struct

HOST = '1.1.1.1'
PORT = 153
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))

data = struct.unpack('!I',s.recv(4))[0]

s.close()

print data


What I would like to do is take the input from the server, and store it in an 
array.  The type of data is int.

Can someone help?


Thanks, Johnny



PGP.sig
Description: This is a digitally signed message part
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Windows Extensions for Mac

2011-08-20 Thread Johnny Venter
Thank you all for the replies. I would like to query various Windows' objects 
and resources from Mac and/or Linux such as Active Directory users, network 
shares, group members, etc... What module or methods can I use with python to 
accomplish this? 

I found dcerpc might be the way to go. 

On Aug 20, 2011, at 1:39 PM, Kevin Walzer  wrote:

> On 8/19/11 4:02 PM, johnny.venter wrote:
>> 
>> Hello, I am looking for the Python Windows Extensions to see if they can be 
>> installed on a Mac.THanks.
>> 
> 
> You can certainly try to install them via easy_install, I supposed, but it's 
> doubtful they would do anything, as the Mac does not support win32 API calls 
> any more than Windows supports Cocoa/Objective-C calls.
> 
> -- 
> Kevin Walzer
> Code by Kevin
> http://www.codebykevin.com
> -- 
> http://mail.python.org/mailman/listinfo/python-list

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Windows Extensions for Mac

2011-08-20 Thread Johnny Venter
Yes, I want to make my queries from a remote non-Windows computer. Here is the 
scenario:

>From my mac, I want to use python to access and read objects from a remote  
>Windows computer joined to a Windows 2003 functional level domain. Given this, 
>what is the best way to accomplish this?


On Aug 20, 2011, at 7:57 PM, Chris Angelico  wrote:

> On Sun, Aug 21, 2011 at 12:51 AM, Johnny Venter  
> wrote:
>> Thank you all for the replies. I would like to query various Windows' 
>> objects and resources from Mac and/or Linux such as Active Directory users, 
>> network shares, group members, etc... What module or methods can I use with 
>> python to accomplish this?
>> 
> 
> The concept doesn't have meaning on a non-Windows computer, so I am
> going to take the liberty of assuming that you really want to query
> them from a different computer - some kind of network query. If that's
> not the case, can you clarify exactly what your setup is?
> 
> Chris Angelico
> -- 
> http://mail.python.org/mailman/listinfo/python-list

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Learning Python

2011-08-23 Thread Johnny Venter
http://greenteapress.com/thinkpython/

On Aug 23, 2011, at 10:46 PM, User wrote:

> Hello all,
> Does anyone have any good resources for learning Python? I know basic Java 
> and basic Python (loops, data types, if-then statements, etc), but I want to 
> delve into Python further. If anyone knows of any good books, video 
> tutorials, etc it would be greatly appreciated.
> Thanks,
> User
> -- 
> http://mail.python.org/mailman/listinfo/python-list

-- 
http://mail.python.org/mailman/listinfo/python-list