In article <[EMAIL PROTECTED]>,
Jan Niklas Fingerle <[EMAIL PROTECTED]> wrote:
> ...Super is a good tool to use, when dealing with
> diamond shape inheritance. In any other case I would use the direct
> calls to the base classes. In fact, i've yet to find a non-textbook-case
> where I really need
In article <[EMAIL PROTECTED]>,
"Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
...
> Discussion
> ==
>
> Why not size_t
> --
>
> An initial attempt to implement this feature tried to use
> size_t. It quickly turned out that this cannot work: Python
> uses negative indices in m
In article <[EMAIL PROTECTED]>,
Claudio Grondi <[EMAIL PROTECTED]> wrote:
> Claudio Grondi wrote:
> > Claudio Grondi wrote:
> >
> >> Paul Probert wrote:
> >>
> >>> Peter Hansen wrote:
> >>>
> Are you saying that you believe the time.sleep(1) call is actually
> blocking for 200 seconds
Hi, I'd like to start a program, run it for a while, then terminate
it. I can do this on linux, but I'm new to working with windows.
Here's my script:
from subprocess import Popen
from time import sleep
import win32api
war3game = Popen(["C:\Program Files\Warcraft III\Frozen Throne.exe"])
sleep(30
On Jun 2, 11:43 am, Tim Golden <[EMAIL PROTECTED]> wrote:
> Thomas Nelson wrote:
> > from subprocess import Popen
> > from time import sleep
> > import win32api
> > war3game = Popen(["C:\Program Files\Warcraft III\Frozen Throne.exe"])
>
Does anyone know where I could find help on condor_compiling a python
interpreter? My own attempts have failed, and I can't find anything
on google.
Here's the condor page:
http://www.cs.wisc.edu/condor/
Thanks,
Tom
--
http://mail.python.org/mailman/listinfo/python-list
Occasionally someone posts to this group complaining about the lack of
"repeat ... until" in python. I too have occasionally wished for such
a construct, and after some thinking, I came up with the class below.
I'm hoping to get some feedback here, and if people besides me think
they might use it
Occasionally people post complaining about the lack of a
"repeat...until" structure in python. I thought about it and came up
with this recipe that I like. The only ugly thing is having to use
lambdas, otherwise it's very terse and readable. Tell me what you
think, and if anyone besides me think
On Apr 23, 10:38 pm, Mel Wilson <[EMAIL PROTECTED]> wrote:
> Neil Cerutti wrote:
> > The interpreter explains it: "A list is not a hashable object."
> > Choosing a hash table instead of some kind of balanced tree seems
> > to be just an optimization. ;)
>
> Even with a balanced tree, if a key in a
On Apr 27, 11:37 am, Tommy Grav <[EMAIL PROTECTED]> wrote:
> > him> I do not have a text editor, but here are the answers to
> > him> questions 1-5.
>
> > Now, frankly, I don't think this answer is correct, since I know OS
> > X is
> > a UNIX derivative, but I am loathe to involve a programming n
I want to generate all the fractions between 1 and limit (with
limit>1) in an orderly fashion, without duplicates.
def all_ratios(limit):
s = set()
hi = 1.0
lo = 1.0
while True:
if hi/lo not in s:
s.add(hi/lo)
yield (hi,lo)
hi += 1
if
On May 4, 7:59 am, [EMAIL PROTECTED] wrote:
> On 4 ÍÁÊ, 09:08, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
>
> > En Fri, 04 May 2007 01:34:20 -0300, <[EMAIL PROTECTED]> escribio:
> > > I'm not against 'dir(MyClass)'; the question is, what should I 'dir()'
> > > to get methods of 'pyuno' type ins
In article <[EMAIL PROTECTED]>,
Kaz Kylheku <[EMAIL PROTECTED]> wrote:
> On May 2, 5:19 pm, sturlamolden <[EMAIL PROTECTED]> wrote:
> > On May 3, 2:15 am, Kaz Kylheku <[EMAIL PROTECTED]> wrote:
> >
> > > Kindly refrain from creating any more off-topic, cross-posted threads.
> > > Thanks.
> >
> >
On May 14, 11:05 am, [EMAIL PROTECTED] wrote:
> I have the following implementations of quicksort and insertion sort:
>
> def qSort(List):
> if List == []: return []
> return qSort([x for x in List[1:] if x< List[0]]) + List[0:1] + \
>qSort([x for x in List[1:] if x>=List[0]])
>
On Aug 15, 8:39 am, "Sebastian Bassi" <[EMAIL PROTECTED]>
wrote:
> That was easy :)
> What about extending it for N elements inside the dictionary? Sounds
> like a work for a recursive function.
Here's my attempt:
[code]
def backtrack(groups,position=0, answer=''):
if position==len(groups)
I have MapPoint working in Python, and I'm trying to cancel events on
the map, but I can't seem to make that happen. I'm responding to the
events successfully in my panel object. My code is like this:
global MapPointMod
MapPointMod =
win32com.client.gencache.EnsureModule("{51C0A9CA-F7B7-4F5A-
I have MapPoint working in Python, and I'm trying to cancel events on
the map, but I can't seem to make that happen. I'm responding to the
events successfully in my panel object. My code is like this:
global MapPointMod
MapPointMod =
win32com.client.gencache.EnsureModule("{51C0A9CA-F7B7-4F5A-
I have MapPoint working in Python, and I'm trying to cancel events on
the map, but I can't seem to make that happen. I'm responding to the
events successfully in my panel object. My code is like this:
global MapPointMod
MapPointMod =
win32com.client.gencache.EnsureModule("{51C0A9CA-F7B7-4F5A-
I have MapPoint working in Python, and I'm trying to cancel events on
the map, but I can't seem to make that happen. I'm responding to the
events successfully in my panel object. My code is like this:
global MapPointMod
MapPointMod =
win32com.client.gencache.EnsureModule("{51C0A9CA-F7B7-4F5A-
I have MapPoint working in Python, and I'm trying to cancel events on
the map, but I can't seem to make that happen. I'm responding to the
events successfully in my panel object. My code is like this:
global MapPointMod
MapPointMod =
win32com.client.gencache.EnsureModule("{51C0A9CA-F7B7-4F5A-
James,
I was getting an error everytime so I thought I had a setup problem...
Sorry everybody...
OLIVER
James Stroud wrote:
> Oliver, wait a while before you panic about your post not getting through!
>
> James
>
--
http://mail.python.org/mailman/listinfo/python-list
I have MapPoint working in Python, and I'm trying to cancel events on
the map, but I can't seem to make that happen. I'm responding to the
events successfully in my panel object. My code is like this:
global MapPointMod
MapPointMod =
win32com.client.gencache.EnsureModule("{51C0A9CA-F7B7-4F5A-
nly a different model than the standard wx event system...
OLIVER
[EMAIL PROTECTED] wrote:
> On Aug 17, 11:54 pm, Oliver Nelson <[EMAIL PROTECTED]> wrote:
>> I have MapPoint working in Python, and I'm trying to cancel events on
>> the map, but I can't seem to make that happ
Roger,
I tried modifying my code so that I have
def OnBeforeClick(self, Button, Shift, X, Y, Cancel):
print "click"
Cancel = True
return Cancel
But this doesn't seem to have changed anything. Am I doing this wrong?
OLIVER
Roger Upole wrote:
> O
> > > On Sep 5, 8:58 pm, planetmatt <[EMAIL PROTECTED]> wrote:
>
> > > > I am a Python beginner. I am trying to loop through a CSV file which
> > > > I can do. What I want to change though is for the loop to start at
> > > > row 2 in the file thus excluding column headers.
The DictReader object
bahoo wrote:
> Hi,
>
> I have a list like ['0024', 'haha', '0024']
> and as output I want ['haha']
>
> If I
> myList.remove('0024')
>
> then only the first instance of '0024' is removed.
>
> It seems like regular expressions is the rescue, but I couldn't find
> the right tool.
>
> Thanks!
> bahoo
On Apr 3, 1:49 pm, [EMAIL PROTECTED] wrote:
> On Apr 3, 1:31 pm, "Matimus" <[EMAIL PROTECTED]> wrote:
>
> > It depends on your application, but a 'set' might really be what you
> > want, as opposed to a list.
>
> > >>> s = set(["0024","haha","0024"])
> > >>> s
>
> > set(["0024","haha"])>>> s.remove
I was looking at adding dtrace-like dynamic tracing to Python. Note that
this isn't dtrace itself. The basic rationale:
1. A lot of enterprise-level software is written in Python. It is difficult
to impossible to reproduce the customer environment in a test lab.
Sometimes applications hang myst
> def A():
> print 'warp in A'
> def why(self, *arg, **kw):
> print 'in A'
> print self
> print arg
> print kw
> #self(*arg, **kw)
>
> return why
>
> class T(object):
> @A()
> def test(g, out):
>
> i have a function that I could like to call, but to make it more
> dynamic I am constructing a string first that could equivalent to the
> name of the function I wish to call. how could I do that? the string
> could might include name of the module.
>
> for example
>
> a_string = 'datetime.' +
My code:
class Policy(list):
def __cmp__(self,other):
return cmp(self.fitness,other.fitness)
j = Policy()
j.fitness = 3
k = Policy()
k.fitness = 1
l = Policy()
l.fitness = 5
print max([j,k,l]).fitness
prints 3, when I was expecting it to print 5. What have I done wrong?
Thanks for
On Jan 28, 3:13 pm, Wojciech Muła
<[EMAIL PROTECTED]> wrote:
>Define method __gt__.
This works, thanks. I was a little surprised though. is __cmp__ used
by any builtin functions?
Thanks,
THN
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 30, 5:55 pm, [EMAIL PROTECTED] wrote:
> I can't seem to get this nailed down and I thought I'd toss it out
> there as, by gosh, its got to be something simple I'm missing.
>
> I have two different database tables of events that use different
> schemas. I am using python to collate these reco
I realize I'm approaching this backwards from the direction most
people go, but does anyone know of a good c/c++ introduction for
python programmers?
Thanks,
Thomas
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 12, 1:35 pm, andrew clarke <[EMAIL PROTECTED]> wrote:
> Thomas, I sent you a message off-list but it bounced due to your mailbox
> being full.
>
> Short answer: Subscribe to the c-prog@yahoogroups.com mailing list and
> ask your C/C++ questions there.
>
> Regards
> Andrew
I have to edit a
Check out the dir() function. It does what you want, I think.
Tom
On Feb 22, 9:27 am, [EMAIL PROTECTED] wrote:
> Hello,
> Sorry guys for this newbie questions. But I wonder if there is a
> standard or build-in method to know the methods of a class?
>
> I'm not originally a progrommer and I have
In article <[EMAIL PROTECTED]>,
"Andy Watson" <[EMAIL PROTECTED]> wrote:
...
> If I could have a heap that is larger and does not need to be
> dynamically extended, then the Python GC could work more efficiently.
...
GC! If you're allocating lots of objects and holding on to them, GC
will ru
In article <[EMAIL PROTECTED]>,
"bobmon" <[EMAIL PROTECTED]> wrote:
> Hello, and please be gentle...
>
> I'm trying to build Python 2.5 on my Fedora Core 6 installation. I
> think I've resolved most of my problems, but "make test" reports an
> error for test_socket.py, shown below.
>
> I suppo
In article <[EMAIL PROTECTED]>,
BartlebyScrivener <[EMAIL PROTECTED]> wrote:
> Is the main Python tutorial posted on single searchable page
> somewhere? As opposed to browsing the index and clicking NEXT etc.
For completeness (though a bit late), I'll mention that Google can
search a group of
What is a mobile game? Is it a game that can be played on a mobile
phone?
THN
--
http://mail.python.org/mailman/listinfo/python-list
There is also this way:
for index in range(len(someList)):
someList[index] = 1
This is not as pretty or concise as enumerate(), but if you've never
seen that function before this may be more clear. I assume you're
familiar with the way range and len work.
THN
--
http://mail.python.org/mai
Here's an OO way that may do what you want:
>>> class MyD(dict):
... def __init__(self,dic,rep):
... dict.__init__(self,dic)
... self.rep = rep
... def __repr__(self):
... return self.rep
...
>>> apps = MyD({'alpha':1,'beta':2},'apps')
>>> apps
apps
>>> a
My usual way of emulating do-while is:
started = False
while (someBoolean or not started):
started = True
#whatever else
This simply assures "whatever else" happens at least once. Is this
Pythonic?
THN
--
http://mail.python.org/mailman/listinfo/python-list
Here's an OO way that may do what you want:
>>> class MyD(dict):
... def __init__(self,dic,rep):
... dict.__init__(self,dic)
... self.rep = rep
... def __repr__(self):
... return self.rep
...
>>> apps = MyD({'alpha':1,'beta':2},'apps')
>>> apps
apps
>>> a
I meant something like
def printdict(dictionaries=[(apps,'apps'), (dirs,'dirs'),
(sites,'sites')]):
for dictionary,name in dictionaries:
print name
keys = dictionary.keys()
keys.sort()
for key in keys:
print key, ":
I'm not sure what to say about that. The company I work for is
committed to Python (our product is mostly Python source), and my
current job is to make our software work on Itanium, which means
providing an Itanium build of Python. As long as I have this job I
suspect that I will be maintaining i
I'm trying to add a feedreader element to my django project. I'm
using Mark Pilgrim's great feedparser library. I've used it before
without any problems. I'm getting a TypeError I can't figure out.
I've tried searching google, bing, google groups to no avail.
Here's the dpaste of what I'm tryin
> But people will always prefer complaining on the grounds of
> insufficient information to keeping quiet on the basis of knowledge.
+1 QOTW!
--
http://mail.python.org/mailman/listinfo/python-list
> Another xkcd plug for Python: http://xkcd.com/409/
Damn it. There goes another 40 minutes of my life magically whisked away by
that more-addictive-than-crack 'RANDOM' button.
--
http://mail.python.org/mailman/listinfo/python-list
Following on from the success of previous sprint/bugfix weekends and
sprinting efforts at PyCon 2008, I'd like to propose the next two
Global Python Sprint Weekends take place on the following dates:
* May 10th-11th (four days after 2.6a3 and 3.0a5 are released)
* June
> > I have the need to occasionally translate a single word
> > programatically. Would anyone have a Python script that
> > would let me do this using Google (or another) translation
> > service?
As a matter of fact, yes, I do! This happens to be my most favourite piece of
Python code I've ever
> Are there any completely free developent tools for python
> scripts like IDLE. I have used IDLE , but I want to try out
> others also. I saw stuff like PyCrust, but I don't see that
> it can run the script as well.
> Thanks,
Ignoring the 'free' part of your question, I've recently moved from Py
Just a friendly reminder that this weekend is the Python sprint weekend! Look
forward to seeing everyone on #python-dev irc.freenode.net over the course of
the weekend!
Trent.
On 16 Apr, 18:52, Trent Nelson wrote:
>
>Following on from the success of previous sprint/bugfix we
On Thu, Sep 04, 2008 at 11:39:42AM -0700, Fett wrote:
> I need a crypto package that works on windows with python 2.5. Can
> anyone suggest one for me?
You could always rely on the the APIs Windows provides to do this
sort out stuff, either via pywin32 or ctypes.
Trent.
--
h
I just purchased a new macbook (os 10.4.6), and I'm trying to install
python 2.4 on it. I downloaded and ran the two installers recommended
at http://www.python.org/download/mac/. Now I have IDLE, which runs
2.4.1, but typing "python" at a terminal still opens 2.3.5, because it
points to /usr/bin
There is no 2.4 in my Versions folder, only 2.3 and current. Should
one of the installers have created this directory? Which one?
THN
--
http://mail.python.org/mailman/listinfo/python-list
Thanks to you both. I downloaded the dmg suggested, and trustingly
typed:
sudo rm /usr/bin/python
sudo ln -s /usr/local/bin/python2.4 /usr/bin/python
And now my command line and scripts behave the way I expect. Thanks
again.
THN
--
http://mail.python.org/mailman/listinfo/python-list
Well, as I stated in post, I've already replaced the link at
/usr/bin/python. I'm not clear why that's unhealthy. Should I change
it back to whatever it was before? I guess maybe it was
/System/Library/Frameworks/Python.framework/Versions/Current/bin/python
?
Thanks,
THN
--
http://mail.python.
Ok, I fixed my /usr/bin/python and added /usr/public/bin/ to my PATH in
.profile. Everything seems ok now.
Thanks again to everyone for their help.
THN
--
http://mail.python.org/mailman/listinfo/python-list
I thought the paragraph about provability was interesting. Presumably
the author refers to proofs in the spirit of "A Discipline of
Programming" from Djikstra, 1976. Unfortunately, I don't think anyone
has writting much about this since the 70s. I'd be interested to learn
if anyone's tried to wr
I downloaded the 3.1.1 dmg from http://www.python.org/download/releases/3.1.1/
but when I run it I get the error "The folowing install step failed:
run postflight script for python documentation." The bugs list has
this bug at http://bugs.python.org/issue6934 but it's described as
fixed. Is it on
I'm currently using QNX 6.4.1 with Python 2.5. I went to install
numpy 1.4.1, but the install kicks bakc an error saying that it cannot
find Python.h and that I should install python-dev|python-devel. I
look online and I can only find those two packages in relation to
Ubuntu, which obviously will
> I'm interested in improving my python design by studying a large,
> well-designed codebase.
I'll tell you one of the best ways to improve your Python code: attend
one of Raymond Hettinger's Code Clinic workshops at a Python conference
and put some up of your work up on the projector for 20+ deve
On 9 May 2010, at 16:29, Xavier Ho wrote:
On Sun, May 9, 2010 at 6:20 PM, gopi krishna
mailto:dasarathulag...@gmail.com>> wrote:
Why list comprehension faster than for loop?
Because Python optimises for certain special cases, when the number of
iterations is predicable in a list comprehension.
I'm working with Feedparser on months old install of Windows 7, and
now programs that ran before are broken, and I'm getting wierd
messages that are rather opaque to me. Google, Bing, News groups
have all left me empty handed.
I was wondering if I could humbly impose upon the wizards of
comp.lan
Thanks for the responses. I've tried the same script on a Server 2003
install, and Python 2.5 and it ran without a hitch. So, it's either a
problem with Python 2.6 or with Windows 7.
Thanks for all the responses. You've been great.
Best,
Jonathan
On Jun 5, 7:39 am, Jonatha
On 03-Sep-10 7:29 AM, Virgil Stokes wrote:
A more direct question on accessing stock information from Yahoo.
First, use your browser to go to:
http://finance.yahoo.com/q/cp?s=%5EGSPC+Components
Now, you see the first 50 rows of a 500 row table of information on S&P
500 index. You can LM click
On 03-Sep-10 1:48 PM, Frederic Rentsch wrote:
And do let us know if you get an answer from Yahoo. Hacks like this
are unreliable. They fail almost certainly the next time a page gets
redesigned, which can be any time.
Indeed -- see my other post (regarding ystockquote.py). There's a CSV
27;ll check out the FOR Loop in python and see how it is
different from the WHILE Loop.
____
From: nelson jon kane
Sent: Sunday, January 28, 2018 6:05:04 PM
To: python-list@python.org
Subject: Re: Welcome to the "Python-list" mailing list (Digest mode)
W
When I enter the word python in the search box on my Chrome Windows 10, this is
what comes up. Can you tell me what each of these "types" of Python mean? Thank
you.
[cid:aa3fd74d-d71d-42c0-b063-4f20c463987b]
From: Python-list on
behalf of python-list-requ...@p
Can someone explain to me what's going on here?
>>> __import__('some.package.module', {}, {}, [])
>>> __import__('some.package.module', {}, {}, [''])
(Note that '' is two single quotes)
Thanks,
Scott
--
http://mail.python.org/mailman/listinfo/python-list
System:
# rpm -q python m2crypto
python-2.4.3-27.el5
m2crypto-0.16-6.el5.6
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
I have the following method:
def ftp_tarball(aggregation_dir, date_format, ftp_server, ftp_user,
ftp_pass):
date = datetime.today().strftim
Hello,
System:
# rpm -q python m2crypto
python-2.4.3-27.el5
m2crypto-0.16-6.el5.6
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
I have the following method:
def ftp_tarball(aggregation_dir, date_format, ftp_server, ftp_user,
ftp_pass):
date = datetime.today(
On Feb 26, 2:05 pm, Stephen Nelson-Smith wrote:
> Hello,
I'm sorry - I hadn't realised that python-list ended up here as well.
Sincere apologies for double-posting.
S.
--
http://mail.python.org/mailman/listinfo/python-list
ome/stephen/scratch/test-data.txt'):
lines +=1
line = line.strip()
match = regex.match(line)
if match:
data = match.groupdict()
if data['SiteIntelligenceCookie'] == '':
no_cookies +=1
else:
print "Couldn't match ", line
unmatched +=1
print "I analysed %s lines." % (lines,)
print "There were %s lines with missing Site Intelligence cookies." %
(no_cookies,)
print "I was unable to process %s lines." % (unmatched,)
How can I make the regex a bit more resilient so it doesn't break when
" " is embedded?
--
Stephen Nelson-Smith
Technical Director
Atalanta Systems Ltd
www.atalanta-systems.com
--
http://mail.python.org/mailman/listinfo/python-list
101 - 175 of 175 matches
Mail list logo