Sorry, I was wrong :(
The right way is the following:
cur_path = "/".join(os.path.realpath(__file__).split('/')[:-1]) + "/"
salvus.load(cur_path + 'mystyles.css')



суббота, 2 августа 2014 г., 19:27:45 UTC+4 пользователь Андрей Ширшов 
написал:
>
> I found a solution :)
>
> cur_path = os.path.realpath(__file__) + "/"
> salvus.load(cur_path + 'mystyles.css')
>
> Thanks, Andrei.
>
> суббота, 2 августа 2014 г., 17:10:19 UTC+4 пользователь Андрей Ширшов 
> написал:
>>
>> Hi!
>> os.getcwd works very strange for me.
>> For example I have *mylib* folder. There are 2 files in it:
>>
>>    1. mymodule.py
>>    2. mystyles.css
>>
>> File mymodule.py has the following strings:
>> import sage_salvus as salvus # this in for sagemathcloud
>> import os
>> cur_path = os.getcwd() + '/'
>> salvus.load(cur_path + 'mystyles.css')
>>
>> I added path to mylib folder in sys.path. When I try to import my module 
>> I get error that file mystyles.css not found. And I see that sage try to 
>> find this file in directory of current file (in which I import mymodule).
>>
>> How can I fix my error?
>>
>> Thanks, Andrei.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to