Re: [Ryu-devel] How to Call RyuApp directly in Python Application

2018-11-18 Thread Moh'd Reza Abbasi
I found the following script on the net. I use it to run and debug my ryu
apps. You can modify the script according to your need. You need to change
the "main_app" to your application name. You should also place this script
in the same path as your ryu app (or you might as well specify its path
address).


#!/usr/bin/env python

import sys
from ryu.cmd import manager


def main():
sys.argv.append('--ofp-tcp-listen-port')
sys.argv.append('6653')
# sys.argv.append('static')

sys.argv.append('main_app')
# sys.argv.append('--verbose')
sys.argv.append('--enable-debugger')
sys.argv.append('--observe-links')
manager.main()


if __name__ == '__main__':
main()



I’m
protected online with Avast Free Antivirus. Get it here — it’s free forever.

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sun, Nov 18, 2018 at 10:20 PM Soe Ye Htet 
wrote:

> Hi,
>
> Please let me share what I have known. In python, there is library which
> is called os package. That package is used to call linux command in python
> application.
>
> Import os
>
> In the place that you want to call ryu application, you can write
> os.system("ryu-manager x"). If you want to run ryu application in the
> background, you can put "&" at the end of the command line such as
> os.system("ryu-manager x &").
> I hope you can run ryu application in python application.
>
> Best Regards,
> Soe Ye Htet
> Master Engineering Student
> Chulalongkorn University, Thailand
>
> On Sun, Nov 18, 2018, 6:28 PM Ha Nguyen 
>> Hi Ryu Team,
>>
>> I do not want to launch Ryu application via the ryu-manager in Terminal,
>> but rather directly within a Python script. Then I can integrate everything
>> in one python script, instead of calling ryu-manager in Terminal, topology
>> build in another Terminal, and so on.
>>
>> I am looking forward to hearing from you.
>>
>> Best Regards,
>> Ha
>>
>> --
>> *Nguyen Vo Son Ha*
>>
>> Master Student (Communications Engineering)
>> *Technical University of Munich (TUM)*
>> D-80290 Munich, Germany
>>
>> Mob:   +49 159 023 88172
>> Email:  nvso...@gmail.com
>> Skype: nvsonha
>> ___
>> Ryu-devel mailing list
>> Ryu-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>>
> ___
> Ryu-devel mailing list
> Ryu-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>


I’m
protected online with Avast Free Antivirus. Get it here — it’s free forever.

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
___
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


Re: [Ryu-devel] How to Call RyuApp directly in Python Application

2018-11-18 Thread Soe Ye Htet
Hi,

Please let me share what I have known. In python, there is library which is
called os package. That package is used to call linux command in python
application.

Import os

In the place that you want to call ryu application, you can write
os.system("ryu-manager x"). If you want to run ryu application in the
background, you can put "&" at the end of the command line such as
os.system("ryu-manager x &").
I hope you can run ryu application in python application.

Best Regards,
Soe Ye Htet
Master Engineering Student
Chulalongkorn University, Thailand

On Sun, Nov 18, 2018, 6:28 PM Ha Nguyen  Hi Ryu Team,
>
> I do not want to launch Ryu application via the ryu-manager in Terminal,
> but rather directly within a Python script. Then I can integrate everything
> in one python script, instead of calling ryu-manager in Terminal, topology
> build in another Terminal, and so on.
>
> I am looking forward to hearing from you.
>
> Best Regards,
> Ha
>
> --
> *Nguyen Vo Son Ha*
>
> Master Student (Communications Engineering)
> *Technical University of Munich (TUM)*
> D-80290 Munich, Germany
>
> Mob:   +49 159 023 88172
> Email:  nvso...@gmail.com
> Skype: nvsonha
> ___
> Ryu-devel mailing list
> Ryu-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
___
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel