On Mon, Oct 12, 2009 at 9:42 AM, William Stein <wst...@gmail.com> wrote: > > On Mon, Oct 12, 2009 at 6:52 AM, Marshall Hampton <hampto...@gmail.com> wrote: >> >> Its a little thing, but I noticed that the DATA directory is missing >> its last '/', which is present in previous notebook versions. I like >> having a trailing '/' present in a directory string, so this seems >> like a regression. Haven't noticed anything else yet. > > It was a design decision, but I'm willing to change it. I've made the > code in the notebook cross-platform as much as possible, since next I > want to port it to work under Windows. So I make the DATA directory > name using "os.path.join", which doesn't put a trailing slash in. One > should write code using os.path.join too, which means you shouldn't > depend on a slash being forward -- it might be backwards (on windows > it is). > > I could make DATA be of the form: DATA = ...' + os.path.sep > which on UNIX would still have / at the end and on Windows would end in \. > Should I do that?
If it helps, I myself use it as: f = open(DATA+'some_file') so I am for adding the last "/" by default. Ondrej --~--~---------~--~----~------------~-------~--~----~ To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---