×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 26
  1. #1
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    103

    Question Create a .sis file with .pyc file

    Hello, which is the procedure for the creation of .sis file with .pyc file?

    Thanks!

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Espoo, Finland
    Posts
    976

    Re: Create a .sis file with .pyc file

    Same as creating with .py, no difference.

    Cheers,

    --jouni wondering if you really meant to ask that

  3. #3
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: Create a .sis file with .pyc file

    Quote Originally Posted by JOM View Post
    Same as creating with .py, no difference.

    Cheers,

    --jouni wondering if you really meant to ask that
    Really? I tried it with a very simple (just appuifw.note) PYC for PyS60 1.4.5 (so I compiled it with 2.2.2) and when I installed the resulting SIS file I got a strange icon in the phone's menu, and got System error (-1) when I tried to run it.

    Then I defined a "run" function in the code of the PYC and used a separate default.py to call that run after importing the PYC, used py2sis on default.py, installed and it all worked.

    --bogdan wondering if he's making a fool of himself by missing something obvious or if Jouni does any research before posting

  4. #4
    Super Contributor
    Join Date
    Dec 2004
    Posts
    643

    Re: Create a .sis file with .pyc file

    Quote Originally Posted by bogdan.galiceanu View Post
    Really? I tried it with a very simple (just appuifw.note) PYC for PyS60 1.4.5 (so I compiled it with 2.2.2) and when I installed the resulting SIS file I got a strange icon in the phone's menu, and got System error (-1) when I tried to run it.

    Then I defined a "run" function in the code of the PYC and used a separate default.py to call that run after importing the PYC, used py2sis on default.py, installed and it all worked.

    --bogdan wondering if he's making a fool of himself by missing something obvious or if Jouni does any research before posting
    IIRC default.py is a special case and must be a .py file, not .pyc. Other ones you can have as .pyc.

  5. #5
    Super Contributor
    Join Date
    Mar 2003
    Location
    Espoo, Finland
    Posts
    976

    Re: Create a .sis file with .pyc file

    Quote Originally Posted by bogdan.galiceanu View Post
    Really? I tried it with a very simple (just appuifw.note) PYC for PyS60 1.4.5 (so I compiled it with 2.2.2) and when I installed the resulting SIS file I got a strange icon in the phone's menu, and got System error (-1) when I tried to run it.

    Then I defined a "run" function in the code of the PYC and used a separate default.py to call that run after importing the PYC, used py2sis on default.py, installed and it all worked.

    --bogdan wondering if he's making a fool of himself by missing something obvious or if Jouni does any research before posting
    I've released at least three (3) SIS files using .pyc instead of .py. During testing and debugging I created SIS files using either .py or .pyc files. There was no difference, in those cases, except that some files were compiled as .pyc. Everything else remained same.

    However please note: you have to do certain things regardless whether you use .py or .pyc when creating a SIS. When you can create a functional SIS with .py then the same setup can be used with .pyc - in most cases. At least twice I've run into mysterious problems, where .pyc release worked in a bit different way (something about sys.path). At least once it didn't work at all.

    So yes, my research before posting says that if you manage to create a functional SIS using .py, then using .pyc requires no changes except compiling py -> pyc. One additional note: there has to be the default.py to load pyc, cannot replace that with default.pyc

    Cheers,

    --jouni still wondering if this really is a "SIS with pyc" question or rather "how to make a .pyc" or even "how to make a SIS" question, but trying to answer the question in best possible way anyway

  6. #6
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    103

    Re: Create a .sis file with .pyc file

    The default.py file what is it?

  7. #7
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,796

    Re: Create a .sis file with .pyc file

    Quote Originally Posted by santinomazza View Post
    The default.py file what is it?
    It is necessary to import the compiled script. It should contain append and import statements.
    Code:
    #default.py
    import sys
    sys.path.append(pathofpyc)#assign the path to pathofpyc
    import myscript
    Hope it helps,
    Pankaj Nathani
    www.croozeus.com

  8. #8
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    103

    Re: Create a .sis file with .pyc file

    Quote Originally Posted by croozeus View Post
    Code:
    #default.py
    import sys
    sys.path.append(pathofpyc)#assign the path to pathofpyc
    import myscript
    in this case I will have to only replace myscript with the name of my script?

  9. #9
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,796

    Re: Create a .sis file with .pyc file

    Quote Originally Posted by santinomazza View Post
    in this case I will have to only replace myscript with the name of my script?
    Yes. Also assing appropriate path to the variable pathfpyc.

    For example, pathofpyc="C:\\Myapp"
    Pankaj Nathani
    www.croozeus.com

  10. #10
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    103

    Re: Create a .sis file with .pyc file

    after to have created default.py I use this string?

    Code:
    python ensymble.py py2sis --icon=JackSMS.svg --appname=JackSMS --version=1.13.0 --lang=EN,IT --caps=NetworkServices+ReadDeviceData+ReadUserData+WriteUserData+LocalServices+UserEnvironment default.py JackSMS.sis

  11. #11
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,796

    Re: Create a .sis file with .pyc file

    Quote Originally Posted by santinomazza View Post
    after to have created default.py I use this string?

    Code:
    python ensymble.py py2sis --icon=JackSMS.svg --appname=JackSMS --version=1.13.0 --lang=EN,IT --caps=NetworkServices+ReadDeviceData+ReadUserData+WriteUserData+LocalServices+UserEnvironment default.py JackSMS.sis
    You should make a folder named myapp, which should contain default.py and a root folder

    Code:
    myapp
        root
            -myapp.pyc
        -default.py
    Then use, (more commands can be added as per as your need like icon, version, caps, etc)

    Code:
    python ensymble.py py2sis --extrasdir=root myapp
    Hope it helps,

    Cheers,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  12. #12
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    103

    Re: Create a .sis file with .pyc file

    Sorry but I have not understood..

  13. #13
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,796

    Re: Create a .sis file with .pyc file

    Quote Originally Posted by santinomazza View Post
    Sorry but I have not understood..
    Hmph,
    • Suppose your main script is myapp.py and after compiling it becomes myapp.pyc.
    • Create a folder named myapp and a subfolder named root. Put the myapp.pyc in the root folder.
    • Make the default.py as suggested in post 7 and put it in the myapp folder. The file-folder hierarchy should be then as shown in post 11.
    • Then use this command to make the SIS file.


    Code:
    python ensymble.py py2sis --extrasdir=root myapp
    Bit complicated on first time, but then you get used to it

    Hope it helps,
    Pankaj Nathani
    www.croozeus.com

  14. #14
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    103

    Re: Create a .sis file with .pyc file

    myapp and root I insert to them in the folder python24?

    Thanks

  15. #15
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,796

    Re: Create a .sis file with .pyc file

    Quote Originally Posted by santinomazza View Post
    myapp and root I insert to them in the folder python24?

    Thanks
    Yes, that should work.

    Welcome
    Pankaj Nathani
    www.croozeus.com

Similar Threads

  1. Problem with GCCE build in Carbide.vs
    By raffaelbechara in forum Symbian
    Replies: 6
    Last Post: 2008-10-20, 16:06
  2. How to create .sis file
    By rbs in forum Symbian
    Replies: 2
    Last Post: 2006-12-29, 11:14
  3. .sis file includes Windows executable?
    By gerard in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 3
    Last Post: 2006-07-20, 10:38
  4. a 0problem when use sisar to create .sis file
    By dac23 in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2003-07-18, 02:47
  5. How to create a .sis file?
    By ask_expert in forum Mobile Java General
    Replies: 2
    Last Post: 2002-05-08, 16:42

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×