Ok, I've given it the interface I want, and made it less of an
attractive nuisance. http://www.mired.org/home/mwm/try_python/ is now ready for people to
play with. There's no tutorial information on it yet, that's the next
thing to do. However, I won't be able to work on it for a while, so if
you want to make suggestions about what that should look like, all
such suggestions will be given proper consideration.
<mike
--
Mike Meyer <mw*@mired.or g> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Dec 20 '05
20 1639 sk**@pobox.com writes: >> It does work for me in FireFox and Netscape: >> >>> 1+1 >> 2
Mike> Also Safari, Mozilla and Netscape. I tried 4+3 in Safari and got
I've been futzing with it all evening. Various things I've done have
broken it in strange ways. It's working now (or was - someone may have
found a way to break it).
I'm tempted to put in a hook to log expressions and let people play
them back - it's kind of amusing.
<mike
--
Mike Meyer <mw*@mired.or g> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Mike Meyer wrote: Ok, I've given it the interface I want, and made it less of an attractive nuisance.
http://www.mired.org/home/mwm/try_python/ is now ready for people to play with. There's no tutorial information on it yet, that's the next thing to do. However, I won't be able to work on it for a while, so if you want to make suggestions about what that should look like, all such suggestions will be given proper consideration.
<mike -- Mike Meyer <mw*@mired.or g> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Very nice though a little tedious to use ;)
Working on Windows XP behind a proxy ( trying both Mozilla + Internet
Explorer ) and typing 1+2
results in a HTML request in the output field of the console:
<html>
<head>
<title> Data Transfer Status Report </title>
<META http-equiv="Refresh" content="1;
URL=http://www.mired.org/home/mwm/try_python/GGTSPU-fw1.gdm.de-1305-446462-DAT/python.sbox?%3E %3E%3E%201+2">
</head>
<body bgcolor="#fffff f">
<h2> Data Transfer Status Report</h2>
<hr>
<table>
<tr><td align=right>URL :</td><td align=left><b>< a
href="http://www.mired.org/home/mwm/try_python/python.sbox?%20 1+2">http://www.mired.org/home/mwm/try_python/python.sbox?%20 1+2</a></b></td></tr>
etc.
The interesting issue is the provided link. Copying the HTML output
into a file and executing it opens a file transfer connection. The
result is as expected:
python.sbox
It contains the correct result: it is 3 :)
Kay
[Claudio] The page doesn't work for me in MSIE (I am on a Windows system)
[Mike] Yeah, I know. I poked at it briefly, but couldn't figure out what was goiing on. MSIE on the Mac doesn't work at all (no AJAT), and I don't have regular access to a Windows box to try it on.
I think it's your JavaScript '\r' processing that's broken. Certainly the
error ("unexpected EOF while parsing") is consistent with having a \r on the
end of the expression. Won't this:
if (input.length == 1)
always fail in the case where the user has typed a newline? I'd ditch that
code and do it at the server end:
expr = expr[4:].strip()
--
Richie Hindle ri****@entrian. com
Mike Meyer wrote:
[Browser behaviour] Actually, it's doing form processing. It's doing XMLHttpRequests .
You might want to add some workarounds for Konqueror. What I found was
that Konqueror (on KDE 3.4.0) has a tendency to add null bytes to the
end of some form field values. Consequently, I get mostly "SyntaxErro r:
unexpected EOF while parsing (line 1)" in that browser. It could well
be that other browsers also have their quirks with XMLHttpRequest.
Paul
Richie Hindle <ri****@entrian .com> writes: Yeah, I know. I poked at it briefly, but couldn't figure out what was goiing on. MSIE on the Mac doesn't work at all (no AJAT), and I don't have regular access to a Windows box to try it on. I think it's your JavaScript '\r' processing that's broken. Certainly the error ("unexpected EOF while parsing") is consistent with having a \r on the end of the expression.
Python doesn't care about the trailing newline.
Won't this:
if (input.length == 1)
always fail in the case where the user has typed a newline? I'd ditch that code and do it at the server end:
The point of the '\r' processing is to make sure we don't send the
entire text area string to the server. That breaks things pretty
badly. My assumption is that if splitting on '\n' leaves us with one
thing, we may have gotten a string that used \r for newlines, so we
split on that. Hmm. If the results of the first split left us with
"'\r'expr", then the second split will send an empty string, which
would result in what we're seeing.
I'll investigate that.
thanks,
<mike
--
Mike Meyer <mw*@mired.or g> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
[Richie] I think it's your JavaScript '\r' processing that's broken. Certainly the error ("unexpected EOF while parsing") is consistent with having a \r on the end of the expression.
[Mike] Python doesn't care about the trailing newline.
That's a carriage return, not a newline: eval("1+2\r")
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "<string>", line 1
1+2
^
SyntaxError: unexpected EOF while parsing
My assumption is that if splitting on '\n' leaves us with one thing, we may have gotten a string that used \r for newlines
Ah, OK. Your comment talks about DOS - that won't happen on DOS (or
Windows) which uses \r\n. I don't know about the Mac. But the \r\n pair
isn't handled by your code - strip() on the server side will make it work if
that's the problem:
eval("1+2\r".st rip())
3
--
Richie Hindle ri****@entrian. com
Richie Hindle <ri****@entrian .com> writes: My assumption is that if splitting on '\n' leaves us with one thing, we may have gotten a string that used \r for newlines Ah, OK. Your comment talks about DOS - that won't happen on DOS (or Windows) which uses \r\n. I don't know about the Mac. But the \r\n pair isn't handled by your code - strip() on the server side will make it work if that's the problem:
You mean there's a difference between DOS and Windows?
The Mac stuff I can test, so that's easier to get right. eval("1+2\r".st rip())
3
I actually did wind up doing it this way. MSIE works now, but still
doesn't seem very reliable.
Thanks,
<mike
--
Mike Meyer <mw*@mired.or g> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
On 20 December 2005, Mike Meyer wrote: Ok, I've given it the interface I want, and made it less of an attractive nuisance.
http://www.mired.org/home/mwm/try_python/ is now ready for people to play with. There's no tutorial information on it yet, that's the next thing to do. However, I won't be able to work on it for a while, so if you want to make suggestions about what that should look like, all such suggestions will be given proper consideration.
I'm not sure about everyone else, but I find the big warnings about
CSS and JavaScript almost as annoying as the fact that it doesn't do
anything. At all, even with JavaScript enabled. Then again, my main
browser is elinks, so my opinion is somewhat biased.
If you get it working in Lynx, supporting other browsers should be
easier than the other posts make this solution sound.
- Eric
I'm afraid that I've spoiled the "try_python " working by means of
executing the sentence:
open("try.py"). write("\n")
Sorry. I hope it don't be difficult for you to restore the module again
to the default folder.
In any case, I think it should include some control for malicious code
like that one.
"Maravillos o" <ma*********@gm ail.com> writes: I'm afraid that I've spoiled the "try_python " working by means of executing the sentence:
open("try.py"). write("\n")
Sorry. I hope it don't be difficult for you to restore the module again to the default folder.
No problem - I'm not crazy enough to leave unreplaceable data on a
machine with open incoming ports.
In any case, I think it should include some control for malicious code like that one.
Normally, it is. I must have left the module writeable after updating
it :-(. It's been replaced, and if you try that now you'll get an
IOError.
Thanks for reporting it.
<mike
--
Mike Meyer <mw*@mired.or g> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Greg |
last post by:
The following article from microsoft describes a workaroind for a bug
in hte beta version of VISUAL PYTHON DOT NET
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaskdr/html/askgui04032001.asp
When did microsoft put python into the visual studio beta? How did
this not make big news in developmnt circles?
A.E.
|
by: John Machin |
last post by:
I am pleased to announce a new general release (0.5.2) of xlrd, a Python
package for extracting data from Microsoft Excel spreadsheets.
CHANGES:
* Book and sheet objects can now be pickled and unpickled. Instead of
reading a large spreadsheet multiple times, consider pickling it once
and loading the saved pickle; can be much faster.
* Now works with Python 2.1. Backporting to Python 2.1 was partially
|
by: Gregory (Grisha) Trubetskoy |
last post by:
The Apache Software Foundation and The Apache HTTP Server Project are
pleased to announce the 3.3.0b (Beta) release of mod_python.
Version 3.3.0b of mod_python features several new functions and
attributes providing better access to apache internals, as well as
many bug fixes and various performance and security improvements. A
detailed description of the changes is available in Appendix A of the
mod_python manual, also available here
...
|
by: Steven Knight |
last post by:
SCons is a software construction tool (build tool, or make tool) written
in Python. It is based on the design which won the Software Carpentry
build tool competition in August 2000.
Version 0.97 of SCons has been released and is available for download
from the SCons web site:
http://www.scons.org/download.php
An RPM package and a Win32 installer are all available, in addition to
|
by: Wingware |
last post by:
Hi,
We're happy to announce the release of Wing IDE 3.0, an advanced
development environment for the Python programming language.
It is available from:
http://wingware.com/
Wing IDE provides powerful debugging, editing, code intelligence,
testing, and search capabilities that reduce development and debugging
| |
by: giles.thomas |
last post by:
We're proud to announce that today Resolver One, our flagship
application, entered its public Beta phase. It can be downloaded from
<http://www.resolversystems.com/download/(free registration
required), and we would very much welcome feedback from the Python
community.
Resolver One is a Rapid Application Development tool for analysing and
presenting business data using a familiar spreadsheet interface - or,
to put it another way, it is...
|
by: Steven Knight |
last post by:
SCons is a software construction tool (build tool, or make tool) written
in Python. It is based on the design which won the Software Carpentry
build tool competition in August 2000.
Version 0.98.1 of SCons has been released and is now available at the
SCons download page:
http://www.scons.org/download.php
RPM and Debian packages and a Win32 installer are all available, in
|
by: mh |
last post by:
I'm pleased to announce the initial release of OraPIG,
the Oracle Python Interface Generator.
OraPIG generates Python wrapper classes for Oracle packages.
If you use Oracle and Python, this might be a pretty useful
package for you. Download it and let us know what
you think!
Cheers,
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |