* Raymond Hettinger:
On Nov 11, 10:21 pm, "Alf P. Steinbach" wrote:
One reaction to http://preview.tinyurl.com/ProgrammingBookP3> has
been that turtle graphics may be off-putting to some readers because it is
associated with children's learning.
What do you think?
How about calling it Raptor
On 2009-11-12, at 23:19, Steven D'Aprano wrote:
> On Thu, 12 Nov 2009 22:20:11 -0800, Vincent Manis wrote:
>
> Vincent, could you please fix your mail client, or news client, so
> that it follows the standard for mail and news (that is, it has a
> hard-break after 68 or 72 characters?
My apologi
On Thu, 12 Nov 2009 22:20:11 -0800, Vincent Manis wrote:
> When I was approximately 5, everybody knew that higher level languages were
> too slow for high-speed numeric computation (I actually didn't know that
> then, I was too busy watching Bill and Ben the Flowerpot Men), and therefore
> asse
On 2009-11-12, at 19:13, Peter Nilsson wrote:
> My recollection is that many children struggled with Turtle
> graphics because they had very little concept of trigonometry.
> [Why would they? Many wouldn't learn for another 2-10 years.]
> Adults tend to have even less concept since they almost neve
On Nov 11, 10:21 pm, "Alf P. Steinbach" wrote:
> One reaction to http://preview.tinyurl.com/ProgrammingBookP3> has
> been that turtle graphics may be off-putting to some readers because it is
> associated with children's learning.
>
> What do you think?
How about calling it Raptor Graphics that w
On Thu, Nov 12, 2009 at 8:10 PM, r wrote:
> On Nov 12, 7:44 pm, Steven D'Aprano cybersource.com.au> wrote
> > Oh, but those hundreds of thousands of man-hours lost to bugs caused by
> > assignment-as-an-expression is nothing compared to the dozens of man-
> > minutes saved by having one fewer li
On 2009-11-12, at 11:36, AK Eric wrote:
> On Nov 12, 11:31 am, Terry Reedy wrote:
>> Alf P. Steinbach wrote:
>>> One reaction to >> http://preview.tinyurl.com/ProgrammingBookP3> has been that turtle
>>> graphics may be off-putting to some readers because it is associated
>>> with children's learni
On Nov 12, 1:52 pm, rantingrick wrote:
> Hello,
>
> Currently i am using 2.6 on Windows and need to start writing code in
> 3.0. I cannot leave 2.x yet because 3rd party modules are still not
> converted. So i want to install 3.0 without disturbing my current
> Python2.x. What i'm afraid of is tha
On Nov 13, 10:28 am, hetchkay wrote:
> On Nov 13, 9:50 am, John Yeung wrote:
>
>
>
> > On Nov 12, 11:22 pm, r wrote:
>
> > > On Nov 12, 10:07 pm, hetchkay wrote:
> > > > I have the following in exit.py:
> > > > import sys
> > > > sys.exit(0)
>
> > > > I now try 'python -i exit.py':
>
> > > > In
When I was approximately 5, everybody knew that higher level languages were too
slow for high-speed numeric computation (I actually didn't know that then, I
was too busy watching Bill and Ben the Flowerpot Men), and therefore assembly
languages were mandatory. Then IBM developed Fortran, and hig
On Nov 13, 9:50 am, John Yeung wrote:
> On Nov 12, 11:22 pm, r wrote:
>
>
>
> > On Nov 12, 10:07 pm, hetchkay wrote:
> > > I have the following in exit.py:
> > > import sys
> > > sys.exit(0)
>
> > > I now try 'python -i exit.py':
>
> > > In 2.5, the script exits as I would expect.
>
> > > In 2.6
On Fri, Nov 13, 2009 at 12:47 AM, MRAB wrote:
> S.Selvam wrote:
>
>> Hi all,
>>
>>
>> 1) I need to remove the tags which is just before the keyword(i.e
>> some_text2 ) excluding others.
>>
>> 2) input string may or may not contain tags.
>>
>> 3) Sample input: inputstr = """start > href="so
On Nov 12, 6:29 pm, greg wrote:
> I would be taking a different approach -- develop a prototype
> in Python, concentrating on clarity rather than speed, and
> later reimplement the core of the emulator as an extension
> module, using Pyrex or Cython or otherwise.
But keep in mind he said he was d
In article
<008aa7ef-b945-4f70-b5e4-def66546e...@2g2000prl.googlegroups.com>,
hetchkay wrote:
> I have the following in exit.py:
> import sys
> sys.exit(0)
>
> I now try 'python -i exit.py':
>
> In 2.5, the script exits as I would expect.
>
> In 2.6, the following error is printed:
>
> Trace
On Nov 12, 6:37 am, Santiago Romero wrote:
> > > I'm trying to port (just for fun), my old Sinclair Spectrum emulator,
> > > ASpectrum, from C to Python + pygame.
>
> > The answer to your question is, "Use numpy". More details below.
>
> Let's see :-)
>
> > > How can I implement this in Python
On Nov 12, 11:32 pm, hetchkay wrote:
> But I don't understand why the interpreter does not exit in 2.6 but
> does exit in 2.5. Well, I do not need to understand that but I need to
> know how to get the interpreter to exit in 2.6.
Well, taken at face value, I would say the answer is to not use the
On Nov 12, 11:22 pm, r wrote:
> On Nov 12, 10:07 pm, hetchkay wrote:
> > I have the following in exit.py:
> > import sys
> > sys.exit(0)
>
> > I now try 'python -i exit.py':
>
> > In 2.5, the script exits as I would expect.
>
> > In 2.6, the following error is printed:
>
> > Traceback (most recen
Hello,
Thanks for your help.
I know what SystemExit is. In 2.5 as well SystemExit is raised when
sys.exit() is called. For example:
try:
import sys
sys.exit(0)
except SystemExit:
print "system exit raised"
raise
But I don't understand why the interpreter does not exit in 2.6 but
does exi
Hello all,
im making some script with python mechanize,
one of problem is it really hard to find which support javascript supported
web client scraping or crawler.
actually i was found some such as python-spidermonkey and pykhtml and so on.
but most of all only support on linux .
i want to make my
PS: Python even answers questions:
>>> import sys
>>> help(sys.exit)
Help on built-in function exit in module sys:
exit(...)
exit([status])
Exit the interpreter by raising SystemExit(status).
If the status is omitted or None, it defaults to zero (i.e.,
success).
If the status is
On Nov 12, 10:07 pm, hetchkay wrote:
> Hello,
>
> I have the following in exit.py:
> import sys
> sys.exit(0)
>
> I now try 'python -i exit.py':
>
> In 2.5, the script exits as I would expect.
>
> In 2.6, the following error is printed:
>
> Traceback (most recent call last):
> File "exit.py", li
On Nov 12, 7:44 pm, Steven D'Aprano wrote
> Oh, but those hundreds of thousands of man-hours lost to bugs caused by
> assignment-as-an-expression is nothing compared to the dozens of man-
> minutes saved by having one fewer line of code!
OK, what *if* the variable would only be valid in *that* bl
Hello,
I have the following in exit.py:
import sys
sys.exit(0)
I now try 'python -i exit.py':
In 2.5, the script exits as I would expect.
In 2.6, the following error is printed:
Traceback (most recent call last):
File "exit.py", line 2, in
sys.exit(0)
SystemExit: 0
>>>
I couldn't find
> >Esky is an auto-update framework for frozen python apps, built on top of
> >bbfreeze. It provides a simple API through which apps can find, fetch
> >and install updates, and a bootstrapping mechanism that keeps the app
> >safe in the face of failed or partial updates.
>
> Recently I was looki
Robert Kern wrote:
Jeremiah
H. Savage wrote:
To use pymol and numpy together, I now do the following:
To ~/.bashrc add:
PYMOL_PATH=/usr/lib/pymodules/python2.5/pymol
export PYMOL_PATH
Then I can do the following in python:
import numpy
numpy.save('123',numpy.arra
Hello,
I have the following in exit.py:
import sys
sys.exit(0)
I now try 'python -i exit.py':
In 2.5, the script exits as I would expect.
In 2.6, the following error is printed:
Traceback (most recent call last):
File "exit.py", line 2, in
sys.exit(0)
SystemExit: 0
>>>
I couldn't find
In article ,
Ryan Kelly wrote:
>
>Esky is an auto-update framework for frozen python apps, built on top of
>bbfreeze. It provides a simple API through which apps can find, fetch
>and install updates, and a bootstrapping mechanism that keeps the app
>safe in the face of failed or partial updates.
"Alf P. Steinbach" wrote:
> One reaction to http://preview.tinyurl.com/ProgrammingBookP3> has
> been that turtle graphics may be off-putting to some
> readers because it is associated with children's learning.
[I'll be honest and say that I merely glanced at the two
pdf files.]
Who is your targe
On Fri, 13 Nov 2009 15:33:53 +1300, greg wrote:
> Santiago Romero wrote:
>>>How about
>>>page, index = divmod(address, 16384)
>>
>> Surely, much better and faster :-)
>
> Not necessarily, because it involves a function call, and constructing
> and deconstructing a result tuple. If you time t
Duncan Booth writes:
> > http://scienceblogs.com/goodmath/2009/11/googles_new_language_go.php
> >
> Thanks for that link. I think it pretty well agrees with my first
> impressions of Go:
It looks like a not-so-interesting C follow-on, but the article doesn't
describe any of the parallelism stuf
On Fri, 13 Nov 2009 15:29:03 +1300, greg wrote:
> Generally, I think you're going to have quite a battle on your hands to
> get a pure Python implementation to run as fast as a real Z80, if it's
> even possible at all. And if you do succeed, the code will be pretty
> awful (due to things such as n
On Thu, 12 Nov 2009 21:02:11 +0100, Alf P. Steinbach wrote:
> Specifically, I reacted to the statement that < talk about "the" speed of an implementation>>, made in response to
> someone upthread, in the context of Google finding CPython overall too
> slow.
>
> It is quite slow. ;-)
Quite slow t
TerryP wrote:
If it's such a big hairy deal, just recompile a copy of the C Pre
Processor to use something other then #, and hook it up to your python
scripts in a pipe line from a shell wrapper.
Or use a different preprocessor, such as m4, that
doesn't clash with the # character.
--
Greg
--
h
Jeremiah H. Savage wrote:
To use pymol and numpy together, I now do the following:
To ~/.bashrc add:
PYMOL_PATH=/usr/lib/pymodules/python2.5/pymol
export PYMOL_PATH
Then I can do the following in python:
import numpy
numpy.save('123',numpy.array([1,2,3]))
numpy.
Santiago Romero wrote:
How about
page, index = divmod(address, 16384)
Surely, much better and faster :-)
Not necessarily, because it involves a function call,
and constructing and deconstructing a result tuple.
If you time them, you may well find that the explicit
shift and mask operation
Carl Banks wrote:
You
can define constants to access specific registers:
R1L = 1
R1H = 2
R1 = 1
breg[R1H] = 2
print wreg[R1]
But keep in mind that named "constants" at the module level
are really global variables, and therefore incur a dictionary
lookup every time they're used.
For maximum s
Steven D'Aprano wrote:
On Thu, 12 Nov 2009 19:30:01 +, MRAB wrote:
I don't understand that. Exit status codes on all systems I'm familiar
with are limited to 0 through 255. What operating system are you using?
Assuming your system allows two-byte exit statuses, you should check
the documen
On Thu, 12 Nov 2009 10:39:33 -0800, scoopseven wrote:
> I need to create a dictionary of querysets. I have code that looks
> like:
>
> query1 = Myobject.objects.filter(status=1)
> query2 = Myobject.objects.filter(status=2)
> query3 = Myobject.objects.filter(status=3)
>
> d={}
> d['a'] = query
>Note: The client part of this product is free. You only need to
>get a license for the server part.
Yeah, but don't I need the server part to make the connection?
Would it be possible to use Jython and the Pervasive JDBC driver for
this?
On Nov 12, 2:56 pm, "M.-A. Lemburg" wrote:
> Tony Schmid
On Thu, 12 Nov 2009 19:30:01 +, MRAB wrote:
>> I don't understand that. Exit status codes on all systems I'm familiar
>> with are limited to 0 through 255. What operating system are you using?
>>
>> Assuming your system allows two-byte exit statuses, you should check
>> the documentation for
On Thu, 12 Nov 2009 21:27:31 +0100, Bruno Desthuilliers wrote:
> Congratulations, you just reinvented one of the most infamous source of
> bugs in C, C++, Java, PHP, javascript and quite a few other languages.
> Believe it or not, but not allowing this in Python was a very deliberate
> design choi
On Nov 12, 8:01 pm, alex23 wrote:
> On Nov 13, 10:47 am, Kevin Cole wrote:
>
>
>
> > Hi,
>
> > I recently asked our IT department how to gain access to an
> > addressbook. After carefully explaining that I was on a Linux system
> > using Python, I got the reply:
>
> > "You should use our LDAP. W
On Wed, Nov 11, 2009 at 7:48 PM, Dave Angel wrote:
>
>
> Jeremiah wrote:
>>
>> Hello,
>>
>> I'm fairly new to python (version 2.5.4), and am writing a program
>> which uses both pymol (version 1.2r1) and numpy (version 1.3.0) from
>> debian.
>>
>> It appears that when I add pymol to $PYTHONPATH, t
On Nov 12, 8:01 pm, alex23 wrote:
> On Nov 13, 10:47 am, Kevin Cole wrote:
>
>
>
> > Hi,
>
> > I recently asked our IT department how to gain access to an
> > addressbook. After carefully explaining that I was on a Linux system
> > using Python, I got the reply:
>
> > "You should use our LDAP. W
On Nov 13, 10:47 am, Kevin Cole wrote:
> Hi,
>
> I recently asked our IT department how to gain access to an
> addressbook. After carefully explaining that I was on a Linux system
> using Python, I got the reply:
>
> "You should use our LDAP. With LDAP you can pull any data you want
> from Active
Hi,
I recently asked our IT department how to gain access to an
addressbook. After carefully explaining that I was on a Linux system
using Python, I got the reply:
"You should use our LDAP. With LDAP you can pull any data you want
from Active Directory. On our network, the serverless binding add
On Nov 12, 2:37 pm, Bruno Desthuilliers
wrote:
> > Oh i get it now! If i assign a valid value to a variable the variable
> > is also valid...thats...thats... GENUIS! *sarcasm*
>
> It's not about "assigning a valid value to a variable", it's about the
> name being created (or not) in the current n
Tony Schmidt wrote:
> I am trying to read a Pervasive database on a Windows machine from a
> Python script on a Linux machine.
>
> I understand that this can be done with a proprietary ODBC-to-ODBC
> bridge called mxODBC or Easysoft OOB.
The product is called "mxODBC Connect" and allows connectin
Diez B. Roggisch wrote:
> with open("/sys/class/net/wlan1/device/tx_power", "w") as f:
> f.write("%i" % POWER)
IIRC the sys and proc virtual file system requires new line at the end
of a modifier. At least echo appends \n unless it's told otherwise.
Christian
--
http://mail.python.org/mail
On Nov 12, 2:51 pm, Terry Reedy wrote:
> rantingrick wrote:
> > Hello,
>
> > Currently i am using 2.6 on Windows and need to start writing code in
> > 3.0. I cannot leave 2.x yet because 3rd party modules are still not
> > converted. So i want to install 3.0 without disturbing my current
> > Pytho
I'm happy to announce that ActivePython 2.6.4.8 is now available for
download from:
http://www.activestate.com/activepython/
This is a patch release that updates ActivePython to core Python 2.6.4.
We recommend that you try 2.6 version first. See the release
notes for full details:
http:
I am trying to read a Pervasive database on a Windows machine from a
Python script on a Linux machine.
I understand that this can be done with a proprietary ODBC-to-ODBC
bridge called mxODBC or Easysoft OOB.
Is there anyway to do this with existing free/ open source tools?
Thanks in advance for
On 2009-11-12, Patrick Sabin wrote:
> kj wrote:
>>
>> I'm just learning about Google's latest: the GO (Go?) language.
>> (e.g. http://golang.org or http://www.youtube.com/watch?v=rKnDgT73v8s).
>> There are some distinctly Pythonoid features to the syntax, such
>> as "import this_or_that", the abs
r a écrit :
> On Nov 11, 2:37 am, Steven D'Aprano
> wrote:
>> On Wed, 11 Nov 2009 00:08:58 -0800, r wrote:
>
>>> Yea it's called a NameError. Would it not also blow up in the current
>>> state of syntax usage?
>> No.
>>
>>> if var:
>>> print 'var'
>>> Traceback (most recent call last):
>>>
Steven D'Aprano a écrit :
(snip)
> Hint to would-be language designers: if you start off by claiming that a
> new feature will save an indent level, when in fact it *doesn't* save an
> indent level, you can save yourself from embarrassment by pressing Close
> on your post instead of Send.
Mouaa
I am trying to access (from Java) a python class that extends a Java
interface. The following program runs fine in the jython console (I
can instantiate Tada, call t.getName() and everything prints
correctly.) However, if I invoke test1() from Java using JSR223, the
returned object is inaccessible
r a écrit :
-snip)
> Just thinking out loud here...what if variable assignments could
> return a value... hmmm? Not to them selfs of course but to a caller,
> like an if statement...
>
> if a=openfile:
> # do something with a
Congratulations, you just reinvented one of the most infamous source
Steven D'Aprano wrote:
On Wed, 11 Nov 2009 17:24:37 -0800, hong zhang wrote:
List,
I have a question of python using echo.
POWER = 14
return_value = os.system('echo 14 >
/sys/class/net/wlan1/device/tx_power')
can assign 14 to tx_power
But
return_value = os.system('echo $POWER >
/sys/class/n
kj wrote:
I'm just learning about Google's latest: the GO (Go?) language.
(e.g. http://golang.org or http://www.youtube.com/watch?v=rKnDgT73v8s).
There are some distinctly Pythonoid features to the syntax, such
as "import this_or_that", the absence of parentheses at the top of
flow control const
On Thu, 12 Nov 2009 12:44:00 -0800, Benjamin Kaplan
wrote:
Some one could even write an
interpreter for C++ if they wanted to.
Someone has (http://root.cern.ch/drupal/content/cint)!
--
Rami Chowdhury
"Never attribute to malice that which can be attributed to stupidity" --
Hanlon's Razor
On 11/12/2009 11:26 AM, Dave Angel wrote:
> Try http://fireftp.mozdev.org/
in the past i found this to be buggy. i'd recommend
something different.
what is your OS?
-- david
--
http://mail.python.org/mailman/listinfo/python-list
Carl Banks wrote:
Well, it's hard to argue with not being like C++, but the lack of
inheritance is a doozie.
Well it has the concept of embedding, which seems to be similar to
inheritance.
- Patrick
--
http://mail.python.org/mailman/listinfo/python-list
Ray Holt wrote:
I have an assigment to find the 1000th. prime using python. What's wrong
with the following code:
PrimeCount = 0
PrimeCandidate = 1
while PrimeCount < 2000:
IsPrime = True
PrimeCandidate = PrimeCandidate + 2
for x in range(2, PrimeCandidate):
if PrimeCandidate
rantingrick wrote:
Hello,
Currently i am using 2.6 on Windows and need to start writing code in
3.0. I cannot leave 2.x yet because 3rd party modules are still not
converted. So i want to install 3.0 without disturbing my current
Python2.x. What i'm afraid of is that some SYSVARIABLE will get
ch
On Thu, Nov 12, 2009 at 2:52 PM, rantingrick wrote:
> Hello,
>
> Currently i am using 2.6 on Windows and need to start writing code in
> 3.0. I cannot leave 2.x yet because 3rd party modules are still not
> converted. So i want to install 3.0 without disturbing my current
> Python2.x. What i'm afr
On Thu, Nov 12, 2009 at 2:24 PM, Alf P. Steinbach wrote:
>
> You'll also find it impossible to rigorously define "dynamic language" in a
> general way so that that definition excludes C++.
>
> So, to anyone who understands what one is talking about, "interpreted", or
> e.g. "slow language" (as wa
On Thu, Nov 12, 2009 at 12:06 PM, Russ P. wrote:
> I have a Python program that runs too slow for some inputs. I would
> like to speed it up without rewriting any code. Psyco seemed like
> exactly what I need, until I saw that it only works on a 32-bit
> architecture. I work in an environment of
On Thu, 12 Nov 2009 12:02:11 -0800, Alf P. Steinbach
wrote:
I think that was in the part you *snipped* here. Just fill in the
mentioned qualifications and weasel words.
OK, sure. I don't think they're weasel words, because I find them useful,
but I think I see where you're coming from.
S
On Thursday, November 12, 2009, Benjamin Kaplan
wrote:
> On Thursday, November 12, 2009, Ray Holt wrote:
>>
>>
>>
>>
>>
>> I have an assigment
>> to find the 1000th. prime using python. What's wrong with the following
>> code:
>> PrimeCount =
>> 0
>> PrimeCandidate = 1
>> while PrimeCount < 2000:
I have a Python program that runs too slow for some inputs. I would
like to speed it up without rewriting any code. Psyco seemed like
exactly what I need, until I saw that it only works on a 32-bit
architecture. I work in an environment of Sun Ultras that are all 64-
bit. However, the Psyco docs sa
On Thursday, November 12, 2009, Ray Holt wrote:
>
>
>
>
>
> I have an assigment
> to find the 1000th. prime using python. What's wrong with the following
> code:
> PrimeCount =
> 0
> PrimeCandidate = 1
> while PrimeCount < 2000:
>
> IsPrime = True
> PrimeCandidate = PrimeCandidate +
> 2
>
* Rami Chowdhury:
On Thu, 12 Nov 2009 11:24:18 -0800, Alf P. Steinbach
wrote:
* Rami Chowdhury:
On Thu, 12 Nov 2009 09:32:28 -0800, Alf P. Steinbach
wrote:
This also seems religious. It's like in Norway it became illegal to
market lemon soda, since umpteen years ago it's soda with lemon
Hello,
Currently i am using 2.6 on Windows and need to start writing code in
3.0. I cannot leave 2.x yet because 3rd party modules are still not
converted. So i want to install 3.0 without disturbing my current
Python2.x. What i'm afraid of is that some SYSVARIABLE will get
changed to Python3.0 an
Thanks.
V
On Thu, Nov 12, 2009 at 2:26 PM, Dave Angel wrote:
>
>
> Victor Subervi wrote:
>
>> Hi;
>> Someone on this list just recommended I find an ftp client that enables me
>> to change line endings. He indicated that it would be easy, but googling I
>> haven't been able to find one. I would
Ray Holt wrote:
I have an assigment to find the 1000th. prime using python. What's wrong
with the following code:
PrimeCount = 0
PrimeCandidate = 1
while PrimeCount < 2000:
IsPrime = True
PrimeCandidate = PrimeCandidate + 2
for x in range(2, PrimeCandidate):
if PrimeCandidate
On Thu, 12 Nov 2009 11:24:18 -0800, Alf P. Steinbach
wrote:
* Rami Chowdhury:
On Thu, 12 Nov 2009 09:32:28 -0800, Alf P. Steinbach
wrote:
This also seems religious. It's like in Norway it became illegal to
market lemon soda, since umpteen years ago it's soda with lemon
flavoring. Thi
On Nov 12, 11:31 am, Terry Reedy wrote:
> Alf P. Steinbach wrote:
> > One reaction to >http://preview.tinyurl.com/ProgrammingBookP3> has been that turtle
> > graphics may be off-putting to some readers because it is associated
> > with children's learning.
>
> > What do you think?
>
> I just star
Alf P. Steinbach wrote:
One reaction to http://preview.tinyurl.com/ProgrammingBookP3> has been that turtle
graphics may be off-putting to some readers because it is associated
with children's learning.
What do you think?
I just started using the module for simple plots.
I am not a child.
You
Steven D'Aprano wrote:
On Wed, 11 Nov 2009 17:24:37 -0800, hong zhang wrote:
List,
I have a question of python using echo.
POWER = 14
return_value = os.system('echo 14 >
/sys/class/net/wlan1/device/tx_power')
can assign 14 to tx_power
But
return_value = os.system('echo $POWER >
/sys/class/n
Victor Subervi wrote:
Hi;
Someone on this list just recommended I find an ftp client that enables me
to change line endings. He indicated that it would be easy, but googling I
haven't been able to find one. I would prefer a free client, but whatever.
Please send me a recommendation.
TIA,
Victor
* Rami Chowdhury:
On Thu, 12 Nov 2009 09:32:28 -0800, Alf P. Steinbach
wrote:
This also seems religious. It's like in Norway it became illegal to
market lemon soda, since umpteen years ago it's soda with lemon
flavoring. This has to do with the *origin* of the citric acid,
whether natural o
S.Selvam wrote:
Hi all,
1) I need to remove the tags which is just before the keyword(i.e
some_text2 ) excluding others.
2) input string may or may not contain tags.
3) Sample input:
inputstr = """start some_text1 href="">some_text2 keyword anything"""
4) I came up with the follo
I have an assigment to find the 1000th. prime using python. What's wrong
with the following code:
PrimeCount = 0
PrimeCandidate = 1
while PrimeCount < 2000:
IsPrime = True
PrimeCandidate = PrimeCandidate + 2
for x in range(2, PrimeCandidate):
if PrimeCandidate % x == 0:
##
scoopseven schrieb:
I need to create a dictionary of querysets. I have code that looks
like:
query1 = Myobject.objects.filter(status=1)
query2 = Myobject.objects.filter(status=2)
query3 = Myobject.objects.filter(status=3)
d={}
d['a'] = query1
d['b'] = query2
d['c'] = query3
Is there a way to
2009/11/12 scoopseven :
> I need to create a dictionary of querysets. I have code that looks
> like:
>
> query1 = Myobject.objects.filter(status=1)
> query2 = Myobject.objects.filter(status=2)
> query3 = Myobject.objects.filter(status=3)
>
> d={}
> d['a'] = query1
> d['b'] = query2
> d['c'] = quer
If it's such a big hairy deal, just recompile a copy of the C Pre
Processor to use something other then #, and hook it up to your python
scripts in a pipe line from a shell wrapper.
Personally, I'd rather have Lisps lambda or perls sub then Cs
preprocessor, and even in those cases, Python suffices
On Thu, 12 Nov 2009 09:32:28 -0800, Alf P. Steinbach
wrote:
This also seems religious. It's like in Norway it became illegal to
market lemon soda, since umpteen years ago it's soda with lemon
flavoring. This has to do with the *origin* of the citric acid, whether
natural or chemist's con
Someone on this list just recommended I find an ftp client that enables me
to change line endings. He indicated that it would be easy, but googling I
haven't been able to find one. I would prefer a free client, but whatever.
Please send me a recommendation.
How about the command line client that
I need to create a dictionary of querysets. I have code that looks
like:
query1 = Myobject.objects.filter(status=1)
query2 = Myobject.objects.filter(status=2)
query3 = Myobject.objects.filter(status=3)
d={}
d['a'] = query1
d['b'] = query2
d['c'] = query3
Is there a way to do this that I'm missi
On Nov 12, 10:10 am, Ethan Furman wrote:
> AK Eric wrote:
> > so:
>
> > # moduleA.py
> > import moduleB
>
> > # moduleB.py
> > import sys
> > stuff = sys._getframe(1).f_locals
> > print stuff
>
> > Prints:
>
> > {'__builtins__': ,
> > '__file__': 'C:\\Documents and SettingsMy Documents\
> > \p
AK Eric wrote:
so:
# moduleA.py
import moduleB
# moduleB.py
import sys
stuff = sys._getframe(1).f_locals
print stuff
Prints:
{'__builtins__': ,
'__file__': 'C:\\Documents and SettingsMy Documents\
\python\\moduleA.py',
'__name__': '__main__',
'__doc__': None}
Looks like you could query s
On Thu, Nov 12, 2009 at 12:05 PM, Sriram Srinivasan
wrote:
>> So all libraries written have to use the common subset, which - unless
>> things are *removed*, which with python3 actually happened - is always
>> the oldest interpreter. And if a feature goes away, they have to be
>> rewritten with th
Oops, numpy arrays start with index=0 :-)
--
http://mail.python.org/mailman/listinfo/python-list
so:
# moduleA.py
import moduleB
# moduleB.py
import sys
stuff = sys._getframe(1).f_locals
print stuff
Prints:
{'__builtins__': ,
'__file__': 'C:\\Documents and SettingsMy Documents\
\python\\moduleA.py',
'__name__': '__main__',
'__doc__': None}
Looks like you could query stuff['__file__']
> You can do clever memory slicing like this with numpy. For instance:
>
> breg = numpy.zeros((16,),numpy.uint8)
> wreg = numpy.ndarray((8,),numpy.uint16,breg)
>
> This causes breg and wreg to share the same 16 bytes of memory. You
> can define constants to access specific registers:
What I'm d
Santiago Romero, 12.11.2009 18:23:
> #define LD_r_n(reg) (reg) = Z80ReadMem(r_PC++)
>
> #define LD_rr_nn(reg) r_opl = Z80ReadMem(r_PC); r_PC++; \
> r_oph = Z80ReadMem(r_PC); r_PC++; \
> reg = r_op
>
> #define LOAD_r(dreg, saddreg) (dreg)=Z80Read
mcherm writes:
> On Nov 11, 7:38 pm, Vincent Manis wrote:
>> 1. The statement `Python is slow' doesn't make any sense to me.
>> Python is a programming language; it is implementations that have
>> speed or lack thereof.
>[...]
>> 2. A skilled programmer could build an implementation that com
* Steven D'Aprano:
On Thu, 12 Nov 2009 08:35:23 -0800, Joel Davis wrote:
obviously the GIL is a major reason it's so slow.
http://en.wikipedia.org/wiki/Global_Interpreter_Lock
Uh oh...
No such "obviously" about it.
There have been attempts to remove the GIL, and they lead to CPython
be
On 12 nov, 18:16, Stefan Behnel wrote:
> Santiago Romero, 12.11.2009 17:43:
>
> > Is there a Python version of C's language #define statements?
>
> > Example:
>
> > #define ReadMem( (x) ) memory[ (x) ]
>
> Yes:
>
> ReadMem = memory.__getitem__
>
> Stefan
Well, In the above concrete e
> Could not import module "Gnuplot" - it is not installed on your
> system. You need to install the Gnuplot.py package.
> \easyviz\gnuplot_.py(41) :
> Traceback (most recent call last):
> File "E:\study\python\commodity modle 10.23.py", line 3, in
> import multipleloop as mp
> File "E:\stu
1 - 100 of 159 matches
Mail list logo