1.

Solve : help with python (opening directories)i=100 l=1 zulupass = input("please enter t?

Answer»

i=100
l=1
zulupass = input("please enter three digit passcode")
if zulupass=="666":
print("welcome")
open("/Users/johntoniolo/Documents/pythonprojects")
else:
print("retry")
zulupass = input("please enter 3 digit passcode")
l -=1

if l<=0:
while i>1:
print("ATTEMPTS EXCEDED!!!!!!")
i -=1




OK I WANT THIS PASSWORD PROJECT TO OPEN ANOTHER FILE UPON PROPER PASSCODE... SO HOW CAN I MAKE A PYTHON PROJECT OPEN A SPECIFIED DIRECTORY. (IM ON OS X BTW) as you can see in line 6 i want to open a file. what am i doing wrong or is python not capable of opening files. im very NEW this is my like 4th program WRITEN.

thanks
iUserQuote

open("/Users/johntoniolo/Documents/pythonprojects")

That's not how you open files in Python. In fact that looks more a folder name than a file. Have you looked at any Python documentation?


that file is just a file i half effortly grabbed. what i want is to be able to PUT a simple self writen password program on a file. it is a good project i think for learning and practicing codes. so lets say i wanted to open ummmm. all my pictures. id asign it open ("yadyada the path for my pictures folder") and it WOULD open finder with the pictures folder pulled up. is my logical thinking correct
See here for example

http://stackoverflow.com/questions/3520493/python-show-in-finder

http://stackoverflow.com/questions/6631299/python-opening-a-folder-in-explorer-nautilus-mac-thingie






Discussion

No Comment Found