net send con python
Marcos Sánchez Provencio
rapto en arrakis.es
Jue Abr 14 21:08:35 CEST 2005
Prueba esto (desde win, desde lin es mejor system y smbclient:
# -*- coding: iso-8859-15 -*-
'Ver documentación en http://djernaes.dk/martin/winpopup.html'
import win32file
def isoCp437(s):
return unicode(s,'iso8859-15').encode('cp850')
def mandaWinpopup(servidor,usuRemite,usuDestino,mensaje):
Handle = win32file.CreateFile(r"\\%s\mailslot\messngr" % servidor,
win32file.GENERIC_WRITE,
win32file.FILE_SHARE_READ,
None,
win32file.OPEN_EXISTING,
win32file.FILE_ATTRIBUTE_NORMAL,
-1)
Data='%s\x00%s\x00%s\x00' % (isoCp437(usuRemite),isoCp437(usuDestino),isoCp437(mensaje))
win32file.WriteFile(Handle,
Data)
win32file.CloseHandle(Handle)
if __name__=='__main__':
mandaWinpopup(servidor='burke',usuRemite='Marcos Sánchez',usuDestino='ñÁaáéúóö',mensaje='Caña')
El jue, 14-04-2005 a las 20:07 +0200, Abel Aranda escribió:
> Buenas, querría saber si existe alguna librería de python que me permita
> realizar algo similar al net send de windows, o la manera de utilizar en
> python comandos del sistema operativo.
>
> Muchas gracias y a ver si alguien me puede echar una mano
>
> Un Saludo
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Abel Aranda Arriscado
> Administrador
> CEDAS
>
> Centro de Datos, Administración y Soporte
> e-mail: abel.aranda en salud.madrid.org
> tfno: 91 4265549, móvil: 670726950
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> El contenido de esta comunicación debe considerarse privado y
> confidencial. Si Vd. no es el destinatario y la hubiere recibido por
> error, se le informa que cualquier divulgación, distribución o copia de
> esta comunicación está estrictamente prohibida; por favor, notifíquelo
> inmediatamente al remitente y elimine este mensaje.
>
> This Email is intended for the exclusive use of the addressee only. If
> you are not the intended recipient, you should not use the contents nor
> disclose them to any other person and you should immediately notify the
> sender and delete the Email.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> _______________________________________________
> Python-es mailing list
> Python-es en aditel.org
> http://listas.aditel.org/listinfo/python-es
Más información sobre la lista de distribución Python-es