About to start a new project & looking for advice

I made a couple adjustments to briceh's program.

Drag & Drop

Still working on it but this works perfectly fine.

View 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 Computer My Computer

At a glance

Windows 7 Professional x64Intel Core i7-2720QM4GB (2 x 2GB)NVIDIA Quadro 2000M (with Optimus)
Computer Manufacturer/Model Number
Lenovo ThinkPad W520 (4270CT)
OS
Windows 7 Professional x64
CPU
Intel Core i7-2720QM
Memory
4GB (2 x 2GB)
Graphics Card(s)
NVIDIA Quadro 2000M (with Optimus)
Hard Drives
500 GB @ 7200 RPM
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
:sleepy:
 

My Computer My Computer

At a glance

Windows 7 Home Premium 64bit.
OS
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 Computer My Computer

At a glance

Windows 7 Home Premium 64bit.
OS
Windows 7 Home Premium 64bit.
Back
Top