basic code of what I am doing

A

Alexnb

Okay, so I wrote some code of basically what I will be doing, only with
exactly what I need for this part of the program but here you go:

Code:
from Tkinter import*
import os

class myApp:
    def __init__(self, parent):
        self.parent = parent

        self.baseContainer = Frame(self.parent)
        self.baseContainer.pack()

        self.e = Entry(self.baseContainer)
        self.e.bind("<Return>", self.entryEnter)
        self.e.pack()

        self.Button1 = Button(self.baseContainer, command =
self.buttonClick)
        self.Button1.configure(text="Submit")
        self.Button1.pack()


    def buttonClick(self):
        print "Button1 was clicked"
        path = self.e.get()
        path = "\"" + path + "\""
        os.startfile(path)

    def entryEnter(self, event):
        print "Enter was hit in the entry box"
        self.buttonClick()


root = Tk()
myapp = myApp(root)
root.mainloop()

[code]


[QUOTE]
I don't get why yall are being so rude about this. My problem is this; the
path, as a variable conflicts with other characters in the path, creating
escape characters I don't want, so I need a way to send the string to the
os.startfile() in raw, or, with all the backslashes doubled. Thats it,
I'll write some code of what it should work like, because I probably
should have done that; but you don't have to act like I am retarded...
that solves nothing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top