[scribus] path question for a script to find itself
ZASKE Martin
zm at revue-gugu.org
Wed Oct 18 15:07:48 UTC 2017
Thank you Juraj Fedel,
sys.path[0]
is exactly what I was looking for.
I estimate that I would have found this myself - in about just under 6
million days, by trying several ideas per hour.
Scripts are often "nothing special". But even within a project,
"branding" can help motivate or even avoid errors (because many TK GUI
windows look very much alike) and I don't want my team to process any
texts the wrong way around. So I am trying to make those windows a
little prettier and a little more distinct, using colours and visual
elements.
Other users want to try, just put something like this in your main()
where myicon is the whatever.ico including the entire path
root.iconbitmap(myicon)
Much appreciated,
Martin
On 18.10.2017 10:12, Juraj Fedel wrote:
> On Fri, Oct 13, 2017 at 02:47:13PM +0100, ZASKE Martin wrote:
>> Normally it would work with something like this:
>>
>> myicon = os.path.join(os.path.abspath('.'),'mybeautifulicon.ico')
>
> myicon = os.path.join(sys.path[0],'mybeautifulicon.ico')
>
> Scribus store path to currerntly running script in sys.path[0]
>
> Bye
> Juraj Fedel
>
> ___
> Scribus Mailing List: scribus at lists.scribus.net
> Edit your options or unsubscribe:
> http://lists.scribus.net/mailman/listinfo/scribus
> See also:
> http://wiki.scribus.net
> http://forums.scribus.net
>
> __________ Hinweis von ESET NOD32 Antivirus, Version der Erkennungsroutine 16261 (20171018) __________
>
> E-Mail wurde geprüft mit ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
>
--
ZASKE Martin
responsable GʊGʊ
BP 50 - Bassila - Bénin
tel GʊGʊ 66.66.11.11
tel pers 97.44.62.95
More information about the scribus
mailing list