Question: pyforms cannot import conf from pysettings


pyforms cannot import conf from pysettings

Answers 1
Added at 2016-12-19 07:12

This is my python file:

import pyforms
import pyside
from   pyforms          import BaseWidget
from   pyforms.Controls import ControlText
from   pyforms.Controls import ControlButton

class SimpleExample1(BaseWidget):

    def __init__(self):
        super(SimpleExample1,self).__init__('Simple example 1')

        #Definition of the forms fields
        self._firstname     = ControlText('First name', 'Default value')
        self._middlename    = ControlText('Middle name')
        self._lastname      = ControlText('Lastname name')
        self._fullname      = ControlText('Full name')
        self._button        = ControlButton('Press this button')

        #Define the button action
        self._button.value = self.__buttonAction

    def __buttonAction(self):
        """Button action event"""
        self._fullname.value = self._firstname.value +" "+ self._middlename.value + \
        " "+ self._lastname.value

#Execute the application
if __name__ == "__main__":

    pyforms.startApp( SimpleExample1 )

And I got an error in the file:

Traceback (most recent call last):
File "C:\Python27\Ashish\pyforms\", line 1, in <module>
import pyforms
File "C:\Python27\lib\site-packages\pyforms\", line 4, in <module>
from pysettings import conf;
ImportError: No module named pysettings

Here is my

# -*- coding: utf-8 -*-
import logging 
from pysettings import conf;

conf += 'pyforms.gui.settings'

__author__ = "Ricardo Ribeiro"
__credits__ = ["Ricardo Ribeiro"]
__license__ = "MIT"
__version__ = ''
__maintainer__ = "Ricardo Ribeiro"
__email__ = ""
__status__ = "Production"

logger = logging.getLogger(__name__)


    from pyforms.gui import Controls
    from pyforms.gui.BaseWidget import BaseWidget

    if conf.PYFORMS_MODE in ['GUI-OPENCSP']:
        from pyforms.gui.appmanager import startApp
        from pyforms.gui.standaloneManager import startApp

elif conf.PYFORMS_MODE in ['TERMINAL']:

    from pyforms.terminal import Controls
    from pyforms.terminal.BaseWidget import BaseWidget
    from pyforms.terminal.appmanager import startApp    

elif conf.PYFORMS_MODE in ['WEB']:

    from pyforms_web.web import Controls
    from pyforms_web.web.BaseWidget import BaseWidget
    from pyforms_web.web.appmanager import startApp
nr: #1 dodano: 2016-12-20 03:12

You will need to download and install pysettings from

Source Show
◀ Wstecz