Hello I'm new to python and I'm programing an application using PyQt at the moment now i would like to know how to pass some variables from my main parent page to included pages which in the own right have a lot of processing, event handling and data entry and retrieval as well.

is this possible with python or do i have to do all my main code on the main page?

i have no problem getting variable from included pages onto the main page i just want to send variables the other way.

is it only a one way system in python not like PHP which can access variables globally regardless of it its a parent page or an included child page.

the reason I'm doing this is the application i want to build is a large ERP/CMR type application which will have many app pages so i cant put every thing on the main page as i want to break it up into modules. but i cant figure out how to get variables from the main page into a another included page which might manage the sales part of the application with all the app pages for the sales team and another module with all the app pages for the accounts team. the main page manages password entry and user management also activity management.
but i cant retrieve details of who's logged in so i can show the appropriate app page of the application with the settings for that user and setup database interaction for that particular user into the included pages


you help on this would be very grateful

Your choice of words is very unique and I'm not sure that I understand your dilemma; but perhaps you are asking about passing parameters to a function that you've imported from another module?

import os

os.listdir('/mydir/test/python')

Like that.

Include a small code snippet that demonstrates what you want (it doesn't have to work, just use descriptive variable names). I think you are talking about passing variables from/to functions, classes, and separate program files, which is done in practically every program written, but a descriptive piece of code would help to clarify.

This article has been dead for over six months. Start a new discussion instead.