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 6185721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:45:54+00:00 2026-05-24T01:45:54+00:00

I don’t think there is quite the need for the continued downvoting, I am

  • 0

I don’t think there is quite the need for the continued downvoting, I am just trying to learn here!

One.py

from two import *

ADooDah = Doodah()
something = Thing(ADooDah)

something.DoThis()
something.DoThat
something.DoAnother
if (something.has_done_stuff() == True)
    self.SomeFunction

Two.py

class Thing(var):
    def __init__(self, var)
        self.SomeVar = var

    def has_done_stuff(self):
        while True:
            id, newMessage = SomeVar.get_next_message()
            if id == 0:
                return true
            else:
                return false

I get…

Traceback (most recent call last):
  File "C:\One.py", line 9, in <module>
    has_done_stuff = thing.HasDoneStuff()
NameError: global name 'thing' is not defined

EDITS: The code was indeed peppered with errors. I was trying to show my situation rather than any real code. Rush typing causes foolish typing. Even I’m not that bad! Well, most of the time 😉 .

I hope the edits make it all make more sense and you fine people can stop focusing on the crazy syntax errors and explain a bit more about my scope (I assume) problem. I’m fairly new to Python/IronPython and the rules around implicit types and scoping I am still in the process of learning!

I have solved my problem though. Thanks. It was fairly unrelated to the above as it turns out.

  • 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-05-24T01:45:54+00:00Added an answer on May 24, 2026 at 1:45 am

    I give the following codes.

    I don’t know for what they will be usable…… But they CAN run.

    .

    two.py

    from time import time
    
    class Thing():
        def __init__(self, var):
            self.SomeVar = enumerate(var)
    
        def HasDoneStuff(self):
            while True:
                id, newMessage = self.SomeVar.next()
                print newMessage
                print 'id==',id
                return id == 0
    
        def DoThis(self):
            print "DoThis' result"
    
        def DoThat(self):
            print 'DoingThat ;;;;;;;;;;;;;;;;;;;;;'
    
        def DoAnother(self):
            print 'DoAnother time',time()
    
        def SomeFunction(self):
            print 'Humpty Dumpty sat on a wall'
    

    .

    one.py

    from two import *
    
    
    def Doodah(ss):
        return ss.split()
    
    ADooDah = Doodah('once upon a time')
    
    Something = Thing(ADooDah)
    
    
    Something.DoThis()
    Something.DoThat()
    Something.DoAnother()
    
    print '\n==========================\n'
    
    while True:
        try:
            if Something.HasDoneStuff():
                Something.SomeFunction()
            print '---------------'
        except StopIteration:
            print "That's all folks"
            break
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Don't think there's much to say, here's my code for (int i = 0;
Don't know where else to ask, but from one day to the other my
Don't know is it possible to copy elements from one map to another map
Don't need to go so far, just install Devexpress 11.2.5 and run the GridDemo(
Don't know a better title but here is what im trying to do. I
don't know if the title describes anything about what I'm trying to say but
don't know what happened in my jcrop selection. I think I pressed some keys
Don't be scared of the extensive code. The problem is general. I just provided
Don't know how to google for such, but is there a way to query
Don't ask me why but I need to do the following: string ClassName =

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.