Writing Proc in python

Forum for asking and answering questions related to use of the OpenSeesPy module

Moderators: silvia, selimgunay, Moderators

Post Reply
Masoudahmadiiiii
Posts: 5
Joined: Tue Dec 12, 2017 3:40 am
Location: Trustructure-Iran

Writing Proc in python

Post by Masoudahmadiiiii » Sun Aug 15, 2021 12:14 am

Hey everyone.
How can i writer a subroutine in openseespy (something like wrting proc in tcl).
I would be grateful if somebody help me with sending an example.

mhscott
Posts: 872
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: Writing Proc in python

Post by mhscott » Sun Aug 15, 2021 6:14 am

Search online for how to write a function in Python

Masoudahmadiiiii
Posts: 5
Joined: Tue Dec 12, 2017 3:40 am
Location: Trustructure-Iran

Re: Writing Proc in python

Post by Masoudahmadiiiii » Mon Aug 16, 2021 1:57 am

mhscott wrote:
Sun Aug 15, 2021 6:14 am
Search online for how to write a function in Python
Hey professor Scott.
I know writing function in python but we usually put "return" at the last sentence. is it needed in writing function for OpenSees-py?

mhscott
Posts: 872
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: Writing Proc in python

Post by mhscott » Mon Aug 16, 2021 7:24 am

OpenSeesPy is a module, just like numpy you load it into your Python script. There's nothing special about it with respect to how you write your Python code.

https://portwooddigital.com/2019/11/18/ ... on-module/

Masoudahmadiiiii
Posts: 5
Joined: Tue Dec 12, 2017 3:40 am
Location: Trustructure-Iran

Re: Writing Proc in python

Post by Masoudahmadiiiii » Sat Aug 21, 2021 11:50 pm

mhscott wrote:
Mon Aug 16, 2021 7:24 am
OpenSeesPy is a module, just like numpy you load it into your Python script. There's nothing special about it with respect to how you write your Python code.

https://portwooddigital.com/2019/11/18/ ... on-module/
Thank you Dear Scott

cslotboom
Posts: 10
Joined: Sun Sep 09, 2018 8:09 pm
Location: UBC

Re: Writing Proc in python

Post by cslotboom » Mon Jun 06, 2022 1:46 am

There are tutorials here that show using OpenSeesPY with functions:
https://www.youtube.com/watch?v=scemwqZ ... 9a7bqFN6zG

(disclaimer - I recorded those..)

Post Reply