Differences between revisions 6 and 19 (spanning 13 versions)
Revision 6 as of 2008-10-04 03:36:47
Size: 6871
Editor: cpe-72-128-41-249
Comment:
Revision 19 as of 2010-08-02 09:15:57
Size: 3347
Editor: chello212186002156
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
http://undefined.org/python/py2app.html
print "WELCOME TO SAM OS V.2 ;)"
print"============================================================="
print "by CH TECH"
print " "
py2app is a Python setuptools command which will allow you to make standalone application bundles and plugins from Python scripts. py2app is similar in purpose and design to py2exe for Windows.
Line 7: Line 3:
Latest Version 0.5.2
Line 8: Line 5:
== Installation ==
Line 9: Line 7:
(py2app version 0.5 2010-07-28 Ronald Oussuroren)
Line 10: Line 9:
sentinel=0
b=0
while sentinel!= 11235813:
    sentinel=input ('THE ? IS MIGHTIER THAN THE SWORD')
    if sentinel!=11235813:
       
        print'ACCESS DENIED'
    
        
"easy_install-X.Y -U py2app" should install the software, where X.Y is your favorite version of Python.
Line 20: Line 11:
print "S.A.M. DATABASE ACCESSED" There is one new feature in this release: experimental support for python 3. This basicly means that I managed to build a single application as a standalone application bundle, without much testing. Alias builds and plugin bundles almost certainly don't work (the first because alias builds use the Carbon module which isn't available in python 3, the latter because I had to rewrite the C code in the application bundles and probably have to do the same for plugin bundles).
Line 22: Line 13:
print"----------------------------------------------------------" == Notes ==
Line 24: Line 15:
print"WELCOME TO CLAYTON HENDERSON'S PERSONAL OPERATING SYSTEM" Execute a bundled app from the commandline to see error messages:
Line 26: Line 17:
print"---------------------------------------------------------"   myapp.app/Contents/MacOS/myapp
Line 28: Line 19:
print"HOW MAY I BE OF SERVICE ?"
print"======================================================================="
== Link Collection ==
Line 31: Line 21:
a=input("PLEASE ENTER THE CODE OF YOUR CHOICE, TYPE 1 FOR DIVISION PROBLEMS "
        "2 FOR MULTIPLUCATION,"
        "3 FOR MORE OR LESS,"
        "4 FOR GUESSING GAME "
        "5 FOR FAMILY INFO,"
        "6 FOR AREA,"
        "7 FOR VOLUME,"
        "8 FOR EXPONENTS,"
        "9 FOR AREA OF A TRIANGLE,"
        "14 FOR ALGEBRA,"
        " 15 FOR FIBBOACCI,"
        " 16 FOR FILE DATABASE,"
        " 17 FOR ADDRESS BOOK,"
        " 18 for TAKBOARD"
        "TYPE exit TO END THE PROGRAM")
print"========================================================================"
if a==1:
    a=input("ENTER DIVISIOR")
    b=input("ENTER DIVIDEND")
    print b/a
Current repository:
Line 52: Line 23:
   * source http://svn.pythonmac.org/py2app/py2app/trunk/
   * documentation http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html
Line 53: Line 26:
if a==2:
    a=input("ENTER A NUMBER")
    b=input("ENTER A NUMBER")
    print a*b
Original version:
Line 58: Line 28:
if a==3:
    X=input ('enter a num')
    if X<50:
        print' number is less than 50'
  * source http://undefined.org/python (points to repository)
  * documentation http://undefined.org/python/py2app.html (might be old)
Line 63: Line 31:
    if X>50:
        print 'number is greater than 50'
=== Problems before 0.5 ===
Line 66: Line 33:
    if X==50:
        print'The number is equal to 50'
 * for 64-bit systems, the pypi package (0.4.2) failed.
   even with macholib, altgraph and modulegraph gathered from all around.
 * here
 is some workaround http://hg.hardcoded.net/py2app,
   that i have not tested, as macholib is missing
Line 69: Line 39:
if a==4:
    import random
=== current state ===
Line 72: Line 41:
    num=random.randint(1,50)  * http://svn.pythonmac.org/py2app/py2app/trunk
 * http://svn.pythonmac.org/macholib/macholib/trunk
 * http://svn.pythonmac.org/altgraph/altgraph/trunk
 * http://svn.pythonmac.org/modulegraph/modulegraph/trunk
Line 74: Line 46:
    counter=15
    print"you have 16 guesses. My number is between 1 and 50"
    guess=input("guess a number:")
checkout and install. install with "python setup.py install"
Line 78: Line 48:
    while guess!=num and counter>0:
        if guess >num:
            print"guess is too hi"
        if guess<num:
            print "you guessed too low"
        guess=input("try again:")
        counter=counter-1
 
    if guess!=num:
        print"you loose my number was"+str (num)
'''ATTENTION''' some things are in /Library/Python and some things
in /Library/Frameworks/Python.framework/.
Line 89: Line 51:
    if guess==num:
        print'YOU WIN'
=== questions ===
Line 92: Line 53:
if a==5:
    sentinel=0
    while sentinel!= 2157:
        sentinel=input("ENTER FAMILY PASSWORD")
        if sentinel!=2157:
            print "FAMILY DATABASE RESTRICTED TO YOU"
    if sentinel==2157:
        print"WELCOME"
        
    
    print "DATABASE ACCESSED. ENTER FILE NAME."
is it really necessary to run 'python setup.py py2app' with sudo ?
Line 104: Line 55:
    family=["camille","nate","clayton","annette", "david"] it writes into /Library ?
Line 106: Line 57:
    intel=[" is 8, 4th grade, plays soccer,"," is 11, 6th grade obsessive, gym & soccer", "RESTRICTED"," is approx 47,works @ grapevine designs"," is approx 43,works at Providence Med Center"] and there still is an error that ::
Line 108: Line 59:
    name=raw_input("enter a file name for family intel:")
    x=0
    while name!=family [x]:
        x=x+1
 '/Library/Python/2.6/site-packages/py2app-0.5-py2.6.egg/py2app/apptemplate/prebuilt/main-i386'
Line 113: Line 61:
is missing. There is only ::
Line 114: Line 63:
         print name+intel [x]   main-fat3 main-intel main-universal
Line 117: Line 65:
linking main-fat3 to main-i386 ::
Line 118: Line 67:
  cd /Library/Python/2.6/site-packages/py2app-0.5-py2.6.egg/py2app/apptemplate/prebuilt
  ln -s main-fat3 main-i386
Line 119: Line 70:
if a==6:
    print"AREA"
    
makes the build succeed, when using sudo ::
Line 123: Line 72:
    A=input("enter the length")
    C=input("enter the with")
  sudo python setup-mac.py py2app
Line 126: Line 74:
         print A*C but the app crashes ::
Line 129: Line 76:
  mine.app/Contents/MacOS/mine
Line 130: Line 78:
    raw_input()   Traceback (most recent call last):
  File "MySQLdb/__init__.pyc", line 19, in <module>
  File "_mysql.pyc", line 18, in <module>
  File "_mysql.pyc", line 15, in __load
  ImportError: '/usr/lib/python2.6/lib-dynload/_mysql.so' not found
Line 132: Line 84:
_so is in the app, but not in the system (i like to keep things local)
Line 133: Line 86:
copying _mysql.so into /usr/lib/python2.6/lib-dynload, cured this.
Line 134: Line 88:
Then it works.
Line 135: Line 90:
if a==7:
    print"VOLUME"
    
== Development ==
Line 139: Line 92:
    A=input("enter the length")
    C=input("enter the with")
    B=input("enter height")
=== Python Versions ===
Line 143: Line 94:
    print A*B*C
 
modulegraph/util.py requires python>=2.6 for immutable bytes by 'b"something"'.
Line 146: Line 96:
=== Testing ===
Line 147: Line 98:
    raw_input()



if a==8:
    print"EXPONENTS"
    A=input("base")
    B=input("power")

    print A**B


    

    






if a==00:
    print"PLAN MODE STARTED"
    print"--------------------------------------------------"
    V1=raw_input("PLEASE ENTER THE FIRST VARIABLE IN PLAN")
    V2=raw_input("PLEASE ENTER THE SECOND VARIABLE IN PLAN")
    obj=raw_input("ENTER THE OBJECTIVE")
    obs=raw_input("ARE THERE ANY OBSTICLES")
    action=raw_input("ENTER SELECTED PLAN OF ACTION")

    print "THE VARIABLES ARE " +V1 + V2
    print "THE OBJECTIVE IS " +obj
    print" THE OBSTICLE IS " +obs
    print "OUR SELECTED PLAN OF ACTION IS " +action
if a==14:
    print"====================================================="
    print "ALGEBRA SOLVER BETA PROGRAM"
    print"---------------------------------------------------"
    V1=input("()")
    V2=input("Exponents num**num")
    V3=input("multiply x*x")
    V4=input("division x/x")
    V5=input("addition x+x")
    V6=input("subtract x-x")

    choice1=input("YOUR CHOICES ARE...1:MULTIPLY, 2 ADD, 3 SUB, 4 DIVIDE")
    choice2=input("YOUR CHOICES ARE...1:MULTIPLY, 2 ADD, 3 SUB, 4 DIVIDE")
    choice3=input("YOUR CHOICES ARE...1:MULTIPLY, 2 ADD, 3 SUB, 4 DIVIDE")
    

    




    if choice1==1:
        print V1*V2
    if choice1==2:
        print V1+V2
    if choice1==3:
        print V1-V2
    if choice1==4:
        print V1/V2

    
    if choice2==1:
        print V3*V34
    if choice2==2:
        print V3+V4
    if choice2==3:
        print V3-V4
    if choice2==4:
        print V3/V4

    
    if choice3==1:
        print V5*V6
    if choice3==2:
        print V5+V6
    if choice3==3:
        print V5-V6
    if choice3==4:
        print V5/V6

    

    

if a==9:
    a=input("height")
    b=input("base")
    print a*(b*.5)

if a==15:
    a=0
    b=1
    c=0
    d=0
    e=input("enter a number")

    while d<e:
        print a+b
        c=a
        a=b
        b=c+b

        d+=1

    raw_input()





if a ==16:
    print "FILE DATABASE SUBSYSTEM"

    
    Word=["Clayton", "SAM","Computer", "Program","Internet","Door Code", "Apple Computers",]

    Define=[" -Clayton wrote this program "," -SAM is a personal OS", "-a machine that works with a user interface","-An environment in which a computer completes a task", "-is a network of servers that a user may connect to","3502","-A computer company which makes and designs powerful processors and hardware"]
    iWord=raw_input("ENTER KEYWORD:")
    x=0
    while iWord!=Word [x]:
        x=x+1


    print"================================================"
    print iWord+Define [x]
    print"================================================"


if a==17:
    print"================================================="
    print"ADDRESS BOOK"
    print"=================================================="

    Name=["Andy","Robbie","Jackson"]
    Phone=["962-1568","962-5710","268-3787"]
    a=input("ENTER NAME")


    b=0
    while a!=Name [b]:
        b=b+1

    print"==================================================="
    print a+Phone[b]
    print"==================================================="

if a==18:
    print "TAK-BOARD"
    print" "
    a=input("ENTER TIME DO NOT USE A :")
    b=input("ENTER PLACE")
    c=input("ENTER EVENT")

    print"----------------------------------------------"
    print a + b + c

    

raw_input("PROGRAM HAS CEASED, RESTART TO CONTINUE THANK YOU FOR USING SAM OS V")
py.test is used for testing. modulegraph/util.py contains tests in util.py.
maybe revert to unittest.

py2app is a Python setuptools command which will allow you to make standalone application bundles and plugins from Python scripts. py2app is similar in purpose and design to py2exe for Windows.

Latest Version 0.5.2

Installation

(py2app version 0.5 2010-07-28 Ronald Oussuroren)

"easy_install-X.Y -U py2app" should install the software, where X.Y is your favorite version of Python.

There is one new feature in this release: experimental support for python 3. This basicly means that I managed to build a single application as a standalone application bundle, without much testing. Alias builds and plugin bundles almost certainly don't work (the first because alias builds use the Carbon module which isn't available in python 3, the latter because I had to rewrite the C code in the application bundles and probably have to do the same for plugin bundles).

Notes

Execute a bundled app from the commandline to see error messages:

  • myapp.app/Contents/MacOS/myapp

Current repository:

Original version:

Problems before 0.5

  • for 64-bit systems, the pypi package (0.4.2) failed.
    • even with macholib, altgraph and modulegraph gathered from all around.
  • here

    is some workaround http://hg.hardcoded.net/py2app,

    • that i have not tested, as macholib is missing

current state

checkout and install. install with "python setup.py install"

ATTENTION some things are in /Library/Python and some things in /Library/Frameworks/Python.framework/.

questions

is it really necessary to run 'python setup.py py2app' with sudo ?

it writes into /Library ?

and there still is an error that ::

  • '/Library/Python/2.6/site-packages/py2app-0.5-py2.6.egg/py2app/apptemplate/prebuilt/main-i386'

is missing. There is only ::

  • main-fat3 main-intel main-universal

linking main-fat3 to main-i386 ::

  • cd /Library/Python/2.6/site-packages/py2app-0.5-py2.6.egg/py2app/apptemplate/prebuilt ln -s main-fat3 main-i386

makes the build succeed, when using sudo ::

  • sudo python setup-mac.py py2app

but the app crashes ::

  • mine.app/Contents/MacOS/mine Traceback (most recent call last):

    File "MySQLdb/init.pyc", line 19, in <module> File "_mysql.pyc", line 18, in <module> File "_mysql.pyc", line 15, in load ImportError: '/usr/lib/python2.6/lib-dynload/_mysql.so' not found

_so is in the app, but not in the system (i like to keep things local)

copying _mysql.so into /usr/lib/python2.6/lib-dynload, cured this.

Then it works.

Development

Python Versions

modulegraph/util.py requires python>=2.6 for immutable bytes by 'b"something"'.

Testing

py.test is used for testing. modulegraph/util.py contains tests in util.py. maybe revert to unittest.

MacPython/py2app (last edited 2010-08-29 12:25:55 by chello212186002156)

Unable to edit the page? See the FrontPage for instructions.