"Tiger12506" <[EMAIL PROTECTED]> wrote
>> It turns out, no, Unicode won't work, but using x\99 for the TM
>> character
>> does, at least on my system (no idea if this will be universal):
>
> That's strange. Windows is Unicode based!
Unicode is effective at the font level. You need to have a fon
Hi all,
Is anyone aware of any large scale web apps developed in Python? Please let
me know of any that you know of...
Kind Regards,
--
Sithembewena Lloyd Dube
"The Stupidry Foundry"
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mail
Hi all,
As the Python doc says: "The for statement in Python differs a bit from what
you may be used to in C or Pascal. Rather than giving the user the ability
to define both the iteration step and halting condition (as C), Python's for
statement iterates over the items of any sequence (a list
(Question as below)
Sorry I meant to pick a tangible example to focus the discussion:
This one cannot be (easily) translated to use Python's range() operator
for (i=3; i>0; i=i/2) { ... }
So do you need to know a whole armory of other functions to use
to generate iterators, or just translat
"Stephen McInerney" <[EMAIL PROTECTED]> wrote
> Sorry I meant to pick a tangible example to focus the discussion:
>
> This one cannot be (easily) translated to use Python's range()
> operator for (i=3; i>0; i=i/2) { ... }
You have to remember that C's for loop is mostly syntactic sugar
over a
Hi Alan,
I don't deny the superiority of the underlying language design,
I'm just pointing out the very real mindjolting effect of Python not
supporting the universal syntax. Java is closer to C than Python is.
I'm bringing this up as one hurdle to migration, not a fundamental flaw.
Don't you agr
Dear All,
I am a newbie in Python and I would like to create command line interface for
executing different softwares, either local or remotely.
I begin with a very simple case in which I have an executable file called
"TestCases" and this file requires Des.in as an the input. Both files are
Hello all,
so long i have been learning python with two books 1) Official tutorial by
Guido Van Rossum and 2) Pythong Programming: An Introduction to Computer
Science by John M. Zelle and like them a lot as the first one gives a lot of
explanations but without any exercises, but the second one has
* Vivian Tini (Tue, 7 Aug 2007 12:20:29 +0200)
> The TestCases executable works properly when I run it from the shell prompt.
>
> Then I try to run it from the Python command prompt by the following script:
> >>> import os
> >>> os.system("home/.../.../.../TestCases")
>
> I used "..." to type i
Hi people,
If I've two numpy arrays, is there a non-looping way of finding common
values. (the example below has identical shapes for the arrays but this
may not be the case in my scenario)
e.g
a = array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
b = array([ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14])
answer =
OkaMthembo wrote:
> Hi all,
>
> Is anyone aware of any large scale web apps developed in Python? Please
> let me know of any that you know of...
http://www.davidcramer.net/other/43/rapid-development-serving-50-pageshour.html
http://www.davidcramer.net/curse/44/what-powers-curse.html
http://w
Stephen McInerney wrote:
> I think the tutorial is lacking on this (should I email Fred Drake?)
> Instead of leaving C and Java people cold scratching their heads about
> why they think the language is hopelessly quirky and not (syntactically)
> fully-featured?
The "About this document" link at t
Vivian Tini wrote:
> Dear All,
>
> I am a newbie in Python and I would like to create command line interface for
> executing different softwares, either local or remotely.
>
> I begin with a very simple case in which I have an executable file called
> "TestCases" and this file requires Des.in
Khamid Nurdiev wrote:
> Hello all,
> so long i have been learning python with two books 1) Official tutorial
> by Guido Van Rossum and 2) Pythong Programming: An Introduction to
> Computer Science by John M. Zelle and like them a lot as the first one
> gives a lot of explanations but without any
thanks a lot for your help
On 8/7/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
>
> Khamid Nurdiev wrote:
> > Hello all,
> > so long i have been learning python with two books 1) Official tutorial
> > by Guido Van Rossum and 2) Pythong Programming: An Introduction to
> > Computer Science by John M.
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Stephen McInerney
From: [EMAIL PROTECTED]; tutor@python.org
>>As to your particular case one non while option would be a generateor:
>>
>>def half(n):
>> while int(n) > 0:
>>n = n/2
>>yield n
>>
>>for x in half(300)
"Stephen McInerney" <[EMAIL PROTECTED]> wrote
> I don't deny the superiority of the underlying language design,
> I'm just pointing out the very real mindjolting effect of Python not
> supporting the universal syntax.
An interesting term. The C syntax is extremely odd to most programmers
who have
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Andy Cheesman
>
> Hi people,
>
> If I've two numpy arrays, is there a non-looping way of finding common
> values. (the example below has identical shapes for the
> arrays but this
> may not be the case in my scenario)
>
> e.g
>
"OkaMthembo" <[EMAIL PROTECTED]> wrote
> Is anyone aware of any large scale web apps developed in Python?
> Please let
> me know of any that you know of...
The Zope web site has many examples.
But it depends how you define large scale. Most of the really big ones
(Google,
Yahoo, IBM, BBC etc
Andy Cheesman wrote:
> Hi people,
>
> If I've two numpy arrays, is there a non-looping way of finding common
> values. (the example below has identical shapes for the arrays but this
> may not be the case in my scenario)
>
> e.g
> a = array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
> b = array([ 5, 6, 7,
Hi all,
I am new to Python programming and this list, looks like a great place so far!
Recently I was trying to do a "try: X except Y: Z" statement, checking for a
custom error code that the rwhois.py module throws. Some details on the
exercise and the full code can be found on this post (
htt
Hi all,
I am new to Python programming and this list, looks like a great place so far!
Recently I was trying to do a "try: X except Y: Z" statement, checking for a
custom error code that the rwhois.py module throws. Some details on the
exercise and the full code can be found on this post (
htt
http://www.python.org/Quotes.html
Google
"Python has been an important part of Google since the beginning,
and remains so as the system grows and evolves. Today dozens of
Google engineers use Python, and we're looking for more people with
skills in this language." said Peter Norvig, director of se
Alan Gauld wrote:
> OK so use Pythons built in sort method. It uses quick sort I believe.
No, it uses 'timsort', an "adaptive, stable, natural mergesort [with]
supernatural performance on many kinds of partially ordered arrays."
Read about it here:
http://svn.python.org/view/python/trunk/Objects
wormwood_3 wrote:
> Hi all,
>
> I am new to Python programming and this list, looks like a great place so far!
>
> Recently I was trying to do a "try: X except Y: Z" statement, checking for a
> custom error code that the rwhois.py module throws. Some details on the
> exercise and the full code
On Tue, Aug 07, 2007 at 03:04:55PM +0400, Khamid Nurdiev wrote:
> Hello all,
> so long i have been learning python with two books 1) Official tutorial by
> Guido Van Rossum and 2) Pythong Programming: An Introduction to Computer
> Science by John M. Zelle and like them a lot as the first one gives
wormwood_3 wrote:
> Hi all,
>
> I am new to Python programming and this list, looks like a great place so far!
>
> Recently I was trying to do a "try: X except Y: Z" statement, checking for a
> custom error code that the rwhois.py module throws. Some details on the
> exercise and the full code ca
Bob Gailer wrote:
> Andy Cheesman wrote:
>
>> Hi people,
>>
>> If I've two numpy arrays, is there a non-looping way of finding common
>> values. (the example below has identical shapes for the arrays but this
>> may not be the case in my scenario)
>>
>> e.g
>> a = array([0, 1, 2, 3, 4, 5, 6, 7,
>>Probably you need to import NoSuchDomain from rwhois:
>>from rwhois import WhoisRecord, NoSuchDomain
>>
>>then use
>> except NoSuchDomain:
That sounds right, I will give it a shot soon.
>>In general, when you ask a question here, "I tried X and it did not
>>work" is not very informative and
Eric Brunson wrote:
> Bob Gailer wrote:
>> Andy Cheesman wrote:
>>
>>> Hi people,
>>>
>>> If I've two numpy arrays, is there a non-looping way of finding common
>>> values. (the example below has identical shapes for the arrays but this
>>> may not be the case in my scenario)
>>>
>>> e.g
>>> a =
"bhaaluu" <[EMAIL PROTECTED]> wrote
> Google
> "Python has been an important part of Google since the beginning,
> and remains so as the system grows and evolves.
Very true but they don't write the main Google web site/search engine
in Python they use it to test and to administer the underlying
"wormwood_3" <[EMAIL PROTECTED]> wrote
> Recently I was trying to do a "try: X except Y: Z" statement,
> checking for a custom error code
>for potdomain in self.potdomains:
>try:
>who.whois(potdomain)
>self.availdomains.append(potdomain)
>
Alan Gauld wrote:
> "OkaMthembo" <[EMAIL PROTECTED]> wrote
>
>
>> Is anyone aware of any large scale web apps developed in Python?
>> Please let
>> me know of any that you know of...
>>
>
> The Zope web site has many examples.
>
> But it depends how you define large scale. Most of the real
> >> Is anyone aware of any large scale web apps developed in Python?
> >> Please let
> >> me know of any that you know of...
I think that reddit.com switched from LISP to Python a while back.
Mike
___
Tutor maillist - Tutor@python.org
http://mail.py
Hello everyone,
I've come across a situation which is somewhat confusing to me.
I googled for some details and came across another email thread on
this very list but couldn't really glean a solution out of it.
I have a program (a compiled binary) for which I need to write a
wrapper (in
Noufal Ibrahim wrote:
> Hello everyone,
>I've come across a situation which is somewhat confusing to me.
>I googled for some details and came across another email thread on
> this very list but couldn't really glean a solution out of it.
>
>I have a program (a compiled binary) for whic
As always, thanks all for the ongoing help and suggestions... the learning
continues.
I've successfully made a number of programs, making use of various random code.
Using random.choice etc
#---
import randomletters = ('a', 'b', 'c', 'd')a = random.choice(lette
Eric Brunson wrote:
> Noufal Ibrahim wrote:
[..]
>> def createSignalDelegator(p):
>> def sighandler(signal,frame,pmake = p):
>> os.kill(pmake.pid,signal)
>> return sighandler
>>
>> pmake = subprocess.Popen(pmake_cmd, bufsize = 1, stdout =
>> subprocess.PIPE, stderr = subprocess.
Tony Noyeaux wrote:
> As always, thanks all for the ongoing help and suggestions... the
> learning continues.
>
> I've successfully made a number of programs, making use of various
> random code.
>
> Using random.choice etc
> #---
> import random
> letters = ('
Hi all,
I've been lurking on this list for some time. It's great. Thanks for all the
help.
I'm a sysadmin by trade, and have slowly started using Python more and more
in my work. However, this is my first experience with using the tarfile
module.
I'm currently writing a script to backup a mysql
Bob Gailer wrote:
> Tony Noyeaux wrote:
>
>> As always, thanks all for the ongoing help and suggestions... the
>> learning continues.
>>
>> I've successfully made a number of programs, making use of various
>> random code.
>>
>> Using random.choice etc
>> #-
Hello,
So i am new to Python, and really to programming. I picked up book
and so far I like it. right now I am trying to figure out a problem
that I cant.
It is a tipping program and I have assigned certain words to be a
certain % and then I ask the user to type raw input of one of those
"Bob Gailer" <[EMAIL PROTECTED]> wrote
> 1 games would be distributed thus:
> 1 = 45 pts
> 10 = 30+ pts
> 99989 = 15-25 pts
> so generate a random integer between 1 and 1.
> if it is <= 1 then 45
> else if it is <= 11 then 30+
> else 15-25
Bob's approach is typical for large data sets,
Greetings,
I just had to play with Bob's probabilities...
The standard disclaimer applies: This Python
source code has been written by a Noob, so
use it at your own risk. =)
#!/usr/bin/env python
# randy.py
# 2007-08-07
# b h a a l u u at g m a i l dot c o m
import random
def randy():
a=[]
f
"Dewight Kramer" <[EMAIL PROTECTED]> wrote
> quality. But I dont understand something below is code.
Since you don't tell us what exactly you don't undertand
I'll make some general comments on the code...
> # establish variables
> bill = float(0.0)
> bad = float (0.0)
> ok = float(0.10)
> good
On 8/7/07, Alan Gauld <[EMAIL PROTECTED]> wrote:
>
>
> "Bob Gailer" <[EMAIL PROTECTED]> wrote
>
> > 1 games would be distributed thus:
> > 1 = 45 pts
> > 10 = 30+ pts
> > 99989 = 15-25 pts
> > so generate a random integer between 1 and 1.
> > if it is <= 1 then 45
> > else if it is <= 11 t
"bhaaluu" <[EMAIL PROTECTED]> wrote
> source code has been written by a Noob, so
> use it at your own risk. =)
Just a few comments...
> def randy():
> a=[]
> for i in range(1,10001):
>a.append(i)
a = range(1,10001) # range returns a list...
> b = random.choice(a)
> print b
> if b <=
On Tue, Aug 07, 2007 at 03:55:03PM -0400, Brian Jones wrote:
>
> I'm currently writing a script to backup a mysql database. On the cli, I'd
> do something like this:
> 'mysqldump dbname | gzip -9 > dbname-date.gz'
>
> Note that "gzip -9" could just as easily be "tar cvzf" for example.
>
> Anyway
I'm a newbie to programming and am trying to learn Python. Maybe I'm wrong,
but I thought a practical way of learning it would be to create a script. I
want to automate the gathering of mailbox statistics for users in a post
office. There are two lines containing this information for each use
Stephen McInerney wrote:
> Hi Alan,
>
> I don't deny the superiority of the underlying language design,
> I'm just pointing out the very real mindjolting effect of Python not
> supporting the universal syntax. Java is closer to C than Python is.
> I'm bringing this up as one hurdle to migration, n
On 08/08/07, Tim Finley <[EMAIL PROTECTED]> wrote:
> I'm a newbie to programming and am trying to learn Python. Maybe I'm wrong,
> but I thought a practical way of learning it would be to create a script. I
> want to automate the gathering of mailbox statistics for users in a post
> office. Ther
Alan Gauld wrote:
> d = random.choice(range(26))
>
> replaces all of it!
or d = random.randrange(26)
no need to creat the list at all.
Kent
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
steve reighard wrote:
> Python provides you with a pseudo random number generator whose output
> values are uniformly distributed between the input parameters. What you
> are dealing with in fish weights or test scores or other natural
> phenomena is most likely a normal distribution. Check out
"Dave Kuhlman" <[EMAIL PROTECTED]> wrote
> But, if you want more control, then look at these functions/modules
> in the Pyhon standard library:
>
> - popen, popen2, etc -- http://docs.python.org/lib/os-process.html
Or the new(ish) subprocess module which supercedes system(),
popenX(), command
Tony Noyeaux wrote:
> How can you control randomness... lets say for fish.
>
> CatfishBreedA
> Can be say, 4inches, to 24inches long
> Most fish caught are say 7-14inches long
> Maybe 1 in 1000 catfish caught are say, 16-20 inches long
> Maybe 1 in 1 catfish caught are say, 20inches +
>
> H
"Tim Finley" <[EMAIL PROTECTED]> wrote
> but I thought a practical way of learning it would be to create a
> script.
Yep, its a good start once you've been through the language
basics in a tutorial.
> There are two lines containing this information for each user.
> I
> want to find the
Thorsten Kampe wrote:
> * Vivian Tini (Tue, 7 Aug 2007 12:20:29 +0200)
>
>> The TestCases executable works properly when I run it from the shell prompt.
>>
>> Then I try to run it from the Python command prompt by the following script:
>>
> import os
> os.system("home/.../.../.../T
Stephen McInerney wrote:
> Hi Alan,
>
>
>
[ snipage ]
>> As to your particular case one non while option would be a generateor:
>>
>> def half(n):
>> while int(n) > 0:
>>n = n/2
>>yield n
>>
>> for x in half(300): print x,
>>
>
> It's ok but it's visually clunky. while-l
>>Examining rwhois.py reveals
>>raise 'NoSuchDomain'
>>>which is a string exception. Which should work even tho deprecated.
>>>When you say it did not work what is the evidence?
--
Bob Gailer
510-978-4454 Oakland, CA
919-636-4239 Chapel Hill, NC
___
I did s
>>Probably you need to import NoSuchDomain from rwhois:
>>from rwhois import WhoisRecord, NoSuchDomain
>>
>>then use
>> except NoSuchDomain:
I tried adding:
from rwhois import WhoisRecord, NoSuchDomain
who = WhoisRecord()
self.totalchecked = 0
self.availdomains =
> Traceback (most recent call last):
> File "domainspotter.py", line 150, in
>runMainParser()
> File "domainspotter.py", line 147, in runMainParser
>td.run()
> File "domainspotter.py", line 71, in run
>checkdomains.lookup()
> File "domainspotter.py", line 108, in lookup
>from r
> Traceback (most recent call last):
> File "domainspotter.py", line 150, in
>runMainParser()
> File "domainspotter.py", line 147, in runMainParser
>td.run()
> File "domainspotter.py", line 71, in run
>checkdomains.lookup()
> File "domainspotter.py", line 108, in lookup
>from r
> This is exactly what I needed, awesome! Looks like this is what you were
> saying to do?:
> http://docs.python.org/tut/node10.html#SECTION001050
Why ~ exactly! A link tells a thousand words. (Or maybe more.) So does that
mean that a link is inherently more valuable than a pictu
hello there all,
i am wondering how to sort a dictionary that i have by values.
And i also need to sort them from greatest to least
like if i have a dictionary
d = {'a':21.3, 'b':32.8, 'c': 12.92}
how could i sort these from least to greatest
so that the order would turn out
b,a,c
thanks
shawn
_
>>hello there all,
>>i am wondering how to sort a dictionary that i have by values.
>>And i also need to sort them from greatest to least
>>like if i have a dictionary
>>
>>d = {'a':21.3, 'b':32.8, 'c': 12.92}
>>
>>how could i sort these from least to greatest
>>so that the order would turn out
>>b
shawn bright wrote:
> hello there all,
> i am wondering how to sort a dictionary that i have by values.
> And i also need to sort them from greatest to least
> like if i have a dictionary
>
> d = {'a':21.3, 'b':32.8, 'c': 12.92}
>
> how could i sort these from least to greatest
> so that the orde
>>You can use d.__getitem__ as the key function for a sort of the keys.
>>__getitem__() is the special method that is called for indexing a
>>dictionary (or a list).
Just curious: Is there a reason to use __getitem__() over itemgetter (used in
the example in my reply)?
>>In [24]: d = {'a':21.3
> Just curious: Is there a reason to use __getitem__() over itemgetter (used
> in the example in my reply)?
__getitem__ is a method builtin to a dict object. itemgetter 1) has to be
imported 2) is more generically used, therefore probably using a more
generic/slower algorithm
JS
wormwood_3 wrote:
>>> You can use d.__getitem__ as the key function for a sort of the keys.
>>> __getitem__() is the special method that is called for indexing a
>>> dictionary (or a list).
>>>
>
> Just curious: Is there a reason to use __getitem__() over itemgetter (used in
> the example
69 matches
Mail list logo