From: Woodson, Michael (miwoodso_at_UTMB.EDU)
Date: Tue Oct 21 2014 - 14:07:25 CDT

Hi Josh, thanks for your reply.
Sorry about the lack of detail, but it looks like you've understood my problem - typing arrows was giving ^[[A, or ^[[D, etc. Python itself was running fine, as far as I could tell.
I tried to change the makefile to use the bash shell instead of csh by searching for the "Info: /bin/csh shell not found" string you mentioned, and changing /bin/csh and vmd.csh to /bin/sh and vmd.sh, respectively (there doesn't seem to be a vmd.bash) but when I installed and ran vmd I got an error:
/usr/local/bin/vmd: line 477: /_LINUX: No such file or directory
Looking in the vmd.sh file, there's a comment:
# detect if we have rlwrap available to have commandline editing
so I installed the rlwrap rpm, cleared out everything and reinstalled, and that seems to have solved the line-editing problem, although it doesn't always autocomplete in cases where it would if I was just running python in a shell. I can live with that though.
thanks!

Mike W.

________________________________
From: Josh Vermaas [vermaas2_at_illinois.edu]
Sent: Tuesday, October 21, 2014 11:53 AM
To: Woodson, Michael; vmd-l_at_ks.uiuc.edu
Subject: Re: vmd-l: Python text interpreter in VMD

Hi Mike,

Could you be more specific? I'm not sure what specific features you are missing or what the behavior is you are describing. For instance, I have encountered not being able to delete text from the terminal (backspace entering in the literal backspace character, and not deleting it like I wanted). The way I fixed it specifically for my case was to use the bash rather than the csh vmd startup script (the default almost always installs a csh script on a linux system to start vmd), as my install of Ubuntu uses bash as the default shell, and some csh environment variables being set/not being set/something else entirely unrelated got in the way of rlwrap passing along readline facilities properly. If this is the case, the terminal environment when not using python will also be messed up (ie, typing arrows or backspace into the terminal window will give you something like ^A or ^D instead of moving your cursor around). Is this the case? If so, you just need to change the Makefile or the configure script (which generates the makefile) so that it will use bash version rather than the csh one. Grep around for the statement: "Info: /bin/csh shell not found, installing Bourne shell startup script instead", and you shouldn't have a problem figuring out what to change.

If that isn't it, a better description of the problem or what specifically is missing would be appreciated, because it works for me. Can you run a dumb script through vmd? Something like python's helloworld?

print "Hello World"
exit()

If this works and prints things like you'd expect, your compilation is probably alright in how it interfaces with python, and that's 99% of the battle:

vmd -dispdev text -python -e helloworld.py

-Josh Vermaas

On 10/21/2014 10:13 AM, Woodson, Michael wrote:
Hi, I am trying to compile VMD against my native version of Python, 2.7. It seems to have mostly worked, it compiled and installed without any errors. When I call vmd - python, though, the text editor that starts up doesn't allow bash-style line editing. If I import the readline module manually, I can repeat previous lines, but not edit them.
When using python in a shell, it uses $PYTHONSTARTUP to import readline and other modules, but I don't know how to set this in VMD, or if there even is an equivalent.
Is this just how the text interpreter works in vmd, or did I screw something up during installation? And if the latter, what can I do to get line editing?
thanks!
Mike W.