473,386 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

a second program - I cannot get the exe to run

I have a game that works fine on my computer. I used pygame2exe to create a .exe and now I get a log file genereated that says:

File "runloop.py", line 3, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "game1.pyo", line 5, in <module>
AttributeError: 'module' object has no attribute 'Bridge'

here's the code:

import sys
import pygame
import levelobjects
from player import *
from Gadgets import *
from background import *
from pygame.locals import *

Does anyone know why?
Mar 9 '10 #1
5 1303
Glenton
391 Expert 256MB
Is Bridge one of your attributes? Sounds like there's a clash.
Mar 9 '10 #2
yes it is. what does it mean that there is a 'clash' in the exe and how do I correct this?
Mar 9 '10 #3
in my python setup, i have a folder called Gadgets, in which I have a module called bridge.py.
In my main program, it says:
Expand|Select|Wrap|Line Numbers
  1. import os
  2. import sys
  3. import game1
  4. import pygame
  5. from pygame.locals import *
  6. from background import *
In bridge.py, it says:
Expand|Select|Wrap|Line Numbers
  1. import os
  2. import sys
  3. import pygame
  4. from Gadget import *
  5. from pygame.locals import *
  6.  
  7. class Bridge(Gadget):
  8.  
Mar 9 '10 #4
bvdet
2,851 Expert Mod 2GB
Please use code tags when posting code. See posting guidelines here.

I'm guessing here. Bridge is inheriting from Gadget, but you are not importing module Gadget. You are only importing the contents of module Gadget (unless Gadget is defined in Gadget). Try this:
Expand|Select|Wrap|Line Numbers
  1. import Gadget
BV - Moderator
Mar 9 '10 #5
I apologize for posting incorrectly.

In Gadget, I have

Expand|Select|Wrap|Line Numbers
  1. import os
  2. import sys
  3. import pygame
  4. from pygame.locals import *
  5.  
  6. class Gadget(object):
Is this not sufficient? (Just a note, this works in a dev environment, but not when I create an exe).

Thank you for your help.
Mar 9 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: DMina | last post by:
Hello there! I have on a machine (named SV-ISDEV) two MSSQL instances installed. The local and the SV-ISDEV\PREPROD. Now I want to unistall the PREPROD instance. Which is the correct way to do...
1
by: siliconpiNOSPAM | last post by:
Hi, I have a C# test program (setup as a console application) that runs a bunch of other programs like IE / etc. I run this program from a command window, the other windows cover the command...
2
by: Brian Worth | last post by:
I have just upgraded from VB 4.0 to VB .NET 2002. One program under VB 4.0 was able to shut down or restart the (windows XP) machine using a series of API calls. (Getlasterror, GetCurrentProcess,...
8
by: Rick Lederman | last post by:
I am using a PrintDocument and PrintDialog to print. The first time that I print it works, but when I try to print a second time without exiting the entire program I get an...
9
by: Hemal | last post by:
Hi All, I need to know the memory required by a c program. Is there any tool/utility which can give me the memory usage in terms of DATA segment, TEXT segment, BSS segment etc. I am working...
4
by: grizggg | last post by:
I have searched and not found an answer to this question. I ran upon the following statement in a *.cpp file in a member function: static const char * const pacz_HTMLContentTypeHeader =...
28
by: galathaea | last post by:
On Mar 2, 11:29 pm, galath...@veawb.coop (galathaea) wrote: still being very naive about this whole crackpot / crank thing i accidentally let the engineer inside think too hard about this ...
5
by: rasmidas | last post by:
I have written a file as below: #include<stdio.h> #include<string.h> #include<stdlib.h> int main() { char* items; int i; for(i=0;i<2;i++)
11
by: hamiltongreg | last post by:
I am new to Java and am having problems getting my program to compile correctly. My assignment is as follows; Choose a product that lends itself to an inventory (for example, products at your...
2
by: Netwatcher | last post by:
Hello, i am new to c++ windows and DX programming, i encountered a code in the book stated in the title, which doesn't work for a reason, here is the code // Beginning Game Programming // Chapter...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.