|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
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_oI 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
|
|||
|
|||
|
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)? |
|
#3
|
|||
|
|||
|
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 ^_^ |
|
#4
|
|||
|
|||
|
opps spelling messed :P "changed* insted of ganged" =P
|
|
#5
|
|||
|
|||
|
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 ^_^ |
|
#6
|
|||
|
|||
|
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. |
|
#7
|
|||
|
|||
|
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 |
|
#8
|
||||
|
||||
|
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 Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Python module or code |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|