473,396 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

cross platform libraries

I am using python on a linux terminal.

I want to shutdown a remote windows box. I found a script which does
something like this. My question is can we use windows libraries in
linux as follows ....

import win32api
import win32con
import win32netcon
import win32security
import win32wnet

def shutdown(parameters):
OTHER CODE HERE

Every help is appreciated.

May 4 '06 #1
7 997
No! That's not the way things work. Such code needs to run locally (in
this case, Windows). You can run this program as a daemon on Windows
with some nice simple remote interface (Eg: xmlrpc) and send a message
to trigger the shutdown.

May 5 '06 #2
Hi Ravi,

Do you have any idea how to perform such triigers ?
Every help is appreciated.
Ravi Teja wrote:
No! That's not the way things work. Such code needs to run locally (in
this case, Windows). You can run this program as a daemon on Windows
with some nice simple remote interface (Eg: xmlrpc) and send a message
to trigger the shutdown.


May 5 '06 #3
I went to this webpage

http://aspn.activestate.com/ASPN/Coo.../Recipe/360649

Isn't it supposed to run on the network and close the connected
machine.

Every help is appreciate,
Dennis Lee Bieber wrote:
On 4 May 2006 09:57:15 -0700, di********@gmail.com declaimed the
following in comp.lang.python:
I am using python on a linux terminal.

I want to shutdown a remote windows box. I found a script which does
something like this. My question is can we use windows libraries in
linux as follows ....

import win32api
import win32con
import win32netcon
import win32security
import win32wnet

That set... HIGHLY UNLIKELY... They all rely upon having the M$
kernel DLLs available...

Now, if the remote box is running a telnet server, you might be able
to telnet over (logging in as the boxes admin account) and initiate a
shutdown from it... (I seem to have a "shutdown.exe" on my system).
--
Wulfraed Dennis Lee Bieber KD6MOG
wl*****@ix.netcom.com wu******@bestiaria.com
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: we******@bestiaria.com)
HTTP://www.bestiaria.com/


May 5 '06 #4
di********@gmail.com wrote in
news:11**********************@g10g2000cwb.googlegr oups.com:
I went to this webpage

http://aspn.activestate.com/ASPN/Coo.../Recipe/360649

Isn't it supposed to run on the network and close the connected
machine.
That code uses the windows libraries on the machine it is run on to
generate a request to the networked machine to shutdown. The code
executes locally and sends the request over the network.
Every help is appreciate,


If you have some way of remotely running programs on the windows
machine(ssh, telnet, etc.), you might try pstools:

http://www.sysinternals.com/Utilities/PsTools.html

specifically, psshutdown.

max

May 5 '06 #5
Can we have some program in Linux which shuts down the windows computer
remotely.

Every help is appreciated.
Max Erickson wrote:
di********@gmail.com wrote in
news:11**********************@g10g2000cwb.googlegr oups.com:
I went to this webpage

http://aspn.activestate.com/ASPN/Coo.../Recipe/360649

Isn't it supposed to run on the network and close the connected
machine.


That code uses the windows libraries on the machine it is run on to
generate a request to the networked machine to shutdown. The code
executes locally and sends the request over the network.
Every help is appreciate,


If you have some way of remotely running programs on the windows
machine(ssh, telnet, etc.), you might try pstools:

http://www.sysinternals.com/Utilities/PsTools.html

specifically, psshutdown.

max


May 5 '06 #6
Through Wine maybe ?

Philippe
Dennis Lee Bieber wrote:
On 4 May 2006 09:57:15 -0700, di********@gmail.com declaimed the
following in comp.lang.python:
I am using python on a linux terminal.

I want to shutdown a remote windows box. I found a script which does
something like this. My question is can we use windows libraries in
linux as follows ....

import win32api
import win32con
import win32netcon
import win32security
import win32wnet

That set... HIGHLY UNLIKELY... They all rely upon having the M$
kernel DLLs available...

Now, if the remote box is running a telnet server, you might be able
to telnet over (logging in as the boxes admin account) and initiate a
shutdown from it... (I seem to have a "shutdown.exe" on my system).
--
Wulfraed Dennis Lee Bieber KD6MOG
wl*****@ix.netcom.com wu******@bestiaria.com
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: we******@bestiaria.com)
HTTP://www.bestiaria.com/


May 5 '06 #7
Not much to it. Just follow the SimpleXMLRPCServer example from Python
docs and register your shutdown function. Call it using xmlrpclib
remotely.

Actually, I prefer the telnet method below. Simple and straight forward.

May 6 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jonathan P. | last post by:
....that would be for desktop-based apps, games, 3d graphics, and multimedia. ....thanks to APIs and bindings like Pygame, PyOpenGL, PyGtk and PyGtkGLExt. A summary of a lengthy post on the...
5
by: Clark K | last post by:
Hi all experts, Perhaps this subject is OT here, if so please ignore this post! I have developed a commercial application for the windows environment in C++ and it have come out good in this...
1
by: Paul Tremblay | last post by:
Hi All, I am writing an application framework which consists of classes mainApp and childApp (parent, child resp). My intention is to make childApp a base class to be extended by applications...
5
by: sandwich_eater | last post by:
I am looking for a Linux distribution and a standard C++ compiler (IDE not too important) that can also compile to Win32, to run on my Dell dimension 2400... I have trouble with new distros since...
35
by: Alex Martelli | last post by:
Having fixed a memory leak (not the leak of a Python reference, some other stuff I wasn't properly freeing in certain cases) in a C-coded extension I maintain, I need a way to test that the leak is...
1
by: RShadow | last post by:
ok, this is going to drive me crazy. I did this a long time ago, but forgot how it I got it all to work. Now I just can't get anything to work. Can somebody please refer me to an example, book...
1
by: Simon | last post by:
Is there a simple, cross-platform method of downloading an URL. I can in Python by typing: data = urllib2.urlopen('www.example.com/example file.html').read() and I was wondering if there was...
5
by: Michael Reichenbach | last post by:
After working with script languages, notepad(++) and co. and several other ide`s I found something which really improved my productivity (Visual Studio 2005). It`s imho better then dev-cpp... I...
12
by: Tomás Ó hÉilidhe | last post by:
I don't know the first thing about cross-platform GUI programming, so I'd like to ask a few quick questions. Which library is best for someone who appreciates portable programming and correct...
42
by: =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= | last post by:
I'm currently writing a program and I've got in mind to keep it as portable as possible. In particular I want it to run on Linux and Windows, but I'm also keeping an open mind to any machine that...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.