Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8067505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:19:16+00:00 2026-06-05T12:19:16+00:00

I am writing my PyQt4 program and I manipulate many dictionaries. No problem in

  • 0

I am writing my PyQt4 program and I manipulate many dictionaries. No problem in the file script itself, but now need to use dictionaries that are not in my file script, and I don’t know how to correctly import and use them to update my “real” dictionaries.

All my dictionaries are declared in my init constructor at the top of my program.

Here is a bit of my program which show a sample dictionary, in a function :

self.dicoMentalRay = { 'projectDirectory' : self.mentalrayProjectDirectory_Text.text(),
'sceneFilename' : self.mentalrayProjectSceneFilename_Text.text(),
'renderer' : self.mentalrayRenderingRenderer_Text.text() }

and here how it is supposed to update after I clicked on a button (in another function) :

self.dicoMentalRay.update(dicoMentalRay2)

The “dicoMentalRay2” is supposed to be in another .py file, in the same directory of my script. I import it well with

import dico

The problem is that I always get the same error :

NameError: global name 'dicoMentalRay2' is not defined

I think the problem is that my “dico.py” is badly written. Indeed, I only write a new dictionary in it, and nothing else, like class or function.

How am I supposed to do ? Thanks !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T12:19:17+00:00Added an answer on June 5, 2026 at 12:19 pm

    To use dicoMentalRay2 from dico file, you have to use

    from dico import dicoMentalRay2
    self.dicoMentalRay.update(dicoMentalRay2)
    

    or

    import dico
    self.dicoMentalRay.update(dico.dicoMentalRay2)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently I'm writing a program using Qt(PyQt)'s QTableView. But I find that the current
Im writing a little python program that goes through an XML file and does
Writing a program for a project. I need to use a ListSelectionListener in order
I'm writing a program that requires input in the form of a document, it
I'm writing a GUI application with PyQt4 (Python3). One my friend pointed out that
I'm writing a program using python 2.6 and pyqt4. I want this program to
I'm new to Python and I'm writing a script that includes some timed routines.
I am writing a gui program that allows a user to repeatedly send a
Writing my first silverlight application. I need to deliver some bitmap that the customer
I am writing a GUI program using PyQt4. There is a button in my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.