[Tutor] Passing numeral result of a defined function to a named value
Joseph Hines
link6746 at gmail.com
Fri Jun 29 08:51:00 CEST 2012
Hello. Sorry to bother you, but I'm self-teaching myself python, and having
difficulty with a script I'm writing to auto-calc various derived stats for
a PnP game I am hosting soon.
I need to pass a numeral result of a defined function to a "named" value
(not sure if that's what it's called)
The offending segment of code is this:
XP_Per_Level_Base = 20-int_mod
> XP_Per_Level_Limit = 5
> try:
> def XP_Per_Level_Calc(XP_Per_Level_Base, XP_Per_Level_Limit):
> if XP_Per_Level_Base < XP_Per_Level_Limit:
> return XP_Per_Level_Limit
> else:
> return XP_Per_Level_Base
> XP_Per_Level = XP_Per_Level_Calc(XP_Per_Level_Base, XP_Per_Level_Limit)
> except ValueError:
> print "Script B0RK3D, Link Shall Come to Town."
> print "send him a message at Link6746 at gmail.com"
#Calcs XP per Level#
>
If you need the whole script, I'd be glad to send it to you, just promise
me not to divulge too many details of it
(It's regarding a custom PnP system that I'm planning on releasing under
the Open Gaming License, and I'd prefer not to risk it becoming a
proprietary system for someone I don't know)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120628/ae1695fc/attachment-0001.html>
More information about the Tutor
mailing list