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 »

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: 880
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: Writing Proc in python

Post by mhscott »

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 »

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: 880
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: Writing Proc in python

Post by mhscott »

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 »

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 »

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

(disclaimer - I recorded those..)
Post Reply