[Pythonmac-SIG] py2app...

hubert.blein@libertysurf.fr hubert.blein at libertysurf.fr
Fri Oct 7 13:41:02 CEST 2005


Hello everybody,

I'm a brand new Python user. And the reason is that I needed to make very small application running on both Mac and PC.
I only wanted to add a compiled exe (for PC) and application file (for Mac) so I tried with py2exe and py2app.

It was quit simple for PC (to be honest, I'm a PC user) but I did not succed for Mac with py2app on a friend's macOSX Panther...
The little python script I wrote is just to list folders recusively. I copied it on bottom.

Could someone convert my 20 lines code for me ? (it's 2 days I fail and I'm getting nervous as it's a very little part of a big project)
May be I could help for something else ? py2exe, actionscript, php, ...

All the bests to you !

Hub.

-------------------------------------------------
-------------------------------------------------
#checkDir.py
-------------------------------------------------

import sys, os
 
def treatDir(dirbasepath,resultat):
        resultat=resultat+dirbasepath+"\n"
 for dirpath, dirnames, filenames in os.walk(dirbasepath):
  for filename in filenames :
   resultat=resultat+dirpath+"\\"+filename+"\n"
  for dirname in dirnames :
   resultat=treatDir(dirpath+"\\"+dirname,resultat)
 return resultat

dossier='.'
 
texte=treatDir(dossier,'')

f=open(dossier+'\pythonDir.txt', 'w')
f.write(texte)
f.close()

-------------------------------------------------
-------------------------------------------------
-------------------------------------------------

The script will produce a texte file looking like this :

.
.\checkDir.exe
.\chmod.txt
.\dir.txt
.\doDir.bat
.\doDir.sh
.\library.zip
.\python24.dll
.\pythonDir.txt
.\jackpot
.\jackpot\son
.\jackpot\son\09-Pluto.mp3
.\jackpot\speed
.\jackpot\speed\speed.jpg
.\jackpot\speed\Thumbs.db

etc...



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20051007/90531888/attachment.html


More information about the Pythonmac-SIG mailing list