Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: About to start a new project & looking for advice


06 Jun 2011   #21

Windows 7 Professional x64
 
 

Quote   Quote: Originally Posted by McP2143 View Post
I made a couple adjustments to briceh's program.

Drag & Drop

Still working on it but this works perfectly fine.

Attachment 158456
Very nice. One thing you might want to do is have it delete the quotation marks at the beginning and end of the file path when the use drags in a file. By the way, to take the middle characters of a string, you can use the following code:
Code:
string = "aThis is a string.a"
newString = string[1:-1] # newString will be "This is a string."
Hope this helps. I can make this addition for you if you want, but it sounds as if you might be enjoying making your own edits.

My System SpecsSystem Spec
.

07 Jun 2011   #22

Windows 7 Home Premium 64bit.
 
 

Guilty as charged

My biggest problem with removing the charcters is that they are different lengths for differnt files. I need to be able to take out everything up to and including the blank line after the words "PICK LIST" in order for this to run properly. This catch phrase occurs on a different line in each file. Have you tried out the full examples from my earlier post?

Also I needed to change the open line as it wouldn't accept the path c:\

I am trying to add a counter of sort to the "counted.txt" would like to get multiple files from one run "counted1.txt, counted2.txt, ..." and possible put them in their own folder?

Oh well to bed for me. Gotta wake up in 4 hrs... and counting
My System SpecsSystem Spec
07 Jun 2011   #23

Windows 7 Home Premium 64bit.
 
 

So i added the numbers to the save files. All Good!
Now to make this cut the nonsense from the original file.
Here is what I came up with so far.
Code:
import os.path
import time

def showme (afile):
    INfile = open(afile,'rt')
    text = INfile.read()
    print(afile)
    print(text)


def FindPicklist(bfile):
    INf = open(bfile)
    for line in INf:
            print (line)
            time.sleep(0)
            if ("  PICK LIST") in (line):
                print ("*"*800)

    
while True: 
    UFile = input ("Pick A File To View: ")
    if os.path.isfile(UFile):
        #showme(UFile)
        FindPicklist(UFile)
    else:
        print ("That isn't a file.")
My System SpecsSystem Spec
.


Reply

 About to start a new project & looking for advice




Thread Tools



Similar help and support threads for2: About to start a new project & looking for advice
Thread Forum
Solved Resolving a start up problem. Advice needed General Discussion
New Gaming Project Gaming
Novice Overclocker advice. Where to start? PC Custom Builds and Overclocking
Help with Project 64 Gaming
New theme project! Themes and Styles
help with project General Discussion
Advice on creating new start orb Customization

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 01:31 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33