On Wednesday, April 5, 2023 at 3:55:47 PM UTC+8 Dima Pasechnik wrote:



On Wed, 5 Apr 2023, 01:02 Hongyi Zhao, <[email protected]> wrote:

See my following testing:

Method 1: This works:

sage: import sage.interfaces.gap
sage: sage.interfaces.gap.gap_cmd = "~/.local/bin/gap"
sage: gap.console()

Method 2: This fails:

sage: import sage.interfaces.gap as gap


this command essentially destroys pexpect GAP
interface, as gap is a "reserved" word (except  
that Python does not have this concept)
but you redefine it.


But other alternatives didn't work either:

sage: import sage.interfaces.gap as ggap
sage: ggap.gap_cmd="~/.local/bin/gap"
sage: ggap.console()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In [3], line 1
----> 1 ggap.console()

AttributeError: module 'sage.interfaces.gap' has no attribute 'console'

 




sage: gap.gap_cmd="~/.local/bin/gap"
sage: gap.console()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In [7], line 1
----> 1 gap.console()

AttributeError: module 'sage.interfaces.gap' has no attribute 'console'


So, how can I switch to gap console more concisely using the python 
assigning syntax to simplify the code snippet?


Regards,
Zhao

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/2e826aab-d887-437b-abe0-bbb59a1123e2n%40googlegroups.com
 
<https://groups.google.com/d/msgid/sage-support/2e826aab-d887-437b-abe0-bbb59a1123e2n%40googlegroups.com?utm_medium=email&utm_source=footer>
.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/8faf4e75-5f43-465d-b4ae-a18885201eccn%40googlegroups.com.

Reply via email to