How to run MobileWorks with Python at Windows?

I need to get MobileWorks running with Python at Windows. Therefore I have a couple of questions: <ul> <li>What are the necessary steps to do?</li> <li>What do I have to install?</li> <li>In which order do I have to install which tool?</li> </ul>
1 answer

Run MobileWorks with Python at Windows

  • Download and install Python (Version 2.7.5), DO NOT download Python 3.x, mobileworks does not work with it.
  • Download distribute 0.6.49, extract the zip to any arbitrary path. After extracting the files, switch to the distribute folder and run the following command:

    >> python distribute_setup.py
    After the setup has finished successfully, there should exist a “Scripts” folder in your python installation path. E.g.”C:\Python27\Scripts”

  • Switch to the “Scripts” folder und run the following command:

    >> easy_install.exe pip
    Now should have successfully installed the python paketmanager – pip.

  • As last step you now should get the mobileworks package by executing the following command:

    >> pip install mobileworks
    After the installation succeeded you are able to execute your mobileworks code the following way:

  • >> pyton file1.py

Example file: file1.py

# import the MobileWorks library
import mobileworks as mw
# to switch to the sandbox
mw.sandbox()
# provide your username/password
mw.username = 'username'
mw.password = 'password'
# create a task object
t = mw.Task(instructions="This question is created with Python2.7")
# set some parameters
t.set_params(resource="some_param")
# add the required fields
t.add_field("Name", "t")
# finally, post it and get the url of the newly created task
task_url = t.post()
print task_url

[I had this problem a while ago and solved it this way. You can find my original blog post at http://www.manuelmertl.com/mobileworks-python-windows/]

Taggings: