![]() ![]() |
24 Dec 2002, 02:08 PM
Post
#1
|
|
|
Senior Member ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 910 Joined: 9-July 02 Member No.: 5065 |
For those who don't know, PySphere is a program which lets you script for Sphere in a language like Python. It works by compiling your .py scripts to ordinary .scp files (when you run it).
To get it, click the 'www' button on any of my posts, you'll be taken to my site. Benifits of using PySphere: - Python is easier to code in, and is easier and quicker to write and read in general than SphereScript (Or JavaScript for that matter). You don't need ENDIFs (Like spherescript), or {}s (like in JavaScript) to designate where structures (like IF, While, etc) start and end. - Your PySphere code will work in multiple sphere versions (If you avoid certain things, like explicitly referencing argv to get the arguments. That breaks support for 55i.). Things like on=@userdclick, finduid, etc, are translated properly when compiling to 55i. - You can use while loops and for loops easily, in any supported sphere version (Currently 55i, 99u, 99v, and 99w). - You don't have to deal with as many <>s, but you can still use <>s if you need them (For advanced coding, such as passing the name of a variable to a function as a reference to the variable, instead of passing the value of the variable and then storing a value in that variable by reference: - PySphere knows when it needs to use tryp, about uid.somevarname.whatever, about using 0s before variable names in 55i, how to pass parameters in 55i, how to write efficient (As efficient as possible anyways) while and for loops in 55i, etc. Even if you don't know how to, PySphere does. It also makes it much faster (But I said this already) to make while and for loops, especially for 55i. - I'm sure I've forgotten some. Cons: - PySphere doesn't support actually using true Python code - There are some differences. For instance, you can't use self, there are no classes, there are structures for itemdefs, etc, which do not exist in ordinary Python, and <>s and other symbols (such as {}) are legal in places where they aren't in ordinary Python. All this is by necessity. - There are a few things you can't do in PySphere still. For instance... Well, DORAND was my example before, but it is supported now. - You have the extra step of needing to compile your .py scripts to .scp scripts with PySphere before Sphere can use them. Luckily, this is fairly fast. - You have to worry whether PySphere compiled them right. This isn't too big of an issue, since it does almost everything right. The few things that it doesn't are often things like this: bob.function (abcd). It'll get confused by the space. It doesn't get confused by bob.function( abcd ) though. - I'm sure I've forgotten some. Changelog for Release 9a: - The pattern-parsers were made to check the produce-readable-code flag, and now use alternate patterns specified for each sphere version, if they exist, to produce readable code. The alternate patterns are named '99wreadable' instead of '99w', etc. - Alternate patterns were defined for local and localset for every sphere version, and also for forrange and forarray for 99w. - In all sphere versions, #produce-readable-code now transforms local.foo into var.foo. - In short, #produce-readable-code now works again. (In Release 9, #produce-readable-code was unsupported, because it had to be re-coded. Why? Here's a little history of local variables and #produce-readable-code.) Release 1: PySphere's first release. And local variables existed, and were handled by renaming them from 'local.foo' to 'var.py__moduleName__functionName__foo'. Release 2: The pattern parser is coded, and the basic patterns for compiling to 99u and 55i are completed. Releases 3-7: Much work on making everything functional and stable. I would call release 7 the first 'stable' release. Stable, in this case, means it works most of the time. I.E. Releases 1-6 didn't really work all that great, particularly with 55i. Release 8: #produce-readable-code is added. In releases 1-7, a function is called to return the 'header', which is 'var.py__'+self.moduleName+'__'+self.functionName+'__'. In release 7, this function will return 'var.' instead if the compiler has been directed to 'produce readable code'. Release 9: Sphere 99w comes out, with local variable support via a function named ARG. The local-header function is insufficient to support 99w hardcoded local variables, and so patterns are written for retrieving and setting local variables, for sphere 55i, 99u, 99v, and 99w. The 99w patterns require the introduction of new pattern metacommands. In addition, the local var support necessitates changing the 99w forarray and forrange patterns to make use of it. The local-header function is no longer used, replaced by functions named generateLocalGet and generateLocalSet, which use the pattern parser to generate code. However, the produce-readable-code feature was only a part of the local-header function, and impossible to code in the same manner in the generateLocalGet/Set functions. So, produce-readable-code is not supported in Release 9. Release 9a: produce-readable-code again works, as new patterns (optional, unlike all the others) were added which are used instead of the ordinary patterns whenever PySphere has been directed to produce readable code. Where the patterns for p-r-c aren't defined, PySphere simply uses the ordinary ones, assuming that p-r-c needs no alternate patterns there. These alternate patterns are coded for every local/localset pattern, and for 99w's forarray and forrange patterns. No other patterns need them. |
|
|
|
25 Dec 2002, 09:51 AM
Post
#2
|
|||
|
Senior Member ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 910 Joined: 9-July 02 Member No.: 5065 |
Release 9b is up.
Release 9b allows you to add plevel blocks to specify what plevel commands are for. - Code like this is now supported:
- Fixed an odd bug involving local variables and if statements. |
||
|
|
|||
25 Dec 2002, 03:18 PM
Post
#3
|
|
|
Senior Member ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 910 Joined: 9-July 02 Member No.: 5065 |
And now Release 10 is up.
It isn't a big change, but it is a very useful change. Release 10 allows you to use defnames as arrays. - Defnames can be used as arrays. See def_array.py for an example. This greatly simplifies using arrays of defnames. |
|
|
|
26 Dec 2002, 01:07 PM
Post
#4
|
|
|
Town Joker ![]() ![]() ![]() Group: Members Posts: 304 Joined: 13-July 02 Member No.: 5467 |
What might help everyone more than anything, is the location of the file?
|
|
|
|
26 Dec 2002, 10:14 PM
Post
#5
|
|
|
Senior Member ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 910 Joined: 9-July 02 Member No.: 5065 |
Click the www button on any of my posts.
|
|
|
|
12 Jan 2003, 03:45 PM
Post
#6
|
|
|
Senior Member ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 910 Joined: 9-July 02 Member No.: 5065 |
Release 11 will be out within a few days. I'm testing it right now.
|
|
|
|
14 Jan 2003, 09:16 PM
Post
#7
|
|
|
Senior Member ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 910 Joined: 9-July 02 Member No.: 5065 |
Okay, Release 11 is on my site (www button on any of my posts).
Supports 99x, GetCount, doswitch, and dorand. |
|
|
|
25 Feb 2003, 07:46 PM
Post
#8
|
|||
|
Senior Member ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 910 Joined: 9-July 02 Member No.: 5065 |
Release 12 is on my site. Since we're on the new forums, the button is [Http://] instead of [www] now. Mmm....
|
||
|
|
|||
3 Mar 2003, 12:03 PM
Post
#9
|
|||
|
Senior Member ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 910 Joined: 9-July 02 Member No.: 5065 |
Release 13 is up!
And it fixes a bug. |
||
|
|
|||
8 Mar 2003, 12:31 PM
Post
#10
|
|||
|
Senior Member ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 910 Joined: 9-July 02 Member No.: 5065 |
Release 14 is up:
|
||
|
|
|||
24 Mar 2003, 06:21 PM
Post
#11
|
|
|
Senior Member ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 842 Joined: 12-August 02 Member No.: 6489 |
Just a thought, make it be able to change sphere scripts into python files, so it can then be used as a 55i --> 99xx script converted as well :D
|
|
|
|
25 Mar 2003, 03:08 PM
Post
#12
|
|
|
Senior Member ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 910 Joined: 9-July 02 Member No.: 5065 |
I believe in rewriting things from scratch without merely copying/translating the original every so often, as I've noticed that this tends to, at least for me, result in a better version.
Which is why all the 55i scripts that I want for 99*-1.0 are being rewritten manually instead of converted. And ATM PySphere's transformation is one-way. (And this wouldn't be as easy to change as one would think.) |
|
|
|
25 Mar 2003, 09:24 PM
Post
#13
|
|
|
Senior Member ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 936 Joined: 9-July 02 Member No.: 5145 |
Yeah, it'd be much harder to go from sphere-->pysphere then to go from pysphere-->sphere.
|
|
|
|
1 May 2003, 09:11 AM
Post
#14
|
|
|
Senior Member ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 910 Joined: 9-July 02 Member No.: 5065 |
Release 15 is up!
In addition to being able to get it from the normal place (Where the 'http' button on all my posts leads), from now on you'll also be able to get the latest version here. Release 15 (April, 2003)
|
|
|
|
30 May 2003, 09:26 PM
Post
#15
|
|
|
Senior Member ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 910 Joined: 9-July 02 Member No.: 5065 |
Release 16 is up. To get it, go here and click the PySphere link: http://www.sphereserver.net/download.php?o...wdownload&cid=4
Release 16 (May 30, 2003) This release adds support for contextmenu, menu, and menudialog. I strongly encourage looking at dialogs.py to see what Menudialog is, as it is a VERY useful tool.
(The contents of this post have been automatically generated from the PySphere changes.html file by a nice little converter script I made a while back in Python.) |
|
|
|
22 Jun 2003, 07:28 AM
Post
#16
|
|
|
Senior Member ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 910 Joined: 9-July 02 Member No.: 5065 |
Release 17 (June 22, 2003)
This release fixes several bugs.
|
|
|
|
12 Jul 2003, 08:49 PM
Post
#17
|
|
|
Senior Member ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 910 Joined: 9-July 02 Member No.: 5065 |
Release 18 is out. Changes:
Release 18 (July 10, 2003) This release adds several rev-o-lute-you-nary new features.
You can get R18 from: http://www.sphereserver.net/download.php?o...op=getit&lid=18 I have not updated my geocities site with it yet. |
|
|
|
12 Jul 2003, 11:25 PM
Post
#18
|
|||
|
Senior Member ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 620 Joined: 13-July 02 Member No.: 5424 |
Simply, lol. |
||
|
|
|||
![]() ![]() |
|
Lo-Fi Version | Time is now: 1st August 2010 - 03:38 AM |