473,322 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

useful tool for c.l.p

I just read through a few posts and something striked me.

Many people, just like myself, are too lazy to test the python code they
post here. Most of the time, of course, the code either runs well or the
person asking at least understands what is meant and can fix eventual bugs.

Would it not be wonderful to have some kind of integrated python
interpreter within the news agent/email program, so one could kinda
select the concerned code (or better, it is automaticly spotted) and
just let it run within the mail? :)

Sorry.. it is late here (past 3am) and since a few weeks I really wonder
what the point is being in 2003.. somehow I so often feel that we are in
stone age... Especially we, in the IT world, are really late in
Information Technology.. :)

Regards,
Ben.

PS: Yes I know.. making a super-addin working with all email/news agents
of the planet does not seem neither worth the effort nor very easily
implemented.
PPS: No, do not worry. I am going to sleep right now and will stop
complaining about why the world is so annoying by the end of this sentence.

Jul 18 '05 #1
3 1677

"Behrang Dadsetan" <be*@dadsetan.com> wrote in message
news:bg**********@online.de...
I just read through a few posts and something striked me.

Many people, just like myself, are too lazy to test the python code they post here. Most of the time, of course, the code either runs well or the person asking at least understands what is meant and can fix eventual bugs.

Careful people, like myself, have learned, often through embarrassing
experience, to either note <untested> or test, cut, and paste. I
recommend this to everyone for anything much beyond the truely
obvious.
Would it not be wonderful to have some kind of integrated python
interpreter within the news agent/email program, so one could kinda
select the concerned code (or better, it is automaticly spotted) and just let it run within the mail? :)


I usually find it easy enough to start up the interpreter and cut and
paste from the draft post. It is a feature of Python that one can do
so so easily.

Terry J. Reedy
Jul 18 '05 #2
In article <bg**********@online.de>,
Behrang Dadsetan <be*@dadsetan.com> wrote:
: Would it not be wonderful to have some kind of integrated python
: interpreter within the news agent/email program, so one could kinda
: select the concerned code (or better, it is automaticly spotted) and
: just let it run within the mail? :)

But but but...we already have VBScript for that!

However, the Unix world has been kind of lagging in the viruses
department....

--Dave
--
"Not Dave! It must have been somebody evil forging a post from him. I don't
believe Dave is even capable of threatening, abusive or insulting language."
"And so say all of us!"
-- Chris Reuter and Matthew Skala
Jul 18 '05 #3
On Sat, 2 Aug 2003, Alan Kennedy wrote:
[Behrang Dadsetan wrote]
Would it not be wonderful to have some kind of integrated python
interpreter within the news agent/email program, so one could kinda
select the concerned code (or better, it is automaticly spotted) and
just let it run within the mail? :)
That's a nice idea.

However, were you to actually go ahead and implement this idea, we
would then be exposing ourselves to serious security risks, since
people could post malicious code in their posts.


As long as the code is not automatically executed it would not be much
more of a security issue...
As Terry Reedy pointed out, it's not hard to fire up the interpreter
and paste the script into it. Python's conciseness makes that very
easy, even if the whitespace issue sometimes results in mangled code.
....because I don't see a difference between selecting code then
executing it and select, cut'n'paste then execute.

A standard [or] tool could include a sandbox, which you don't get
with a simple cut'n'past into an interpreter.
And I always like to cast an eye over code before I run it, as a quick
sanity check that its not going to do anything I don't want or like
the look of.


Always a good idea.
While playing with Literate Programing (LP) and generally exploring
Python awhile back I put together a proof-of-concept which lets you
place code (noweb markup, can handle multiple files) in an email, have
it automatically extracted when it hits the mail reader, then sent to
an editor or IDE. Executing the code is just a click or keypress
away.

I figured that noweb markup was simple and unobtrusive, and treating
the message as LP (with its "flexible order of elaboration") would be
a good way to include programs, especially long examples, in email.
However, since that sorta thing doesn't happen very often and it is
easy to cut'n'paste, I didn't bother to develop it further.
--- message body example ---

lpmail: label1 label2

....text...

<<label1>>=
....code...
@

....more text...

<<label2>>=
....code...
@

-----

The code is on the 'net at:
http://home.edmc.net/~bsass/lpmail.py

Beware: it is a couple of years old and was a
stream-of-conciousness project... but it works and should only be a
security problem if the code text can tell the editor or IDE to
automatically execute a buffer.
- Bruce

Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Thomas Heller | last post by:
I'm currently working on a new version of py2exe, which will require Python 2.3 and later, because it uses the zipimport mechanism. Since py2exe is a distutils extension, and since C compilers...
22
by: Sensei | last post by:
Hi! I'm looking for useful libraries that are strictly ISO C. Any kind of library, from lists, stacks, to trees, searching tools, sorting tools... really *any* kind. Do you have any idea? :)...
46
by: Keith K | last post by:
Having developed with VB since 1992, I am now VERY interested in C#. I've written several applications with C# and I do enjoy the language. What C# Needs: There are a few things that I do...
0
by: google | last post by:
To search Visual Basic related information, try the new Visual Basic Swicki at http://www.vbinfo.net/index.php?pr=Visual_Basic This is a community powered search tool - the more it is used, the...
0
by: MonJack | last post by:
To search MS access related information, try the new MS Access Swicki at http://www.vbinfo.net/index.php?pr=MS_Access This is a community powered search tool - the more it is used, the more it...
12
by: pw | last post by:
I'm an experienced Access/VBA programmer, trying to become competent using VB.net. Using base vb.net it seems to me to be an AWFUL amount of work to create data-entry forms similar to what one...
15
by: Lorenzo Stella | last post by:
Hi all, I haven't experienced functional programming very much, but now I'm trying to learn Haskell and I've learned that: 1) in functional programming LISTS are fundmental; 2) any "cycle" in FP...
3
by: copx | last post by:
I saw one here posting the output of a lint tool in a thread, and that made me wonder whether using such tools are still useful. I mean, modern compilers are lint tools themselves, the list of...
6
by: =?Utf-8?B?RWxlY3Ryb25pYzc1?= | last post by:
Hello, I program in C and c++ for 5+ years but I am still not satisfied with my development process. for a big MFC project I usually start by thinking what classes do I need then for each class I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.