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
BriceH

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
McP2143

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
McP2143

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
Thread Forum
Resolving a start up problem. Advice needed
Hi, This is my first posting so hello to All and apologies if this is in the wrong section. I have a rather odd problem with an HP Pavilion G6 laptop, with Windows 7 Home Premium edition. When starting up it sometimes hangs after the windows logo, turns to a black screen with cursor only and...
General Discussion
Novice Overclocker advice. Where to start?
Hello, I'm interested in overclocking my FX 8150 but I dont want to start without some advice. If my system will handle it where would i start? any help appreciated My specs: AsRock 970 extreme3 AMD FX-8150 Corsair cmx8gx3m2a1333c9 8gb (4x2) Corsair TX750 PSU Asus 6950 DCII 2gb GPU
PC Custom Builds and Overclocking
New theme project!
So I just decided to take on a daunting new project: This new project is the MAC OSX theme. (for the purpose of this screenshot--which went on Facebook as well, in my "computer stuff" picture journal--I disabled the transparency, but just know I do have glass transparency on the window shells) ...
Themes and Styles
help with project
I have to do a project for my computer literacy class, and it requires Windows XP. All that I have access to is Windows 7. Is there any way to get an interactive XP interface on my Windows 7 laptop?
General Discussion
Advice on creating new start orb
Morning all, i want to make it my task for the day to create a new start orb, i have bee watching lots of vids on youtube as well as reading the tut on here but must admit it sounds kinda confusing. I dont actually have photoshop and was wondering if it was possible to use a different app. Im...
Customization
Help With my HTML Project ;)
Im just learning basic HTML, and this is my first year - and i need some help with my project!! Here is my code so-far: But I left space in between the <script language=JavaScript> and the </script> tags for my variables. Thats really all i dont kno how to do :P <html> <head> <!--MADE...
Chillout Room

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 19:20.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App