×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Pune, india
    Posts
    186

    Question how to open notepad file through python code?

    hi


    please tell me how we could read notepad file(a.txt) stored in mobile through a python program.
    can we open that file via program to read???


    thanks in advance

  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: how to open notepad file through python code?

    See this article. And this documentation.

    Basically it would work like this (even though I'm summarising it for you, you should still read the article):
    Code:
    f=file("C:\\a.txt", "r")
    
    tx=f.read()  #Stores the content of a.txt in the variable tx
    
    #Remember to close the file after you're done with it
    f.close()

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

    Re: how to open notepad file through python code?

    it is very useful article for me. thanks

    but i know we can print data after reading file but if i want to open it as a notepad file as we open on pc and read , how could we do this???

    if u get a sms how it opens?? like that i want open that file, so is there any way to do this??

  4. #4
    Nokia Developer Moderator
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: how to open notepad file through python code?

    You can with Content_handler:
    Code:
    import appuifw
    
    c=appuifw.Content_handler()
    c.open("C:\\a.txt")

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

    Re: how to open notepad file through python code?

    oh!!!
    thanks it worked.
    thanks again!!!!

Similar Threads

  1. Obfuscate python code
    By bercobeute in forum Symbian
    Replies: 20
    Last Post: 2008-02-26, 20:06
  2. Porting C Open source.
    By debasish1234 in forum Open C/C++
    Replies: 7
    Last Post: 2008-01-28, 11:06
  3. Python 2.5 & Open C
    By GameDude in forum Symbian
    Replies: 2
    Last Post: 2008-01-11, 14:21
  4. open file , GetDir & descriptors problem
    By JeanLaville in forum Symbian
    Replies: 2
    Last Post: 2007-05-14, 18:22

Posting Permissions

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