How to (optionally) suppress package welcome message?FeynRules PackagePackage Loading: How to get rid of Needs::nocont?What is the appropriate way to handle JVM memory issues in a Mathematica package?Where does a package have to be loaded?linking usage message to package documentationDisable “Load at Startup” checkbox in Add-Ons listWhy can't package call imported association list?How to install custom packagePackage MathWorldHow to load a package

Why won't the ground take my seed?

Who gets an Apparition licence?

What is "oversubscription" in Networking?

Can I ask to speak to my future colleagues before accepting an offer?

What does Mildred mean by this line in Three Billboards Outside Ebbing, Missouri?

Prime parity peregrination

Is there reliable evidence that depleted uranium from the 1999 NATO bombing is causing cancer in Serbia?

Why do I need two parameters in an HTTP parameter pollution attack?

How exactly is a normal force exerted, at the molecular level?

Was it really unprofessional of me to leave without asking for a raise first?

Is there any problem with this camera not having a lens cover?

Skipping over failed imports until they are needed (if ever)

Wrong corporate name on employment agreement

Why do the keys in the circle of fifths have the pattern of accidentals that they do?

Do the 26 richest billionaires own as much wealth as the poorest 3.8 billion people?

Why does a brace command group need spaces after the opening brace in POSIX Shell Grammar?

What are good ways to spray paint a QR code on a footpath?

One folder two different locations on ubuntu 18.04

Can a Federation colony become a member world?

Understanding Lasso Regression's sparsity geometrically

What is the highest number of sneak attacks that a Pure/High Level Rogue (Level 17+) can make in one round?

Does Anosov geodesic flow imply asphericity?

Is there a way for presidents to legally extend their terms beyond the maximum of four years?

Can I travel from Germany to England alone as an unaccompanied minor?



How to (optionally) suppress package welcome message?


FeynRules PackagePackage Loading: How to get rid of Needs::nocont?What is the appropriate way to handle JVM memory issues in a Mathematica package?Where does a package have to be loaded?linking usage message to package documentationDisable “Load at Startup” checkbox in Add-Ons listWhy can't package call imported association list?How to install custom packagePackage MathWorldHow to load a package






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








7












$begingroup$


I'm working on a package and I want it to (usually) print a welcome message when it's loaded, primarily to leave a written trace of the version number in the notebook where it's used. For example:



BeginPackage["Test`"];
Test::usage="Testing";
Begin["`Private`"];
Print["Test Package Version 1.0"];
Test:=Print["123"];
End[];
EndPackage[];

<<Test`
(* Test Package Version 1.0 *)


However this gets cumbersome in the documentation pages I'm writing, so I'd like a way to omit the welcome message. Maybe with a semicolon, as:



Needs["Test`"];
(* silently loads package *)


However, the Print inside the package doesn't care if Needs has a semicolon or not. Is there some straightforward way to achieve this effect?










share|improve this question











$endgroup$







  • 2




    $begingroup$
    Instead of Print your could just return your string after EndPackage[].
    $endgroup$
    – Kuba
    Jun 18 at 8:46










  • $begingroup$
    @Kuba Thanks, I suspected there might be an easy way. I'd tried including the string, but not after EndPackage[].
    $endgroup$
    – Chris K
    Jun 18 at 8:49










  • $begingroup$
    @Kuba Have you ever used this in practice? I'd like to read opinions about how well it works in practice. I never thought of this solution, but it looks to be very useful.
    $endgroup$
    – Szabolcs
    Jun 18 at 8:51










  • $begingroup$
    @Szabolcs It seems to work for me so far.
    $endgroup$
    – Chris K
    Jun 18 at 8:54










  • $begingroup$
    @Szabolcs I didn't have a use case for such message. Otoh the fewer side effects package loading has the better. Atm I don't see where this can lead to a problem.
    $endgroup$
    – Kuba
    Jun 18 at 8:56

















7












$begingroup$


I'm working on a package and I want it to (usually) print a welcome message when it's loaded, primarily to leave a written trace of the version number in the notebook where it's used. For example:



BeginPackage["Test`"];
Test::usage="Testing";
Begin["`Private`"];
Print["Test Package Version 1.0"];
Test:=Print["123"];
End[];
EndPackage[];

<<Test`
(* Test Package Version 1.0 *)


However this gets cumbersome in the documentation pages I'm writing, so I'd like a way to omit the welcome message. Maybe with a semicolon, as:



Needs["Test`"];
(* silently loads package *)


However, the Print inside the package doesn't care if Needs has a semicolon or not. Is there some straightforward way to achieve this effect?










share|improve this question











$endgroup$







  • 2




    $begingroup$
    Instead of Print your could just return your string after EndPackage[].
    $endgroup$
    – Kuba
    Jun 18 at 8:46










  • $begingroup$
    @Kuba Thanks, I suspected there might be an easy way. I'd tried including the string, but not after EndPackage[].
    $endgroup$
    – Chris K
    Jun 18 at 8:49










  • $begingroup$
    @Kuba Have you ever used this in practice? I'd like to read opinions about how well it works in practice. I never thought of this solution, but it looks to be very useful.
    $endgroup$
    – Szabolcs
    Jun 18 at 8:51










  • $begingroup$
    @Szabolcs It seems to work for me so far.
    $endgroup$
    – Chris K
    Jun 18 at 8:54










  • $begingroup$
    @Szabolcs I didn't have a use case for such message. Otoh the fewer side effects package loading has the better. Atm I don't see where this can lead to a problem.
    $endgroup$
    – Kuba
    Jun 18 at 8:56













7












7








7


2



$begingroup$


I'm working on a package and I want it to (usually) print a welcome message when it's loaded, primarily to leave a written trace of the version number in the notebook where it's used. For example:



BeginPackage["Test`"];
Test::usage="Testing";
Begin["`Private`"];
Print["Test Package Version 1.0"];
Test:=Print["123"];
End[];
EndPackage[];

<<Test`
(* Test Package Version 1.0 *)


However this gets cumbersome in the documentation pages I'm writing, so I'd like a way to omit the welcome message. Maybe with a semicolon, as:



Needs["Test`"];
(* silently loads package *)


However, the Print inside the package doesn't care if Needs has a semicolon or not. Is there some straightforward way to achieve this effect?










share|improve this question











$endgroup$




I'm working on a package and I want it to (usually) print a welcome message when it's loaded, primarily to leave a written trace of the version number in the notebook where it's used. For example:



BeginPackage["Test`"];
Test::usage="Testing";
Begin["`Private`"];
Print["Test Package Version 1.0"];
Test:=Print["123"];
End[];
EndPackage[];

<<Test`
(* Test Package Version 1.0 *)


However this gets cumbersome in the documentation pages I'm writing, so I'd like a way to omit the welcome message. Maybe with a semicolon, as:



Needs["Test`"];
(* silently loads package *)


However, the Print inside the package doesn't care if Needs has a semicolon or not. Is there some straightforward way to achieve this effect?







packages






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 18 at 14:50









user64494

4,1252 gold badges14 silver badges23 bronze badges




4,1252 gold badges14 silver badges23 bronze badges










asked Jun 18 at 8:35









Chris KChris K

8,7382 gold badges23 silver badges48 bronze badges




8,7382 gold badges23 silver badges48 bronze badges







  • 2




    $begingroup$
    Instead of Print your could just return your string after EndPackage[].
    $endgroup$
    – Kuba
    Jun 18 at 8:46










  • $begingroup$
    @Kuba Thanks, I suspected there might be an easy way. I'd tried including the string, but not after EndPackage[].
    $endgroup$
    – Chris K
    Jun 18 at 8:49










  • $begingroup$
    @Kuba Have you ever used this in practice? I'd like to read opinions about how well it works in practice. I never thought of this solution, but it looks to be very useful.
    $endgroup$
    – Szabolcs
    Jun 18 at 8:51










  • $begingroup$
    @Szabolcs It seems to work for me so far.
    $endgroup$
    – Chris K
    Jun 18 at 8:54










  • $begingroup$
    @Szabolcs I didn't have a use case for such message. Otoh the fewer side effects package loading has the better. Atm I don't see where this can lead to a problem.
    $endgroup$
    – Kuba
    Jun 18 at 8:56












  • 2




    $begingroup$
    Instead of Print your could just return your string after EndPackage[].
    $endgroup$
    – Kuba
    Jun 18 at 8:46










  • $begingroup$
    @Kuba Thanks, I suspected there might be an easy way. I'd tried including the string, but not after EndPackage[].
    $endgroup$
    – Chris K
    Jun 18 at 8:49










  • $begingroup$
    @Kuba Have you ever used this in practice? I'd like to read opinions about how well it works in practice. I never thought of this solution, but it looks to be very useful.
    $endgroup$
    – Szabolcs
    Jun 18 at 8:51










  • $begingroup$
    @Szabolcs It seems to work for me so far.
    $endgroup$
    – Chris K
    Jun 18 at 8:54










  • $begingroup$
    @Szabolcs I didn't have a use case for such message. Otoh the fewer side effects package loading has the better. Atm I don't see where this can lead to a problem.
    $endgroup$
    – Kuba
    Jun 18 at 8:56







2




2




$begingroup$
Instead of Print your could just return your string after EndPackage[].
$endgroup$
– Kuba
Jun 18 at 8:46




$begingroup$
Instead of Print your could just return your string after EndPackage[].
$endgroup$
– Kuba
Jun 18 at 8:46












$begingroup$
@Kuba Thanks, I suspected there might be an easy way. I'd tried including the string, but not after EndPackage[].
$endgroup$
– Chris K
Jun 18 at 8:49




$begingroup$
@Kuba Thanks, I suspected there might be an easy way. I'd tried including the string, but not after EndPackage[].
$endgroup$
– Chris K
Jun 18 at 8:49












$begingroup$
@Kuba Have you ever used this in practice? I'd like to read opinions about how well it works in practice. I never thought of this solution, but it looks to be very useful.
$endgroup$
– Szabolcs
Jun 18 at 8:51




$begingroup$
@Kuba Have you ever used this in practice? I'd like to read opinions about how well it works in practice. I never thought of this solution, but it looks to be very useful.
$endgroup$
– Szabolcs
Jun 18 at 8:51












$begingroup$
@Szabolcs It seems to work for me so far.
$endgroup$
– Chris K
Jun 18 at 8:54




$begingroup$
@Szabolcs It seems to work for me so far.
$endgroup$
– Chris K
Jun 18 at 8:54












$begingroup$
@Szabolcs I didn't have a use case for such message. Otoh the fewer side effects package loading has the better. Atm I don't see where this can lead to a problem.
$endgroup$
– Kuba
Jun 18 at 8:56




$begingroup$
@Szabolcs I didn't have a use case for such message. Otoh the fewer side effects package loading has the better. Atm I don't see where this can lead to a problem.
$endgroup$
– Kuba
Jun 18 at 8:56










1 Answer
1






active

oldest

votes


















9












$begingroup$

Moving my comment to the answer: you can put your message after EndPackage[] instead of printing it:



BeginPackage["Test`"];
Test::usage="Testing";
Begin["`Private`"];
Test:=Print["123"];
End[];
EndPackage[];
"Test Package Version 1.0"


It seems to do exactly what you want.






share|improve this answer









$endgroup$








  • 3




    $begingroup$
    Reference from the documentation for Get: "<<name reads in a file, evaluating each expression in it and returning the last one."
    $endgroup$
    – Michael E2
    Jun 18 at 22:50













Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f200577%2fhow-to-optionally-suppress-package-welcome-message%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









9












$begingroup$

Moving my comment to the answer: you can put your message after EndPackage[] instead of printing it:



BeginPackage["Test`"];
Test::usage="Testing";
Begin["`Private`"];
Test:=Print["123"];
End[];
EndPackage[];
"Test Package Version 1.0"


It seems to do exactly what you want.






share|improve this answer









$endgroup$








  • 3




    $begingroup$
    Reference from the documentation for Get: "<<name reads in a file, evaluating each expression in it and returning the last one."
    $endgroup$
    – Michael E2
    Jun 18 at 22:50















9












$begingroup$

Moving my comment to the answer: you can put your message after EndPackage[] instead of printing it:



BeginPackage["Test`"];
Test::usage="Testing";
Begin["`Private`"];
Test:=Print["123"];
End[];
EndPackage[];
"Test Package Version 1.0"


It seems to do exactly what you want.






share|improve this answer









$endgroup$








  • 3




    $begingroup$
    Reference from the documentation for Get: "<<name reads in a file, evaluating each expression in it and returning the last one."
    $endgroup$
    – Michael E2
    Jun 18 at 22:50













9












9








9





$begingroup$

Moving my comment to the answer: you can put your message after EndPackage[] instead of printing it:



BeginPackage["Test`"];
Test::usage="Testing";
Begin["`Private`"];
Test:=Print["123"];
End[];
EndPackage[];
"Test Package Version 1.0"


It seems to do exactly what you want.






share|improve this answer









$endgroup$



Moving my comment to the answer: you can put your message after EndPackage[] instead of printing it:



BeginPackage["Test`"];
Test::usage="Testing";
Begin["`Private`"];
Test:=Print["123"];
End[];
EndPackage[];
"Test Package Version 1.0"


It seems to do exactly what you want.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jun 18 at 8:58









KubaKuba

109k12 gold badges215 silver badges551 bronze badges




109k12 gold badges215 silver badges551 bronze badges







  • 3




    $begingroup$
    Reference from the documentation for Get: "<<name reads in a file, evaluating each expression in it and returning the last one."
    $endgroup$
    – Michael E2
    Jun 18 at 22:50












  • 3




    $begingroup$
    Reference from the documentation for Get: "<<name reads in a file, evaluating each expression in it and returning the last one."
    $endgroup$
    – Michael E2
    Jun 18 at 22:50







3




3




$begingroup$
Reference from the documentation for Get: "<<name reads in a file, evaluating each expression in it and returning the last one."
$endgroup$
– Michael E2
Jun 18 at 22:50




$begingroup$
Reference from the documentation for Get: "<<name reads in a file, evaluating each expression in it and returning the last one."
$endgroup$
– Michael E2
Jun 18 at 22:50

















draft saved

draft discarded
















































Thanks for contributing an answer to Mathematica Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f200577%2fhow-to-optionally-suppress-package-welcome-message%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form