Re: process node, output to node and a quick settings question
Terry, Thank you very much. That works great and made my life so much easier. I really appreciate it. -Lang On Mon, May 22, 2017 at 08:48:04PM -0500, Terry Brown wrote: > On Mon, 22 May 2017 16:33:22 -0700 (PDT) > Lang Hurst wrote: > > > Quick settings question first: Where is the setting to make leo open > > with the last opened file? I am sure that I've looked at it in my > > searches, but I can't seem to find it. The bigger issue is this: > > > > I currently have two noes that I'll say look like this: > > > > node_A: node_B: > > > > Banana Yellow,tropical fruit > > cylindrical > > AppleRed > > round, can be used as weapon against younger > > brother > > kumkquat no idea > > > > I can write them to a file and run: > > > > with open('/home/lang/dir/D1A') as f1, open('/home/lang/dir/D1R') as > > f2: > > > > for x, y in zip(f1, f2): > > > > g.es("| {0}\t|\t{1} |".format(x.strip(), y.strip())) > > a question of how you want to find the nodes, once you've found them, > their body text is just .b. Perhaps the easiest: > > n_1 = g.findNodeAnywhere(c, "node_A") > n_2 = g.findNodeAnywhere(c, "node_B") > > answer = [] > for x, y in zip(n_1.b.split('\n'), n_2.b.split('\n')): > answer.append("| {0}\t|\t{1} |".format(x.strip(), y.strip())) > n_3 = n_2.insertAfter() > n_3.b = '\n'.join(answer) > n_3.h = 'answer' > c.selectPosition(n_3) > c.redraw() > > This assumes you call the two input nodes a specific thing, there are > other ways of addressing them. > > Cheers -Terry > > -- > You received this message because you are subscribed to a topic in the Google > Groups "leo-editor" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/leo-editor/y69Cy9_QDGs/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > leo-editor+unsubscr...@googlegroups.com. > To post to this group, send email to leo-editor@googlegroups.com. > Visit this group at https://groups.google.com/group/leo-editor. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: process node, output to node and a quick settings question
On Mon, 22 May 2017 16:33:22 -0700 (PDT) Lang Hurst wrote: > Quick settings question first: Where is the setting to make leo open > with the last opened file? I am sure that I've looked at it in my > searches, but I can't seem to find it. The bigger issue is this: > > I currently have two noes that I'll say look like this: > > node_A: node_B: > > Banana Yellow,tropical fruit > cylindrical > AppleRed > round, can be used as weapon against younger > brother > kumkquat no idea > > I can write them to a file and run: > > with open('/home/lang/dir/D1A') as f1, open('/home/lang/dir/D1R') as > f2: > > for x, y in zip(f1, f2): > > g.es("| {0}\t|\t{1} |".format(x.strip(), y.strip())) a question of how you want to find the nodes, once you've found them, their body text is just .b. Perhaps the easiest: n_1 = g.findNodeAnywhere(c, "node_A") n_2 = g.findNodeAnywhere(c, "node_B") answer = [] for x, y in zip(n_1.b.split('\n'), n_2.b.split('\n')): answer.append("| {0}\t|\t{1} |".format(x.strip(), y.strip())) n_3 = n_2.insertAfter() n_3.b = '\n'.join(answer) n_3.h = 'answer' c.selectPosition(n_3) c.redraw() This assumes you call the two input nodes a specific thing, there are other ways of addressing them. Cheers -Terry -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: process node, output to node and a quick settings question
Thanks Chris. That works perfectly. I don't know if I would have found it. I kept searching for "open" "file" and the like. I appreciate it! On Mon, May 22, 2017 at 4:51 PM, Chris George wrote: > For starting with the exact same files/window settings as last session, > you need to use the following command line options. > > launchLeo.py --session-restore --session-save > > Chris > > On Mon, May 22, 2017 at 4:33 PM, Lang Hurst wrote: > >> Quick settings question first: Where is the setting to make leo open with >> the last opened file? I am sure that I've looked at it in my searches, but >> I can't seem to find it. The bigger issue is this: >> >> I currently have two noes that I'll say look like this: >> >> node_A: node_B: >> >> Banana Yellow,tropical fruit >> cylindrical >> AppleRed >> round, can be used as weapon against younger >> brother >> kumkquat no idea >> >> I can write them to a file and run: >> >> with open('/home/lang/dir/D1A') as f1, open('/home/lang/dir/D1R') as f2: >> >> for x, y in zip(f1, f2): >> >> g.es("| {0}\t|\t{1} |".format(x.strip(), y.strip())) >> >> >> From another node and it prints out what I'm looking for. >> >> >> | Banana | Yellow, tropical fruit | >> | | cylindrical | >> | Apple | Red | >> | | round, can be used as weapon against younger brother | >> | kumkquat | no idea | >> >> >> >> Then I copy and paste that log output to another node that I am using for >> my @rst document. Is there an easier way to do this without writing out >> files and copy pasting? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "leo-editor" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to leo-editor+unsubscr...@googlegroups.com. >> To post to this group, send email to leo-editor@googlegroups.com. >> Visit this group at https://groups.google.com/group/leo-editor. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to a topic in the > Google Groups "leo-editor" group. > To unsubscribe from this topic, visit https://groups.google.com/d/ > topic/leo-editor/y69Cy9_QDGs/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > leo-editor+unsubscr...@googlegroups.com. > To post to this group, send email to leo-editor@googlegroups.com. > Visit this group at https://groups.google.com/group/leo-editor. > For more options, visit https://groups.google.com/d/optout. > -- I have a foreboding of an America in my children's or grandchildren's time -- when the United States is a service and information economy; when nearly all the manufacturing industries have slipped away to other countries; when awesome technological powers are in the hands of a very few, and no one representing the public interest can even grasp the issues; when the people have lost the ability to set their own agendas or knowledgeably question those in authority; when, clutching our crystals and nervously consulting our horoscopes, our critical faculties in decline, unable to distinguish between what feels good and what's true, we slide, almost without noticing, back into superstition and darkness... - Carl Sagan -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: process node, output to node and a quick settings question
For starting with the exact same files/window settings as last session, you need to use the following command line options. launchLeo.py --session-restore --session-save Chris On Mon, May 22, 2017 at 4:33 PM, Lang Hurst wrote: > Quick settings question first: Where is the setting to make leo open with > the last opened file? I am sure that I've looked at it in my searches, but > I can't seem to find it. The bigger issue is this: > > I currently have two noes that I'll say look like this: > > node_A: node_B: > > Banana Yellow,tropical fruit > cylindrical > AppleRed > round, can be used as weapon against younger > brother > kumkquat no idea > > I can write them to a file and run: > > with open('/home/lang/dir/D1A') as f1, open('/home/lang/dir/D1R') as f2: > > for x, y in zip(f1, f2): > > g.es("| {0}\t|\t{1} |".format(x.strip(), y.strip())) > > > From another node and it prints out what I'm looking for. > > > | Banana | Yellow, tropical fruit | > | | cylindrical | > | Apple | Red | > | | round, can be used as weapon against younger brother | > | kumkquat | no idea | > > > > Then I copy and paste that log output to another node that I am using for > my @rst document. Is there an easier way to do this without writing out > files and copy pasting? > > -- > You received this message because you are subscribed to the Google Groups > "leo-editor" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to leo-editor+unsubscr...@googlegroups.com. > To post to this group, send email to leo-editor@googlegroups.com. > Visit this group at https://groups.google.com/group/leo-editor. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.