return selected string - enhancement
It would be useful to return the selected string OR clipboard on exit.
Usage:
>>> pye('troubled.py')
...
select source line with complicated syntax (maybe copy to clipboard) and/or multiple lines with indents.
Example:
start_line, start_col, end_line, end_col = self.mark_range()
start_col = max(start_col - self.margin, 0)
end_col = max(end_col - self.margin, 0)
^q (( Maybe ask "return selection/clipboard/filename (s,c,f): ))
>>> ^v (paste to REPL)
>>> print(.format "{ I left out the closing brace.", variable)
Removing leading indent!
Normal copy paste will include indents and be unacceptable for REPL
I'm not going to add a question beyond the existing one to the QUIT action. At the moment, pye either returns the file name or the editor content, if no file name exists. The latter may be more useful than returning the file name. What I do when I require a line from a file is:
- open the file in pye and scroll it, until the part I need is in the window.
- close the file and use the terminal's cut and paste.
So given that I almost ever ignore the return value of pye, I do not see any benefit in changing the return value. The only useful change I see is to return None.
After further thought and simulation this won't work as I hoped any way.
What do you use a an IDE ?
What do you use a an IDE ?
No IDE. I use just simple terminal emulators, most of the time picocom at Linux and OS/X, Putty or TeraTerm at Windows and sometimes tio with Linux. That was one of the reasons for starting pye. I do not like these IDE. Too much magic behind the scene, which is nice as long as it works, and a horror, if not. With PC editors, I just moved from VSC to Sublime Text. It looks less shiny, but works better for coding. It just took a while to get it configured for best readability.
Thank you very much.
Is there a package that you use for simple file management: delete , move, copy? I am working on a very simple one but why should I bother If there already is one.
On the board from REPL I use upysh.py, for controlling from the PC I use mpremote or at devices with WiFi ftp (e.g. FileZilla).
Thank you.