×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Pune, india
    Posts
    186

    Question want to write help file for mobile application with python??

    hi
    if i want to write help file for my application what is the procedure to call it??
    what is the file type to be used??
    what format it requires?/
    any example??/

    thnks
    Last edited by sagars; 2008-06-07 at 11:06.

  2. #2
    Registered User
    Join Date
    Jun 2008
    Posts
    18

    Re: want to write help file for mobile application in python??

    This is what I do.

    Write the help as a text file and use the code below.
    Code:
    f=file("E:\\help.txt", "r")
    
    tx=f.read()
    
    #Close file
    f.close()

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

    Re: want to write help file for mobile application with python??

    Quote Originally Posted by sagars View Post
    hi
    if i want to write help file for my application what is the procedure to call it??
    what is the file type to be used??
    what format it requires?/
    any example??/

    thnks
    Contarary to what nadym89 said, if you want to write to file

    Code:
    f=file("E:\\help.txt", "w")
    
    helptext=f.write()
    
    #Close file
    f.close()
    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  4. #4
    Registered User
    Join Date
    Jun 2008
    Posts
    18

    Re: want to write help file for mobile application with python??

    Quote Originally Posted by croozeus View Post
    Code:
    f=file("E:\\help.txt", "w")
    
    helptext=f.write()
    
    #Close file
    f.close()

    Hey, thanks for correcting the mistake. I don't exactly know what's
    the use of that R and W. Can you tell me the difference between those two?

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

    Re: want to write help file for mobile application with python??

    Quote Originally Posted by nadym89 View Post
    Hey, thanks for correcting the mistake. I don't exactly know what's
    the use of that R and W. Can you tell me the difference between those two?
    "r" is for reading the contents of a file, while "w" is for writing to a file. You can also use "a" for appending a file (adding to the existing content).

  6. #6
    Registered User
    Join Date
    Jun 2008
    Posts
    18

    Re: want to write help file for mobile application in python??

    Thanks a lot again. Then my code should be correct since I meant to read a text file using an existing help file.

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

    Re: want to write help file for mobile application in python??

    Quote Originally Posted by nadym89 View Post
    Thanks a lot again. Then my code should be correct since I meant to read a text file using an existing help file.
    Contrary to your thread topic which says -" Want to write to a help file..."


    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  8. #8
    Registered User
    Join Date
    Jun 2008
    Posts
    18

    Re: want to write help file for mobile application in python??

    Hey, I have a problem. When I use the code below in an app, always the last part of the texts is displayed. And I have to scroll up to read the top of the help file.

    Code:
    f=file("E:\\help.txt", "r")
    
    tx=f.read()
    
    #Close file
    f.close()
    Is there any way that, when I use the code, the first part of the texts is displayed?

  9. #9
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Pune, india
    Posts
    186

    Re: want to write help file for mobile application in python??

    hay nadym89,
    you may try this.

    import codecs
    import appuifw
    path="E:\\help.txt"
    c=appuifw.Content_handler()
    c.open(path)

  10. #10
    Registered User
    Join Date
    Jun 2008
    Posts
    18

    Re: want to write help file for mobile application in python??

    Yeap, I know that. But I want to used codecs module for that

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

    Re: want to write help file for mobile application in python??

    Quote Originally Posted by nadym89 View Post
    Hey, I have a problem. When I use the code below in an app, always the last part of the texts is displayed. And I have to scroll up to read the top of the help file.

    Code:
    f=file("E:\\help.txt", "r")
    
    tx=f.read()
    
    #Close file
    f.close()
    Is there any way that, when I use the code, the first part of the texts is displayed?
    You know,

    That code doesn't actually "work" in S60 device. It doesn't show anything to anyone, just opens a text file and gets everything from it into a variable.

    Here I'm making a guess that you show the text to user using something like this totally non-tested code:

    Code:
    t = appuifw.Text()
    t.add(tx)
    t.set_pos(0)
    Using set_pos() you could move cursor position to top of the added text, which might (or not) also move focus to top of the text. Or maybe not

    Cheers,

    --jouni

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

    Re: want to write help file for mobile application in python??

    Quote Originally Posted by JOM View Post
    Code:
    t = appuifw.Text()
    t.add(tx)
    t.set_pos(0)
    Just to add to what Jouni mentioned, tx must be in Unicode.

    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  13. #13
    Registered User
    Join Date
    Jun 2008
    Posts
    18

    Re: want to write help file for mobile application in python??

    thanx v much

  14. #14
    Registered User
    Join Date
    Dec 2007
    Posts
    42

    Re: want to write help file for mobile application in python??

    can anyone plz help me here, i tried the code below but it didnt work. I hope what it does is something like opening a help page like they are there in options for most of the games.

    all i wrote was this ---

    Code:
    tx=u'Please help me, please. :smiles'
    t = appuifw.Text()
    t.add(tx)
    t.set_pos(0)

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

    Re: want to write help file for mobile application in python??

    You forgot to set it as the application's body, so that it would actually show something on the screen:
    Code:
    tx=u'Please help me, please. :smiles'
    t = appuifw.Text()
    t.add(tx)
    t.set_pos(0)
    appuifw.app.body=t

Similar Threads

  1. [announce] PyUIQ. Python for UIQ 2.1 and 3.x
    By OscarBernabeu in forum Symbian
    Replies: 35
    Last Post: 2008-01-17, 09:12
  2. How to write an object into a file
    By dmaroto83 in forum Symbian
    Replies: 3
    Last Post: 2007-11-06, 11:06
  3. Replies: 4
    Last Post: 2006-05-25, 18:32
  4. Application icon in Multiple sis file
    By umesh.roy in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2005-03-16, 09:39

Posting Permissions

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