Results 1 to 10 of 18

Thread: Python and excel

Hybrid View

  1. #1
    Join Date
    Jun 2007
    Location
    Costa Rica
    Beans
    117
    Distro
    Ubuntu 10.04 Lucid Lynx

    Python and excel

    Hello everyone!

    I'd like to know if I could make a program that is able to add stuff to excel... Well... I know it's possible ... I'm asking what I need to do with python and if you know any tutorial or could explain me a bit about it... I want to make a program (without GUI I don't really care about that right now) that is able to add some stuff about people... like this:

    | Name | Place | Phone | More stuff | More stuff |
    --------------------------------------------------


    Now i need that python ask for Name... Place... Phone... and the other stuff... I can make python ask for that... what i need is that python add it to a xls file in correct order so if you could help me thanks a lot!!

  2. #2
    Join Date
    May 2009
    Beans
    160

    Re: Python and excel


  3. #3
    Join Date
    Jun 2008
    Location
    Narnia
    Beans
    784
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Python and excel

    Quote Originally Posted by TheStatsMan View Post
    This is probably the solution, but if you don't want to mess with third-party libraries, and you just need to use Python to put stuff into an Excel spreadsheet, you can create a .csv (comma-separated value) file using Python's native file-handling, and then import it in Excel.

    Forget I said that. Use the library.
    Blog
    #!
    Chan eil mi a Gàidhlig agam...pero si hablo español: soy catracho.
    Proud to be a Browncoat!

  4. #4
    Join Date
    Jun 2007
    Location
    Costa Rica
    Beans
    117
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Python and excel

    haha nice thanks a lot... I see that i use this to write to cells:

    sheet1.write(0, 0, "This is the First Cell of the First Sheet")

    in which 0's are rows and columns... is there a way they go like 0, 1... 0,2... and so on for my program? like... It ask for names... and all names should go: 0,1 0,2 0,3 0,4 .... and etc for x numbers of names... and Phones should go 1,1 1,2 1,3 ,1,4 and stuff like that? if you could help I'd love it~ thanks... I'm only 16 years old.. :/ self learning is a bit hard for me...

  5. #5
    Join Date
    Jun 2008
    Location
    Narnia
    Beans
    784
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Python and excel

    Quote Originally Posted by Atzu View Post
    haha nice thanks a lot... I see that i use this to write to cells:

    sheet1.write(0, 0, "This is the First Cell of the First Sheet")

    in which 0's are rows and columns... is there a way they go like 0, 1... 0,2... and so on for my program? like... It ask for names... and all names should go: 0,1 0,2 0,3 0,4 .... and etc for x numbers of names... and Phones should go 1,1 1,2 1,3 ,1,4 and stuff like that? if you could help I'd love it~ thanks... I'm only 16 years old.. :/ self learning is a bit hard for me...
    OK.

    First, read this. I don't want to give the answer away, but think about the following:
    • What numbers are changing?
    • How can they be expressed as variables (as in: which ones should be combined into one variable)?
    • How can you have the variable change as needed? Will you use a loop? How?


    Then write some code, test it, and come back here to tell use how it worked--then we can give you some more hints as necessary. Even if it works, we may be able to make it more elegant.



    I'm 16 too, and owe my knowledge of Python (and, to a lesser extent, Java) to this forum. In the summer of '08 I crawled through the Python tutorial I linked to above, experimented, made mistakes, asked amateur questions on the forums, was very polite and appreciative to those who helped me, and now they seem to have left (nvteighen, ¡te extraño! pmasiar, where'd you go‽ LaRoza, why'd you let yourself get banned?) And now I'm helping people. That's scary. Forgive my old-man-style reminiscences, but the moral to the story is to look past the short-term (solving your Excel problem) and using this great community to help you become a better programmer. I will not tolerate any "I'm too you and stupid" ridiculousness.

    PS: Veo que vives en Costa Rica...¿supongo qué hablas español? Yo nací en Tegucigalpa, Honduras, y viví allí para nueve años. Y el año pasado viví en Madrid para seis meses.
    Last edited by fiddler616; December 22nd, 2009 at 06:05 AM.
    Blog
    #!
    Chan eil mi a Gàidhlig agam...pero si hablo español: soy catracho.
    Proud to be a Browncoat!

  6. #6
    Join Date
    Jun 2007
    Location
    Costa Rica
    Beans
    117
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Python and excel

    Heh... Thanks a lot... I'll continue this tomorrow morning I want to do this to make easier something my dad asked to me xD... So it isn't really necessary... still if i dont make it at time I'll want to finish this later it may help my dad for doing this again next month lol...

    PS: Si hablo español gusto en conocerte y gracias por la ayuda ^^ pero aqui ya es tarde y puedo continuar mañana. Gracias No creo que sea tan dificil lo que ocupo... Jaja

  7. #7
    Join Date
    Aug 2006
    Location
    60°27'48"N 24°48'18"E
    Beans
    3,458

    Re: Python and excel

    Quote Originally Posted by fiddler616 View Post
    ...pmasiar, where'd you go‽
    ... banned, due to one too many a clash with the pointer-crowd

    At least LaRoza is around LambdaGrok (see my sig, I guess I'll plug that place a bit although it's relatively quiet), and even pmasiar theoretically is, although he's very busy in his real-life atm.
    LambdaGrok. | #ubuntu-programming on FreeNode

Tags for this Thread

Bookmarks

Posting Permissions

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