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 font that
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
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
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; i0; i=i/2) { ... }
You have to remember that C's for loop is mostly syntactic sugar
over a while
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
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 it short.
Then
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
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 the
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 as an
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. Zelle and
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): print x,
It's
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 haven't
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
a =
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 -
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 (
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 (
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 a
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 can be
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 makes it
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 = array([0, 1, 2, 3, 4, 5, 6,
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 really big ones
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
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 which I
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 =
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.STDOUT)
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 = ('a', 'b',
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
#---
import random
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, for small
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=[]
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 = float
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 then 30+
else 15-25
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 = 1:
Can never
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, what I'm
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
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, not a
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. There are
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(), commands,
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 two
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/.../.../.../TestCases)
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-loop wins for clarity.
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 speak too
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 module
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 rwhois
Traceback (most recent call last):
File domainspotter.py, line 150, in module
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 rwhois
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
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
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 order would
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
57 matches
Mail list logo