Imports again...

Ethan Furman ethan at stoneleaf.us
Fri Apr 9 13:07:17 EDT 2010


Tim Golden 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

Good point.  Just to be clear, if there are *both* .py & .pyw...

<dump>

Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
--> open ("xxx.pyw", "w").write ("print ('hello')")
--> open ("xxx.py", "w").write ("print ('good-bye')")
--> import xxx
good-bye

</dump>

~Ethan~



More information about the Python-list mailing list