ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 15 Apr 2018 12:08:16 -0500temp22.sobj is not UTF-8 encodedhttp://ask.sagemath.org/question/41890/temp22sobj-is-not-utf-8-encoded/I get a temp22.sobj is not UTF-8 encoded after trying to open this file
I saved by using save(G.allsimplecycles, 'temp22') what am I doing wrong?
Fri, 06 Apr 2018 12:33:52 -0500http://ask.sagemath.org/question/41890/temp22sobj-is-not-utf-8-encoded/Comment by slelievre for <p>I get a temp22.sobj is not UTF-8 encoded after trying to open this file
I saved by using save(G.allsimplecycles, 'temp22') what am I doing wrong?</p>
http://ask.sagemath.org/question/41890/temp22sobj-is-not-utf-8-encoded/?comment=42018#post-id-42018I posted an answer to try and explain how things should work.
If you observe something different, in particular an error message about UTF-8, please say:
- what is the operating system,
- how SageMath was installed,
- if this happens when using Sage in the terminal, in the SageNB notebook, or in the Jupyter notebook,
and please copy-paste the exact error message you get.Sun, 15 Apr 2018 12:08:16 -0500http://ask.sagemath.org/question/41890/temp22sobj-is-not-utf-8-encoded/?comment=42018#post-id-42018Comment by slelievre for <p>I get a temp22.sobj is not UTF-8 encoded after trying to open this file
I saved by using save(G.allsimplecycles, 'temp22') what am I doing wrong?</p>
http://ask.sagemath.org/question/41890/temp22sobj-is-not-utf-8-encoded/?comment=42017#post-id-42017To display inline code, like `z = x*y`, use backticks.
To display blocks of code or error messages, skip a line above and below,
and do one of the following (all give the same result):
- indent all code lines with 4 spaces
- select all code lines and click the "code" button (the icon with '101 010')
- select all code lines and hit ctrl-K
For instance, typing
If we define `f` by
def f(x, y):
return (x, y)
then `f(2, 3)` returns `(2, 3)` but `f(2)` gives:
TypeError: f() takes exactly 2 arguments (1 given)
produces:
> If we define `f` by
>
> def f(x, y):
> return (x, y)
>
> then `f(2, 3)` returns `(2, 3)` but `f(2)` gives:
>
> TypeError: f() takes exactly 2 arguments (1 given)
Please edit your question to do that.Sun, 15 Apr 2018 12:04:17 -0500http://ask.sagemath.org/question/41890/temp22sobj-is-not-utf-8-encoded/?comment=42017#post-id-42017Comment by slelievre for <p>I get a temp22.sobj is not UTF-8 encoded after trying to open this file
I saved by using save(G.allsimplecycles, 'temp22') what am I doing wrong?</p>
http://ask.sagemath.org/question/41890/temp22sobj-is-not-utf-8-encoded/?comment=42016#post-id-42016Please edit your question to provide a complete reproducible example.Sun, 15 Apr 2018 12:04:10 -0500http://ask.sagemath.org/question/41890/temp22sobj-is-not-utf-8-encoded/?comment=42016#post-id-42016Comment by standardtrickyness for <p>I get a temp22.sobj is not UTF-8 encoded after trying to open this file
I saved by using save(G.allsimplecycles, 'temp22') what am I doing wrong?</p>
http://ask.sagemath.org/question/41890/temp22sobj-is-not-utf-8-encoded/?comment=41955#post-id-41955Okay just do A=Matrix([[0,1],[1,0]]) G=Digraph(A)
I'm not sure what save does or where it get's saved toMon, 09 Apr 2018 16:07:51 -0500http://ask.sagemath.org/question/41890/temp22sobj-is-not-utf-8-encoded/?comment=41955#post-id-41955Comment by dan_fulea for <p>I get a temp22.sobj is not UTF-8 encoded after trying to open this file
I saved by using save(G.allsimplecycles, 'temp22') what am I doing wrong?</p>
http://ask.sagemath.org/question/41890/temp22sobj-is-not-utf-8-encoded/?comment=41902#post-id-41902I am trying to do something alike. This is of course a hazard guess. For me
sage: P = graphs.PetersenGraph().to_directed()
sage: V = P.vertices()
sage: V[5] = 'fünf'
sage: V
[0, 1, 2, 3, 4, 'f\xc3\xbcnf', 6, 7, 8, 9]
sage: W = [ (V[k], V[n], '%s%s'%(V[k],V[n])) for k, n, nonelabel in P.edges() ]
sage: G = DiGraph( [V, W], format='vertices_and_edges' )
sage: save( G.all_simple_cycles(), 'temp22' )
produces the file,
-rw-rw-r-- 1 dan dan 745 Apr 7 15:05 temp22.sobj
and then
sage: G_reloaded = load( r'/home/dan/temp22' )
sage: G_reloaded == G.all_simple_cycles()
True
This is an old linux machine running
sage: version()
'SageMath version 7.5.1, Release Date: 2017-01-15'
Please try to describe in a similar way the problem.Sat, 07 Apr 2018 08:17:58 -0500http://ask.sagemath.org/question/41890/temp22sobj-is-not-utf-8-encoded/?comment=41902#post-id-41902Comment by slelievre for <p>I get a temp22.sobj is not UTF-8 encoded after trying to open this file
I saved by using save(G.allsimplecycles, 'temp22') what am I doing wrong?</p>
http://ask.sagemath.org/question/41890/temp22sobj-is-not-utf-8-encoded/?comment=41891#post-id-41891Please provide a reproducible example. Here, we don't have G to try your code.Fri, 06 Apr 2018 12:49:13 -0500http://ask.sagemath.org/question/41890/temp22sobj-is-not-utf-8-encoded/?comment=41891#post-id-41891Answer by slelievre for <p>I get a temp22.sobj is not UTF-8 encoded after trying to open this file
I saved by using save(G.allsimplecycles, 'temp22') what am I doing wrong?</p>
http://ask.sagemath.org/question/41890/temp22sobj-is-not-utf-8-encoded/?answer=42015#post-id-42015Having defined `A` and `G` as follows,
sage: A = Matrix([[0, 1], [1, 0]])
sage: G = DiGraph(A)
we have a directed graph `G`, which has a method `all_simple_cycles`.
The following only refers to the method itself
sage: G.all_simple_cycles
<bound method DiGraph.all_simple_cycles of Digraph on 2 vertices>
while the following is the result of applying the method to `G`.
sage: G.all_simple_cycles()
[[0, 1, 0]]
So if we save the method itself,
sage: save(G.all_simple_cycles, 'temp22')
we can then reload it:
sage: asc = load('temp22')
sage: asc
<bound method ?.all_simple_cycles of Digraph on 2 vertices>
and possibly apply it to `G`:
sage: asc(G)
[[0, 1, 0]]
while if we save the result of applying the method to `G`,
sage: save(G.all_simple_cycles(), 'temp22')
then reloading it gets us the list of all simple cycles of G:
sage: ascG = load('temp22')
sage: ascG
[[0, 1, 0]]
Sun, 15 Apr 2018 12:02:30 -0500http://ask.sagemath.org/question/41890/temp22sobj-is-not-utf-8-encoded/?answer=42015#post-id-42015