#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    10
    Rep Power
    0

    Question Python module or code


    I have this program that will convert .txt or any word extention document file into what ever a user wants (no matter how outrageous they want to change it to). The problem is that my programing limmit has been reched and I need help in a module or if anyone knows an actual raw code that will make this work ....and if it can be defined in the code by the def command thats cool to ....this is bugging the hell outa me 0_o

    I just know it has to be something simple, but I just can't see the code in this prog I'm making.Anywho in the end its has to look sorta like this :
    ------------------------------------------------------
    =====================
    Data Format Converter
    ---------------------

    Enter the name of the data file to convert:

    file.dat

    Enter a file name for the converted data:

    weather.new

    Processing file ... done.
    ------------------------------------------------------

    Well the ya go nothing hard in output but the processing is hell I just can't wrap my mind around it.
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    Tucson AZ
    Posts
    29
    Rep Power
    0
    Quick question...
    Are you wanting to take, as an example, word.doc and convert it to word.new and expect word.new to open in Word? just like the word.doc did?
    Or are you trying to take a Word.doc and convert it to Word.txt and expect to see the contents in plain text (minus the word formatting)?
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    10
    Rep Power
    0

    Smile


    I am just going to gange the extention to the file thats all the user after the prog has runned can open it and thake a look basic ly its just canging a file.txt in what ever the user wants like file.txt into file.fla....any three leter or number extention ^_^
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    10
    Rep Power
    0
    opps spelling messed :P "changed* insted of ganged" =P
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    10
    Rep Power
    0
    blaaa im too tired :P lets try this agian:

    I am just going to change the extention to the file....thats all the user dose, after the prog has runned the user can open the file and take a look. Basicly its just changing a file.txt in what ever the user wants like file.txt into file.fla....any three leter or number extention ^_^
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    Tucson AZ
    Posts
    29
    Rep Power
    0
    Try using the shutil module http://www.python.org/doc/current/l...ule-shutil.html.

    There is another thread already about renaming files you can look for some coding ideas.
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    10
    Rep Power
    0
    wahoo...this is what I was looking for for some reason I couldn't see it on python's website :/...... now to see if this really works 0_o *hopes hopes hopes* =P
  14. #8
  15. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,593
    Rep Power
    4207
    os.rename()
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo