Re: problems with opening files due to file's path



On Jun 10, 1:25 pm, "Thomas Morton" <morton.tho...@xxxxxxxxxxxxxx>
wrote:
maybe try string substitution... not sure if that's really the BEST way to
do it but it should work

startfile(r"%s"%variable)


I concur. That should work. A slightly more in depth example (assuming
Windows):

os.startfile(r'C:\Documents and Settings\%s\Desktop\myApp.exe' %
username)

or

os.startfile(r'C:\Program Files\%s' % myApp)

Hopefully this is what you are talking about. If you were referring to
passing in arguments, than you'll want to use the subprocess module
instead.



--------------------------------------------------
From: "Alexnb" <alexnbr...@xxxxxxxxx>
Sent: Tuesday, June 10, 2008 7:05 PM
To: <python-l...@xxxxxxxxxx>
Subject: Re: problems with opening files due to file's path



Well, now i've hit another problem, this time being that the path will be
a
variable, and I can't figure out how to make startfile() make it raw with
a
variable, if I put startfile(r variable), it doesn't work and
startfile(rvariable) obviously won't work, do you know how to make that
work
or better yet, how to take a regular string that is given and make every
single "\" into a double "\\"?


<snip>

Mike
.



Relevant Pages

  • Re: What is the maximal length of usernames on Solaris?
    ... > system to accommodate 4096 character user ID's. ... > 8 characters is to short in many circumstances. ... >>People who whine about petty shit such as how long a username can be ... but Windows uses a backward slash. ...
    (comp.sys.sun.admin)
  • RE: Adding a virtual FTP folder to IIS
    ... I think we can follow the Form Authentication modal. ... application will use the ASPNET account. ... If we change the username ... Windows identity different from that of the default process identity. ...
    (microsoft.public.dotnet.framework)
  • Re: Network shares and printing
    ... Windows cannot obtain the domain controller name for your computer network. ... shared drive and entering proper username and password. ...
    (microsoft.public.windowsxp.network_web)
  • Re: Security model advice, please help!!
    ... (Kerberos and Username). ... use the kerberos policy to consume the service (Using the current windows ... WSE includes a sample to configure different turn-key assertions for the ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: Locked out of my computer - please help
    ... > the bottom of the screen to use a Workgroup name. ... > says that either my username or password is incorrect. ... > latest Windows settings that worked. ... > I still do not have a recent backup. ...
    (microsoft.public.windowsxp.security_admin)