diff --git a/README.md b/README.md index 2fe8e32f..0ac6a346 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # RfemPythonWsClient -![image](https://img.shields.io/badge/COMPATIBILITY-RFEM%206.00-yellow) ![image](https://img.shields.io/badge/Python-3-blue) ![image](https://img.shields.io/badge/SUDS-0.3.5-orange) +![image](https://img.shields.io/badge/COMPATIBILITY-RFEM%206.00-yellow) ![image](https://img.shields.io/badge/Python-3-blue) ![image](https://img.shields.io/badge/SUDS-0.3.5-orange) ![image](https://img.shields.io/badge/xmltodic-0.12.0-orange) Python client (or high-level functions) for [RFEM 6](https://www.dlubal.com/en/products/rfem-fea-software/what-is-rfem) using [Web Services](https://en.wikipedia.org/wiki/Web_service) (WS), [SOAP](https://cs.wikipedia.org/wiki/SOAP) and [WSDL](https://en.wikipedia.org/wiki/Web_Services_Description_Language). Available Python SOAP pkgs can be found on [wiki.python.org](https://wiki.python.org/moin/WebServices#SOAP). diff --git a/RFEM/initModel.py b/RFEM/initModel.py index e85d8271..f1829628 100644 --- a/RFEM/initModel.py +++ b/RFEM/initModel.py @@ -1,7 +1,5 @@ import sys from RFEM.enums import * -import xmltodict -import csv #import json #import xml.etree.ElementTree as ET @@ -80,6 +78,31 @@ input('Press Enter to exit...') sys.exit() +try: + import xmltodict +except: + print('xmltodict library is not installed in your Python env.') + instXML = input('Do you want to install it (y/n)? ') + instXML = instXML.lower() + if instXML == 'y': + # Subprocess will be opened in cmd and closed automaticaly after installation. + # Prevents invoking pip by an old script wrapper (https://github.com/pypa/pip/issues/5599) + import subprocess + try: + subprocess.call('python -m pip install xmltodict --user') + import requests + except: + print('WARNING: Installation of xmltodict library failed!') + print('Please use command "pip install xmltodict --user" in your Command Prompt.') + input('Press Enter to exit...') + sys.exit() + else: + input('Press Enter to exit...') + sys.exit() + +import csv + + # Connect to server # Check server port range set in "Program Options & Settings" # By default range is set between 8081 ... 8089