works for me.
Example:
[EMAIL PROTECTED]:~/python/pyx$ cat hello.py
from pyx import *
c = canvas.canvas()
c.stroke(path.line(0, 0, 2, 0))
c.writePDFfile("doesexist/hello")
c.writePDFfile("doesnotexist/hello")
Running ...
[EMAIL PROTECTED]:~/python/pyx$ python hello.py
Traceback (most recent call last):
File "hello.py", line 6, in <module>
c.writePDFfile("doesnotexist/hello")
File "/Users/andre/wobsta/dpg/2008/stat/pyx/canvas.py", line
288, in wrappedindocument
return method(d, file)
File "/Users/andre/wobsta/dpg/2008/stat/pyx/document.py", line
171, in writePDFfile
pdfwriter.PDFwriter(self, _outputstream(file, "pdf"), **kwargs)
File "/Users/andre/wobsta/dpg/2008/stat/pyx/document.py", line
147, in _outputstream
return open("%s.%s" % (file, suffix), "wb")
IOError: [Errno 2] No such file or directory: 'doesnotexist/
hello.pdf'
and creates ...
[EMAIL PROTECTED]:~/python/pyx$ ls *exist/*
doesexist/hello.pdf
André
Am 22.04.2008 um 20:23 schrieb Rich Shepard:
> On Tue, 22 Apr 2008, Alan G Isaac wrote:
>
>> What happens when you use a relative path? You can always use an
>> absolute
>> path. Or so I recall ... (on the run).
>
> Alan,
>
> I must have not clearly expressed my question. I cannot get the
> proper
> syntax.
>
> If I use:
>
> g.writePDFfile('./reports/'+curComp + '_' + curSub + '_' +
> curVar)
>
> nothing is written. If I use
>
> g.writePDFfile(./reports/+curComp + '_' + curSub + '_' + curVar)
>
> python finds the '.' to be a syntax error.
>
> So, let me ask the question this way: how do I write the statement
> to
> direct output to a subdirectory immediately below the CWD in which the
> application is running?
>
> Thanks,
>
> Rich
>
> --
> Richard B. Shepard, Ph.D. | Integrity
> Credibility
> Applied Ecosystem Services, Inc. | Innovation
> <http://www.appl-ecosys.com> Voice: 503-667-4517 Fax:
> 503-667-8863
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save
> $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> PyX-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pyx-user
>
--
by _ _ _ Dr. André Wobst, Amselweg 22, 85716 Unterschleißheim
/ \ \ / ) [EMAIL PROTECTED], http://www.wobsta.de/
/ _ \ \/\/ / PyX - High quality PostScript and PDF figures
(_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user