I am working with the VirtualBox python API and am trying to open a VM window in fullscreen mode. I have been unable to find an API command to do so, so I am trying to use the win32api to send a keyboard command of F8+f (F8 is my host key since there is no SendKeys code for Right Control) to the application, but am not succeeding in this endeavor. My code follows, any ideas?
import time,win32api,win32con,win32com
shell = win32com.client.Dispatch("WScript.Shell")
#The title of the application was copied from the Task Manager
shell.AppActivate("fed (Snapple) [Running] - Oracle VM VirtualBox")
win32api.Sleep(100)
shell.SendKeys("({F8}f)")
hey check this out ..may be it helps you..
This is pyVBOX, a shim layer above the VirtualBox Python API.
Why? Becuase the VirtualBox Python API is somewhat complex and I got
tried of trying to remember all the details of its use. Plus it
changes from release to release and this gives me an abstraction layer
to hide those changes. The software also includes a script,
utils/pyVbox.py, that provides the ability to manipulate VMs (like
VBoxMange).
This code is written to the 4.1 version of VirtualBox (4.1.12
specifically). I have not tried it against any other version.
This software is independently created from VirtualBox and Oracle. No
endorsement by Oracle or the VirtualBox authors is implied.
pyVbox
Related
I have PyCharm on my machine (8GB RAM). I am required to to heavy data processing, and would like to use an institutionally provided server. This server has Python installed, but without any IDE. So all I see is a CUI, and it is difficult to program in such an environment.Also note that I cannot ask server admin to install software on the server for me. So, how can one connect one's local PyCharm to a python installed on a remote server? Is this even possible?
You can configure an interpreter using SSH:
Open the Add Python Interpreter dialogue
In the left-hand pane of the Add Python Interpreter dialogue, click SSH Interpreter.
Follow the wizard.
For more detailed instructions, check:
https://www.jetbrains.com/help/pycharm/configuring-remote-interpreters-via-ssh.html
Note: unfortunately, this option is not available in the PyCharm Community Edition.
I've got Mac OSX running and want to programmatically manipulate a active RDP session to for instance, perform actions within a launched program within the session (dynamics specifically, yet woudn't hurt to know a universal way).
I don't know if this is possible. Currently using a RDP file to launch the RDP session with credentials and have the process ID of my active session, retrieved via NSWorkspace. With that I can do the basic stuff like closing my session again, yet i want to manipulate the session.
My RDP client currently is Microsoft Remote Desktop.
Would wish to reach my goal in either bash or python.
Here are few ideas:
Use Quartz graphics library in Python to manipulate with RDP client window. Here is a good start: How to list all windows from all workspaces in Python on Mac?
Use libfreerdp via ctypes.
Run RDP session under Wine and use tools such as AutoHotKey, AutoIT or xdottool. See: How to programmatically control X11 forwarded apps?
Use WinRM (pywinrm) instead of RDP to run remote commands/scripts. Check this example. This can allow to run auto tools mentioned above (e.g. AHK script controlling the apps).
Use Python GUI automation library for simulating user interaction in apps.
See also: GUI scipting for Linux.
Write an RDP client that dumps the pixels of the screen. E.g. WebRTC or using libFreeRDP.
If RDP client runs via X11 protocol (Quartz), you can try to tap into X11 requests as per this post.
Use FreeRDP and its API. Its client is compatible with Linux, macOS and Windows.
Background - What I would like to do is to be able to push buttons on a BT sensor and trigger some actions like tweet or play a particular sound etc. I have a TI CC2541 Sensortag that I would like to control with a python program.
Issue - I am unable to get Mac OS X bluetooth to recognize the BLE on TI Sensortag.
Attempts - I installed lightblue which recognizes the sensor. But I am not sure how that can help control the sensor programmatically.
I heard about Bluez in my research, but I guess it is related to linux only systems. I have used Evothings and that can connect to the sensortag through my phone on the same network. I can make small changes to the javascript on evothings studio to capture events from the Sensortag and affect changes on the evothings app.
I am trying to get my Mac to recognize the BLE Sensortag after which I can control the device programmatically. Do I need to buy one of these pluggable BLE dongles to get this to work? OR am I attempting something wrong.
Please advise.
Oh I see now, I can help you with that.
Here's your recipe to success:
Make sure that your hardware supports BLE 4.x (yours does)
Link your tag through the preferences/Bluetooth widget
Check with lightblue app that you can connect or read some values
If all the above checks out, and it should given the information you provided, then at hardware level you're golden.
At software level, there are many ways to connect and retrieve data. You can use XCODE and build a native OSX app or you can build a NodeJS app to retrieve data from the tag.
On this blog post you find all you need for the Node scenario. It is documented for the Raspberry Pi however, the code for running this elsewhere, including OSX, is exactly the same
The code is hosted here and I keep it up to date as I make more advancements.
https://github.com/kywix/iamsblog/tree/master/SensorTag
Shortly:
Open terminal and git clone that repo
cd into the folder SensorTag
type npm install (to install all the libraries necessary)
node logger.js to run the basic example
turn on your device
btw on the same repo you will find python code as well. I blog regularly about the Sensor Tag.
I will make note of creating a post just for folks like you that seek this type of info, I have been there..
I am currently developing an open source software based on python/django. The software should later be easy installable by a standard windows/linux users without any programming experiance. It should also be portable to different computers. The only installation that should be required on these computers should be python itself.
Is there a way to get this to work?
I already found this "dbuilder" Django Projects as Desktop applications : how to?
desktop-applications-how-to
It seems to be a bit outdated and not a very smooth solution.
Are there better solutions?
Just use a portable version of python on your memory stick. Make a batch file that runs
projname.bat file:
python.exe /django-app-path/manage.py runserver
now open a browser and browse for it
the default address will be:
http://127.0.0.1:8000
If you need to browse your app on other device that you're app is running:
get your server ip with
windows shell>ipconfig
linux shell# ifconfig
then run your development server on that address (in the batch file):
python.exe /django-app-path/manage.py runserver your-ip-address:port-if-not-80
Is there a way to automate an old DOS application (16-bit, probably needs an emulator such as DOSBox) from Python (on Windows)? I would like to send keys and strings to the application, detect updates to the DOS "screen" and get the application output.
It would be even better if the DOS application could run "hidden", i.e., not showing in the taskbar.
Note: It is not a game, it is one of those old application where you are given menus with press 1 for something, press 2 for something else, etc... then it asks for some input numbers, and then it shows some results. It is a pure console application.
Note2: It doesn't need to use DOSBox necessarily... could be done with other emulators such as Bochs
I'm not familiar with DosBOX or whether it has an external API. However, for Sun VirtualBox there is a python API, so if it is OK to run DOS on a VM, you could easily use the VirtualBox Python API to control & automate the application you run on the DOS.
You can download the VirtualBox SDK here