I don't know if I'm doing something wrong, or there's something wrong
with my Python install, or what, but just a simple test of user input is hanging the node when I try and run it.
If I run it as a DD menucmd and extension .py it works, but I want to be able to use the mystic functions as well (username, user account email address, etc). So I renamed it to .mpy and trying to find a list of
Mystic Python functions, which isn't easy.
I don't know if I'm doing something wrong, or there's something wrong
with my Python install, or what, but just a simple test of user input is hanging the node when I try and run it.
If I run it as a DD menucmd and extension .py it works, but I want to be able to use the mystic functions as well (username, user account email address, etc). So I renamed it to .mpy and trying to find a list of
Mystic Python functions, which isn't easy.
Outputting text is no problem, whether Python or MPY.
I really dunno what to do here. I just want to grab the user's name and supplied account email address for record keeping, and their input for a desired throwbackbbs.com email account name and password, then pass it
off to a PHP script to create one.
If I could do this in just Python, I think I'd be okay, but then I wouldn't be able to pull Mystic account info, right? Fack.
You'd have to post code in order for us to help you with it. But I'll type a simple example of Mystic Python quick...
I think there might be some confusion as to how to use it. If you want
to use Mystic Python you have to execute it with the Mystic Python menu command. If you want to execute Python you can using DD.
You're saying finding a list of Python functions isn't easy, but have
you tried the Wiki page entitled 'List of all Python functions"? ;)
Not everything is documented though but they names are there and there
is demo code that shows using most of everything specific to Mystic (ie things like msgread.mpy that comes with Mystic).
There's a testpython.py in the scripts directory that has most of the
There's a testpython.py in the scripts directory that has most of the relevant functions. There is also the python docs in the docs directory. Another option is to take a look at the several MPY apps that I and
others have developed and released.
I did find it, but I wasn't able to really glean what was what without a description on them. Some I got, like getyn, mci2str, logerror, stuff
like that, but some of the other stuff I wasn't able to figure out, like pwrite, upuser, access, etc.
I really appreciate the help, man, I just really needed something to get me started mainly. Once I can grab what I need to offload this to the
PHP script it should be cake. Hopefully I can find something that lets
me get the couple pieces of user info to work this, specifically the user's account email address. User name I can grab, I've already seen
the example =)
And that right there would have helped me tremendously had I known about it in the first place. =) I feel like such a tool, thank you both
Gryphon and g00r00 for letting me know.
user["email"] in Python will get you the e-mail of whatever user you have loaded up.
I had to guess on that one, but I got that. Also ["handle"] to get their username, not their real name. Trial and error, but it's coming along!
I had to guess on that one, but I got that. Also ["handle"] to get th username, not their real name. Trial and error, but it's coming along
I've not tried, but could you not just pprint() the user object to
observe all the available fields and values.. rather than trying to
guess everything?
I had to guess on that one, but I got that. Also ["handle"] to get their username, not their real name. Trial and error, but it's coming along!
I would like to know how to finish a script without it hanging up on me, however, especially in a loop. Python doesn't natively support tags or a goto system, which is really messing with me, and I'd rather not import anything to use those, especially if I'm going to release this for
general use.
I had to guess on that one, but I got that. Also ["handle"] to get th username, not their real name. Trial and error, but it's coming along
You can print the contents of a Python dictionary so you don't have to guess!
Check this example and helper function on the Wiki
http://wiki.mysticbbs.com/doku.php?id=python_examples#view_dictionaries_an ts
I am not sure what you mean but I think you want to exit a loop? You
can use break just like in MPL:
I figured it out shortly after I posted that. Python is weird, and
doesn't seem as flexible as other languages. The strictness is kicking
my ass. =\
I figured it out shortly after I posted that. Python is weird, and doesn't seem as flexible as other languages. The strictness is kickin my ass. =\
In what way? Maybe I can help you understand what you're missing.
Python is hugely popular for a lot of reasons, if it were limited that wouldn't be the case.
If I write something in, and then have to make a change afterwards, like say, add an if/else somewhere, I have to make sure it keeps with the
flow of the whole thing, or else it balks. If I thought of something
On 09 Mar 2019, g00r00 said the following...
user["email"] in Python will get you the e-mail of whatever user you loaded up.
I had to guess on that one, but I got that. Also ["handle"] to get their username, not their real name. Trial and error, but it's coming along!
If I write something in, and then have to make a change afterwards, l say, add an if/else somewhere, I have to make sure it keeps with the flow of the whole thing, or else it balks. If I thought of something
This is the nature of indent-based code. It's no less flexible, it's just.. different.
Also keep in mind, you're judging it through the lens of your limited experience with it. There is still a lot about python you don't yet
know, and most likely from your limited description, several other
better ways what you're doing could be implemented.
I finally gave up and installed .47 which allowed me to explicitly document the path to the lib in Mystic
--- Mystic BBS v1.12 A47 2021/02/12 (Raspberry Pi/32)
I finally gave up and installed .47 which allowed me to explicitly document the
path to the lib in Mystic
--- Mystic BBS v1.12 A47 2021/02/12 (Raspberry Pi/32)
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 412 |
Nodes: | 16 (3 / 13) |
Uptime: | 22:14:43 |
Calls: | 8,625 |
Calls today: | 11 |
Files: | 13,238 |
Messages: | 5,936,884 |