Wolfram: Load a Package or File
Get (Load a File of Wolfram Code)
Get[filename]
-
🔸 SHORT SYNTAX:
<<filename
- Load a file of Wolfram language code, by file name.
- filename can also be file fullpath.
- If filename is not fullpath, search the file in
$Path
. 〔see Wolfram: Search Paths $Path〕
Get[ "PlaneCurvePlot.wl" ]
Get[ "c:/Users/xah/git/PlaneCurvePlot/PlaneCurvePlot.wl" ]
Example. Load File in Current Notebook Dir
(* load a file that is in the current notebook dir *) Get[FileNameJoin[ {NotebookDirectory[], "myfile.wl"}] ]
Example. Load File in Current Script Dir
(* load a file that is in the same dir as the running script *) Get[FileNameJoin[ {DirectoryName[ $InputFileName ] , "myfile.wl"]}]
Load a Package by Context Name
Needs[ ContextName ]
-
Load a file if ContextName is not already in
$Packages
The file name to load is based on ContextName to filename convention. You can give a second argument for a specific file name.
Once it figured out a file name, it calls
Get
to load the file.in general, for
Needs
to work, you should put packages in the Wolfram Library Dir, in theApplications
orAutoload
subdirectory.Needs[ "PlaneCurvePlot`" ]
Wolfram. Package, Load File
Wolfram. Shell Scripting Tasks
- Wolfram: Shell Scripting Tasks
- Wolfram: Navigate Directory
- Wolfram: List Files (Walk Directory)
- Wolfram: File Path Functions
- Wolfram: Delete Dir
- Wolfram: is File or Dir
- Wolfram: File Exist
- Wolfram: Get File Date
- Wolfram: Get File Size
- Wolfram: Print File Content
- Wolfram: Get File Hash
- Wolfram: Read File
- Wolfram: Read File from Web
- Wolfram: Write File
- Wolfram: Load a Package or File
- Wolfram: Get Environment Variable
- Wolfram: Date Time
- Wolfram: Find Replace Text 📜