Imports again...

Alex Hall mehgcap at gmail.com
Fri Apr 9 12:10:44 EDT 2010


Okay, what you all say makes sense, and I am going to try the package
thing again. The "modes" dir is from my last attempt, as is its
"weather" subdir. I think I see what I did wrong, at least I hope I
do. I will also remove the init file from the main dir. Yes, "arm" is
the main directory of the program. Also, I will try to update things
so that most imports happen from the dependencies folder, avoiding the
need to install/copy so much to your local install of Python. Here is
a traceback of the program as it is right now; this is from the exact
same version as the .zip file contains.

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Alex>cd c:\python26

c:\Python26>python.exe i:\arm\main.pyw
Traceback (most recent call last):
  File "i:\arm\main.pyw", line 3, in <module>
    import arm, network, weather, dict
  File "i:\arm\arm.py", line 4, in <module>
    import config
  File "i:\arm\config.py", line 4, in <module>
    from main import exitProgram
  File "i:\arm\main.pyw", line 3, in <module>
    import arm, network, weather, dict
  File "i:\arm\network.py", line 4, in <module>
    arm.ready()
AttributeError: 'module' object has no attribute 'ready'

c:\Python26>


I realize it may be odd to import from main.pyw, but I do not think
that could be causing the problem... could it? Perhaps I should erase
all the .pyc files and let it compile again, or would that not do
anything?

On 4/9/10, Tim Golden <mail at timgolden.me.uk> wrote:
> On 09/04/2010 15:19, Gabriel Genellina wrote:
>> In addition to what Tim Golden has said (which appears to be based on
>> another
>> version of this project
>
> Just downloaded again, and there's definitely an empty package structure
> of the kind I described. (Altho' I certainly did have a few other versions
> lying around from previous questions by the OP).
>
>> Also, you have some .pyw files with corresponding .pyc file. That's *very*
>> strange. .pyw files are *not* modules, and Python won't import them.
>
> Ahem.
>
> <dump>
> Python 2.6.4rc2 (r264rc2:75501, Oct 18 2009, 22:41:58) [MSC v.1500 32 bit (I
> Type "help", "copyright", "credits" or "license" for more information.
>>>> open ("xxx.pyw", "w").write ("print ('hello')")
>>>> import xxx
> hello
>>>>
>>>>
>
> </dump>
>
> TJG
> --
> http://mail.python.org/mailman/listinfo/python-list
>


-- 
Have a great day,
Alex (msg sent from GMail website)
mehgcap at gmail.com; http://www.facebook.com/mehgcap



More information about the Python-list mailing list