Smith, Jeff wrote:
For all the talk of Python only having one way to do something which is
why it's so much better than Perl, I've counted about 10 ways to do this
:-)
Knowing you said this at least half in jest, I still feel the need to
comment.
In any programming language, you have flexibility
On Mar 25, 2005, at 4:53 PM, Alan Gauld wrote:
intrigued by Dashboard, which will be in the next OSX release. It
allows you to create "widgets" which are essentially little html
pages
There is an API for Dashboard and I'm pretty sure MacPython will
support it - it covers most of the cocoa type stuf
>> below to print the data returned from my query, but I would like to
> make
>> labels at the top of the columns. How do I do this dynamically?
>
> You shouldn't, it makes your code very vulnarable to changes in the
> database!
> Its the same principle as using 'select * from...', a bad idea in
>
> How does one go about including Python scripts in html documents.
You can only do it on Windows based IE pages. Even then theres
little real advantage. The snag is the person reading your pages
has to have both Python installed and active scripting enabled.
Very few regular users have that.
> intrigued by Dashboard, which will be in the next OSX release. It
> allows you to create "widgets" which are essentially little html
pages
There is an API for Dashboard and I'm pretty sure MacPython will
support it - it covers most of the cocoa type stuff. You might be
better checking out the Ap
> Ryan, I should clarify that what I'd like to do here is unrelated to
> the web. I'm actually just interested in using a local html page as
a
> simple gui to launch python calls. So a JS event handler, say a
button
> click, would then call a JS function which inside of it would call a
> Python fu
> > If you are using WSH on Windows and have the Python active
scripting
>
> I'm on OSX, and would be doing this through Safari most likely.
oca might be capable of doing it but I know very little about oca,
maybe some other Mac users can help? But I don't think it can be
done inside Safari.
Alan
On Thu, 24 Mar 2005 18:05:25 -
"Igor Riabtchuk" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I was playing around with Tkinter bindings and I got a question which is
> probably not particularly bright.
>
> If I have the following code, it works because I specifically code a function
> for keypre
Danny, great reply. I have looked a bit at pyObjC, and it does indeed
look cool. I was however hoping to bypass that route altogether and go
for the simplicity (I thought) that came with the html/js route.
Perhaps a cocoa bundle is the only way to get what I'm after. Thanks,
-MH
On Mar 25, 2005
How does one go about including
Python scripts in html documents. I have been looking it up on google but can't
seem to find a suitable answer!!??
Thanks
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
> Yikes, that sounds pretty hairy. Maybe this kind of thing is not as
> straight forward as anticipated. Why HTML you say? Well I've been
> intrigued by Dashboard, which will be in the next OSX release. It allows
> you to create "widgets" which are essentially little html pages that do
> things.
hi,
I hav been working on python in developing pyshell... I am using
python readline module to for the command line.. Can u help me with
how to replace or erase the current readline line-buffer.. the
readline module just provides a insert_text func which is appending
the text to the line-buffe
On Mar 25, 2005, at 1:00 PM, Ryan Davis wrote:
Ok, that explains a lot, but I don't know of any easy way to do have
javascript talk to python.
I can think of some horrible ways to do it, though.
1. Make a python web service running locally, and build up SOAP calls
or HTTP posts to it. (same as I
On Mar 25, 2005, at 12:41 PM, Alan Gauld wrote:
If you are using WSH on Windows and have the Python active scripting
installed then yes. Similarly if you use IE as web browser then it
can be done in a web page too.
I'm on OSX, and would be doing this through Safari most likely.
-MH
___
Ok, that explains a lot, but I don't know of any easy way to do have javascript
talk to python.
I can think of some horrible ways to do it, though.
1. Make a python web service running locally, and build up SOAP calls or HTTP
posts to it. (same as I suggested earlier)
2. Use XUL and pyXPCOM to
Ryan, I should clarify that what I'd like to do here is unrelated to
the web. I'm actually just interested in using a local html page as a
simple gui to launch python calls. So a JS event handler, say a button
click, would then call a JS function which inside of it would call a
Python function
> I'm curious on whether or not JavaScript and Python can talk to each
> other. Specifically, can a python function be called from within a
JS
> function? Admittedly this is probably more of a JavaScript than
Python
> question, but I'd love to know if anyone can at least point me in a
> direction
> below to print the data returned from my query, but I would like to
make
> labels at the top of the columns. How do I do this dynamically?
You shouldn't, it makes your code very vulnarable to changes in the
database!
Its the same principle as using 'select * from...', a bad idea in
production co
Depends on your environment.
If your js is on a webpage, you can have it make http calls to a python web
service. Look for articles on XMLHttpRequest in
javascript to see some examples.
I don't know how else that could be done, but I imagine there are other ways.
Thanks,
Ryan
-Original M
> jrlen balane wrote:
> > basically, i'm going to create a list with 96 members but with only
> > one value:
> >
> > list1[1,1,1,1...,1]
> >
> > is there a shorter way to write this one???
Hi Jrlen Balana,
I wanted to ask: why do we want to make a list of 96 members, with the
same value? This s
On Fri, 25 Mar 2005, Srinivas Iyyer wrote:
> NameState
> DrewVirginia
> NoelMaryland
> NikiVirginia
> Adams Maryland
> JoseFlorida
> Monica Virginia
> Andrews Maryland
>
>
> I would like to have my ouput like this:
>
> Virginia : Drew,Niki,Monica
> Maryland: Noel,Adams
For all the talk of Python only having one way to do something which is
why it's so much better than Perl, I've counted about 10 ways to do this
:-)
Jeff
-Original Message-
From: Sean Perry [mailto:[EMAIL PROTECTED]
Sent: Friday, March 25, 2005 2:20 PM
To: Tutor Tutor
Subject: Re: [Tutor
jrlen balane wrote:
basically, i'm going to create a list with 96 members but with only one value:
list1[1,1,1,1...,1]
is there a shorter way to write this one???
def generateN(n):
while 1:
yield n
I'll leave the actual list creation up to you (-:
___
I'm curious on whether or not JavaScript and Python can talk to each
other. Specifically, can a python function be called from within a JS
function? Admittedly this is probably more of a JavaScript than Python
question, but I'd love to know if anyone can at least point me in a
direction to res
jrlen balane wrote:
basically, i'm going to create a list with 96 members but with only one value:
list1[1,1,1,1...,1]
is there a shorter way to write this one???
[1] * 96
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tut
A comprehension and range?
#
>>> list1 = [1 for x in range(0,96)]
>>> len(list1)
96
#
Thanks,
Ryan
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of jrlen balane
Sent: Friday, March 25, 2005 2:03 PM
To: Tutor Tutor
Subject: [Tutor] a shorter way to write
a, so thats the way to do it, a list comprehension, thanks for the info...
On Fri, 25 Mar 2005 14:10:41 -0500, Gabriel Farrell <[EMAIL PROTECTED]> wrote:
> how about
>
> manyones = [ 1 for x in range(96) ]
>
>
> On Sat, Mar 26, 2005 at 03:02:34AM +0800, jrlen balane wrote:
> > basically,
how about
manyones = [ 1 for x in range(96) ]
On Sat, Mar 26, 2005 at 03:02:34AM +0800, jrlen balane wrote:
> basically, i'm going to create a list with 96 members but with only one value:
>
> list1[1,1,1,1...,1]
>
> is there a shorter way to write this one???
> ___
Hi,
On Mar 25, 2005, at 2:02 PM, jrlen balane wrote:
basically, i'm going to create a list with 96 members but with only
one value:
list1[1,1,1,1...,1]
You might want to use a list comprehension like:
[1 for i in range(96)]
-Pete
___
Tutor maillist -
basically, i'm going to create a list with 96 members but with only one value:
list1[1,1,1,1...,1]
is there a shorter way to write this one???
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Srinivas Iyyer wrote:
Hi all:
I have a question and I request groups help please.
My list has two columns:
NameState
DrewVirginia
NoelMaryland
NikiVirginia
Adams Maryland
JoseFlorida
Monica Virginia
Andrews Maryland
I would like to have my ouput like this:
Virginia : Drew,Ni
So, as a newbie, I see this thread and I check out the PEP and I see
that for future compatibility we should use sys.stdin.readline(). So
I import sys to see how it works. Of course, sys.stdin.readline('type
anything: ') doesn't work in quite the same way as raw_input('type
anything: ') does. Th
Hi all:
I have a question and I request groups help please.
My list has two columns:
NameState
DrewVirginia
NoelMaryland
NikiVirginia
Adams Maryland
JoseFlorida
Monica Virginia
Andrews Maryland
I would like to have my ouput like this:
Virginia : Drew,Niki,Monica
Maryla
thanks for the information...
On Fri, 25 Mar 2005 10:26:00 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote:
> jrlen balane wrote:
> > how many is the maximum member can a list have???
>
> According to this thread
> http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/2ddae82bb
Yeah. And they're thinking of removing raw_input() too. I think it's good
to have a __builtin__ user input function. Why should we have to import sys
everytime we want user input? Almost every program that newbies write uses
it, and advanced programmers also if they're using console programs.
jrlen balane wrote:
how many is the maximum member can a list have???
According to this thread
http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/2ddae82bb2c1b871/e00b7903bc887a73
the number of element in a list is stored in an int, so most likely the hard limit is 2**31-1. T
On Mar 25, 2005, at 15:50, jrlen balane wrote:
how many is the maximum member can a list have???
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
As far as I know, there is no limit hard-coded in the language. So I
g
how many is the maximum member can a list have???
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
mySQL also has it's own metadata commands -
http://dev.mysql.com/doc/mysql/en/getting-information.html
Looks like you want to use the DESCRIBE command.
On Fri, 25 Mar 2005 06:25:52 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote:
> Vicki Stanfield wrote:
> > I finally gave up and used MySQLdb
Michael Dunn wrote:
Something I've always wondered: if input() is so dangerous, why is it
there? What valid uses does it have in the wild?
It's a mistake planned to be removed in Python 3.0, the "hypothetical future release of Python that
can break backwards compatibility with the existing body of
Vicki Stanfield wrote:
I finally gave up and used MySQLdb to connect to my database. It connects
okay, and returns data, but now I have a new question. I use the code
below to print the data returned from my query, but I would like to make
labels at the top of the columns. How do I do this dynamica
Hi,
there just appeared a couple of postings from a Jan 2004 thread
(on primes) on this list again. (two of them by me)
To me it's completely unclear why and how this could
happen.
Does anybody know ...?
Gregor
--
Gregor Lingl
Reisnerstrasse 3/19
A-1030 Wien
Telefon: +43 1 713 33 98
Mobil: +43 66
Ooops, I put the wrong address into my recent posting,
which was intended to go to the edu-sig list.
Forget it!
Sorry for the inconvenience,
Gregor
--
Gregor Lingl
Reisnerstrasse 3/19
A-1030 Wien
Telefon: +43 1 713 33 98
Mobil: +43 664 140 35 27
Website: python4kids.net
_
Something I've always wondered: if input() is so dangerous, why is it
there? What valid uses does it have in the wild?
I ask this because this confusion comes up a lot: people expect
input() to return a string and it throws them when it doesn't. We all
just learn to use raw_input(), and to forget
> If I try to change the 1, 2, 3, 4 or 5 by a letter i.e. a, b, c, d,
e the
> programme stop functionning. I get an error message saying that
>
> Traceback (most recent call last):
> File "C:/Python24/Example/area_cir_squ_regt.py", line 39,
in -toplevel-
> print_options()
> File "C:/Python2
> > single instance (or indeed no instances because you could
> > use a static method... or get really fancy and create a
> > meta-class!).
>
> or make it a static method of Building
Yes that's actually what I meant, but reading it back it
sounds like I meant static Factory method Ho hum.
46 matches
Mail list logo