Created
March 28, 2016 08:50
-
-
Save purvalpatel/abbe1f4dce3b0c99d347 to your computer and use it in GitHub Desktop.
Path validation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def on_mkdir_clicked(self,widget): | |
path1=self.entry1.get_text() | |
if os.path.isabs(path1): | |
print("valid path") | |
else: | |
print("invalid path") | |
if not os.path.exists(path1): | |
os.mkdir(path1) | |
print path1 | |
else: | |
dialog = Gtk.MessageDialog(self, 0, Gtk.MessageType.ERROR,Gtk.ButtonsType.CANCEL, "ERROR") | |
dialog.format_secondary_text("File Already Exist,Or Invalid Path Name") | |
dialog.run() | |
dialog.destroy() | |
# print("Directory exist") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment