我找不到数学中如何使用相对路径。 我的目录结构很简单 。
Import["G:\Research\Acc and Vel Runs\5-24\Mathematica\Data\250
Acc.xls"][[1]] // TableForm
此路径通过使用菜单中的插入路径来显示绝对路径。 我希望这本笔记本能够被移动。 我想给某人“ 数学” 目录, 我希望他们能够运行代码。 我不想让路径中断, 因为路径将运行在不同的机器上。 基本上我只想使用从上面显示的数学水平开始的相对路径 。
我找不到数学中如何使用相对路径。 我的目录结构很简单 。
Import["G:\Research\Acc and Vel Runs\5-24\Mathematica\Data\250
Acc.xls"][[1]] // TableForm
此路径通过使用菜单中的插入路径来显示绝对路径。 我希望这本笔记本能够被移动。 我想给某人“ 数学” 目录, 我希望他们能够运行代码。 我不想让路径中断, 因为路径将运行在不同的机器上。 基本上我只想使用从上面显示的数学水平开始的相对路径 。
在数学中,您可以使用 timinary[]
获得当前目录,也可以使用 set Staminy[]
将其设置为其他目录。您可以使用 reer timory[]
回到最后一个位置,或者使用 titutyStack[]
检查所有先前的位置。
文件这里。
您可以将当前目录设置为笔记本使用的目录
SetDirectory[NotebookDirectory[]]
注目目录
要工作, 您必须使用前端, 笔记本必须保存 。
您总是可以使用与当前目录相对的路径( timinaly[]
),例如 import[""Data/ somedata.txt"]
。
关于目录分隔符:所有 Windows/Linux/Mac 上的 < code>/ 将永远有效。 在输入相对路径名称时, 只需使用 < code>/ 便携性比 < code> FileNameJoin 更容易得多。
我通常这样做。
SetDirectory[
FileNameJoin[{$InitialDirectory, "dir1", "dir2"}]];
Quiet[Close["Log.txt"]];
logStream = Quiet[OpenWrite["xmlAreaTagsLog.txt"]];
xmlDoc = Import["XmlData.xml"];
使用 $Intiative 日志为您获取.nb 目录, 使用 FileNameJoin 允许您相对访问 。
I am trying to find out the difference between difference service account types. I tumbled upon this question. The answer was because it has powerful access to local resources, and Network Service ...
Does anyone know how to programatically detect that a Windows server is part of a cluster? Further, is it possible to detect that the server is the active or passive node? [Edit] And detect it from ...
I ve read Get File Icon used by Shell and the other similar posts - and already use SHFileInfo to get the associated icon for any given extension, and that works great. However, Outlook uses ".msg" ...
How can I create an empty file at the DOS/Windows command-line? I tried: copy nul > file.txt But it always displays that a file was copied. Is there another method in the standard cmd? It should ...
I know about the GetLastInputInfo method but that would only give me the duration since last user input - keyboard or mouse. If a user input was last received 10 minutes ago, that wouldn t mean the ...
My application creates a thread and that runs in the background all the time. I can only terminate the thread manually, not from within the thread callback function. At the moment I am using ...
Yes, I know, the archive bit is evil. That being said, is there support for querying it with find , and modifying it with chmod ? My googling has turned up nothing......
I built a Java application that is delivered on USB sticks. To ensure compatibility, I ship an appropriate JVM on the sticks. I made an EXE that simply invokes this JVM with the application jar. Now ...