Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
import os.path
os.path.join("c:",
>..."Documents and Settings",
>..."somepath")
>'c:Documents and Settings\\somepath'
>
>Hmmm, a quick test with
>
>dir "e:userdata"
>
>worked, so the top level \ may not be needed...
"drive:" is
"Dan Bishop" <[EMAIL PROTECTED]> wrote:
> Windows system calls treat / and \ interchangeably, but the command
> prompt insists on backslashes.
No. Commands built-in to the command prompt and certain other programs
(mostly but not exclusively from Microsoft) insist on backslashes. Most
programs,
On Feb 27, 9:16 am, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Tue, 27 Feb 2007 06:24:41 -0800, svata wrote:
...
> > import time
> > import os
>
> > dir = "C:\\Documents and Settings\\somepath\\"
>
> I believe that Windows will accept forward slashes as directory
> separators, so you can write
On Feb 27, 2:36 pm, "Sriram" <[EMAIL PROTECTED]> wrote:
> Hello svata,
> It is always better to compose your string before you send it as a
> command.
>
> try printing your command string out like this :
> print 'gvim dir+fileName+".txt". You'll see what the problem is.
>
> One possible solution is
On Tue, 27 Feb 2007 06:24:41 -0800, svata wrote:
> Hello,
>
> as I'm new to python I've stumbled accros os.system and its not very
> well documented usage.
Documentation seems pretty good to me.
system(...)
system(command) -> exit_status
Execute the command (a string) in a subshell.
W
svata wrote:
> Hello,
>
> as I'm new to python I've stumbled accros os.system and its not very
> well documented usage.
>
> I use Win XP Pro and Python 2.5.
>
> Here is the code snippet:
>
> --
>
>
Do you mean:
import time, os
dir = "C:\\Documents and Settings\\somepath\\"
fileName = time.strftime("%d%m%Y")
finalname = "%s%s.txt" % (dir,fileName)
print finalname
C:\Documents and Settings\somepath\27022007.txt
On 27 Feb 2007 06:24:41 -0800, svata <[EMAIL PROTECTED]> wrote:
Hello,
as I
Hello svata,
It is always better to compose your string before you send it as a
command.
try printing your command string out like this :
print 'gvim dir+fileName+".txt". You'll see what the problem is.
One possible solution is to compose your command string in the
following manner:
cmd = "gvim %