a = 1+3j
complex(str(a))
Why does this not work ? It should
--
http://mail.python.org/mailman/listinfo/python-list
Heiko Wundram wrote:
> Am Freitag 19 Mai 2006 18:03 schrieb Paul McGuire:
>
>>An eval-less approach - the problem is the enclosing parens.
>>
>
>
> I've just submitted two patches to the Python bugtracker at:
>
> http://sourceforge.net/tracker/index.php?func=detail&aid=1491866&group_id=5470&ati
Greetings! I am trying to make a multiplayer (no AI, 2 person) game of
tic tac toe in Python. So far it has been pretty simple. My only
concern is with the win checking to see if a person has won. At first
it looked like it was working, but now it sometimes assigns a win when
you enter an X or
turnnumber -= 1
(gameboard[cell] not in 'OX' is the gameboard[cell] != 'OX' text I sort
of used in my code, right?)
I am confused about "OX": what exactly *is* it? After that, I plan to
rewrite all the code... :)
--
http://mail.python.org/mailman/listinfo/python-list
So is there a way I have to set up the string OX in the beginning? Is
this where it houses the location of the Xs and Os to determine whether
or not a letter is already there?
--
http://mail.python.org/mailman/listinfo/python-list
Nevermind my previous reply: I've been fixing up the code and
understand it. I'm at a nifty 80 lines where I am at now rather than
209 lines in the previous version! The changes are immense!
The only problem I have is whenever player two goes, it says the cell
is filled. But the code:
if gameb
The code's indentation was fine - I forgot to declare cell in player
two's section and not just in player one.
The code (including the win check, for once!) is working. The last
obstacle is my tie checker; it doesn't seem to like what I have:
if ((gameboard[0:9] is 'X' or 'O') and (win == 0)):
Hello, this is my first post here so apologies if it's in the wrong
place, inappropriate or embarrassingly stupid - please let me know :)
My problem seems quite simple - I've redirected stdout to a wxTextCtrl,
so that any trace messages appear in a log window at the bottom of my
app. T
Thanks, that did the trick perfectly :)
also got rid of the self._log member so the class is now just:
class LogControl:
""" Simple helper to redirect stdout to a panel in the GUI """
def __init__( self, textCtrl ):
self._ctrl = textCtrl
se
Another question: I am writing a sudoku solving program. The
'solving' part of is just multiple iterations. It will take random
numbers and keep switching it all around until a set of logic
statements has been met (ie; all numbers in a row are not equal to each
other) ... that&
For the
not cellboard[0] in cellboard[1:8] (I knew about ranges/slicing using a
colon, can't believe I didn't think of that!)
line, will I have to write that out for each number?
So the line:
not cellboard in ((cellboard[1:8]) and (cellboard[9] and cellboard[18]
and cellboard[27] and
How do I 'define' set? Is there something to include (like import
random)?
while (choice == 3) and len(set(cellboard[0:8]))==len(cellboard[0:8]):
# DEFINE TWO RANDOM VARIABLES (ONE FOR ARRAY, ONE FOR NUMBER
VALUE)
solvingrandom = random.randint(1,9)
cellboardrandom = rando
Is there some command in python so that I can read a key's input and
then use a gotoxy() function to move the cursor on screen? e.g.:
(psuedo-code)
When the right arrow is pushed, cursor gotoxy(x+1,y)
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks -- I downloaded WConio.
When I just tried it out in the IDLE, it said:
NameError: name 'WConio' is not defined
I assume I have to use a header somewhere (import WConio ?). Or is
there something I'm missing (I downloaded the Python 2.4 (I have 2.4.2)
auto installer and it ran fine...)
--
OK - I added the import WConio line. But when I run
import WConio
print "going to x10,y10..."
WConio.gotoxy(10,10)
print "Done"
the above, I get the following error:
WConio.gotoxy(10,10)
error: GetConOut Failed
I installed the WConio to the ../site-packages/ folder in Python24, and
when it did
Now that I have gotoxy() down for moving the cursor around, I want that
to be a result of keypresses (namely from the numpad -- 7 = NorthWest,
8 = North, 9 = NE, etc...). I have little clue how to do this. After
searching google, I've come upon this; include:
import curses
in the h
I'm having a problem with logging. I have an older app that used the
RotatingFileHandler before it became part of the main distribution (I
guess in 2.3).
It worked fine then. Now I get:
[EMAIL PROTECTED] bin]# ./mplayer.py file://test.avi
//test.avi
Traceback (most recent call last):
ocked so
other processes cannot write to it? And what happens if two or more
processes attempt to log an event at the same time?
Here's my situation. I have two or three workstations that will log an
event (the playing of a movie). The log file is NFS mounted and all
workstations will use th
On Fri, 03 Dec 2004 09:40:07 +, Vinay Sajip wrote:
> Of course, you should not normally be calling emit() from user code. The
> correct approach is to log events to loggers, and not emit them to
> handlers directly.
Thanks, I finally got that figured out. Lots changed between t
can someone please explain why the following works, in contrast to the second
example?
def decorator(func):
def on_call(*args):
print args
return func(args)
return on_call
class Foo:
@decorator
def bar(self, param1):
print 'inside bar'
f=Foo()
f.bar(4)
In other words, nobody wants to do your homework for you. Your fault for being
a lazy POS and doing everything last minute.
--
https://mail.python.org/mailman/listinfo/python-list
EVOLUTION IS IN
FREE-FALL.
>
RICHARD LEAKEY HAS DIED FROM A HEART ATTACK DUE TO THIS GROUND-BREAKING FIND
THAT CONCLUSIVELY SHOWS THAT HUMANS HAVE ORIGINS IN THE DEVONIAN.
>
NOW, IF YOU PLEASE, I HAVE TO SUE THE SMITHSONIAN FOR YEARS OF CENSORSHIP.
>
==
==
> BREAKING NEWS
==
>
RICHARD LEAKEY RECENTLY SENT TO PRISON AFTER BEING CAUGHT SCAMMING
MILLIONS OF YOUNG PEOPLE INTO THE SCAM OF EVOLUTION.
>
THRINAXODON, WHO WAS THE LEAD PROSECUTOR SAID THIS TO THE NY TIMES:
It strikes me s
IMHO,
What I learned with the time and of course with books =) :
Python gives you rapid turnaround. You can try different approaches and
archictetures to solve the problem in much faster way than you would
with C++.
When you really need to crunch numbers, and numpy/othermodule is not
enough for
http://jessicasboobs.blogspot.com/ - Download snazzy jessica images (I
bet you will find her naked)
--
http://mail.python.org/mailman/listinfo/python-list
http://britneyboobs.blogspot.com/2007/05/britney-spears-slips-up-again-exposes.html
- Exclusive pics of Britney Spears..
--
http://mail.python.org/mailman/listinfo/python-list
from Python. Can it be done?
>
> Thanks, Mark
Your best bet will be to create a C library callable from Python to do it
for you. There may be such a beast in existence already, but it should not
be hard at all to do, given the simplicity of the requirements.
--
-- Fred of UrlBit.Us
--
http://www.talkorigins.org/
>
Vs
>
http://www.trueorigin.org/
>
WHICH ONE'S TRUE?
>
This one!:
http://www.trueorigin.org/
--
Thrinaxodon, The Ultimate Defender of USENET
--
https://mail.python.org/mailman/listinfo/python-list
Dear list,
As many of you know, SEI/CERT maintains a set of secure coding standards
for many languages like C/C++, Java and Perl:
SEI CERT Coding Standards
https://wiki.sei.cmu.edu/confluence/display/seccode/SEI+CERT+Coding+Standards
I'm looking for something similar, but with spe
links to good coding style practices (also
important, of course) than actual secure coding advice, IMHO.
For example, any idiom or library you would recommend for input validation?
[potentially malicious input from the cmdline arguments, Unix environment,
network socket, etc]
Thanks again,
--
Kor
Subject: LOCAL NYC - UNIGROUP 17-FEB-2005 (Thurs): ZOPE - Open Source Web
Development
Unigroup's February 2005 meeting is THIS Thursday...
=
UNIGROUP OF NEW YORK - UNIX USERS GROUP - FEBRUARY 2005 ANNOUNCE
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> There is a discussion about "Python Moving into the Enterprise" on
> Slashdot:
>
> http://it.slashdot.org/it/05/04/03/0715209.shtml?tid=156&tid=8
Using dejanews as a proxy to measure the meme prop
==
>BREAKING NEWS
==
>
THRINAXODON JUST BEAT RICHARD LEAKEY 100-0 IN WORLD SCIENCE
CHAMPIONSHIP. LEAKEY WAS TRYING WITH ALL HIS MIGHT TO PROVE HUMAN'S
QUATERNARY ORIGINS, BUT THRINAXODON DEFEATED HIM WITH A FEW HUMAN
DEVONIAN FOSSILS.
>
THE FOSSILS WERE EXACT,
HUMAN FOSSILS FROM DEVONIAN STRATA IN GREENLAND.
>
ONE OF THEM WAS A NICE KNEECAP.
>
THE MOST BEAUTIFUL KNEECAP EVER DISCOVERED.
>
I CALLED OUT CARTER N.
>
CARTER CAME RUSHING OVER. WE TOOK THE KNEECAP FROM THE INUIT SAVAGES AND FLEW
TO THE SMITHSONIAN.
>
THEY CALLED
GLOBAL INSTITUTE OF BIOTECHNOLOGY
( A unit of SVS Education Society, Regn No 1640 of 2005, Govt.A.P.)
3-6-276/2, Sai Triveni Chambers, Above Mahesh Bank, Hyderabad, A.P.
ABOUT OURSELVES
Global Institute of Biotechnology in its short span of existence for a
period of Three years has emerged as a
GLOBAL INSTITUTE OF BIOTECHNOLOGY
( A unit of SVS Education Society, Regn No 1640 of 2005, Govt.A.P.)
3-6-276/2, Sai Triveni Chambers, Above Mahesh Bank, Hyderabad, A.P.
ABOUT OURSELVES
Global Institute of Biotechnology in its short span of existence for a
period of Three years has emerged as a
>>> b=dict.fromkeys(a)
--
http://mail.python.org/mailman/listinfo/python-list
==
>BREAKING NEWS
==
>
SMITHSONIAN FINALLY SHUT DOWN AFTER YEARS OF CENSORSHIP, SCAMS AND CON
ARTISTRY.
>
THRINAXODON BLEW DOWN THE BUILDINGS, LIT IT ON FIRE AND HAD THE ASSHOLES
ARRESTED.
>
R. DAWKINS WAS THROWN IN THE DOGHOUSE, ONLY TO GET KILLED BY ANGRY
Delhi Institute of Management & Services
Dear friends,
We are extremely happy to welcome you to the world of Management... We
are in the process of preparing some 5 minutes revision Q & A type
lessons for management students. They are in no way, a replacement for
the classroom
Delhi Institute of Management & Services
Dear friends,
We are extremely happy to welcome you to the world of Management... We
are in the process of preparing some 5 minutes revision Q & A type
lessons for management students. They are in no way, a replacement for
the classroom lectures, t
Your message dated Thu, 20 Oct 2005 11:18:37 +0900 with subject "Returned
mail: see transcript for details" has been submitted to the moderator of the
ICTLIST list: Cynthia Smith <[EMAIL PROTECTED]>.
--
http://mail.python.org/mailman/listinfo/python-list
Your message dated Mon, 25 Jul 2005 14:21:50 +0200 with subject "Status" has
beensubmittedtothemoderatoroftheVMESA-Llist:
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
This message was sent to [python-list@python.org]. Unsubscribe If you cannot read it, please click here. Special Issue on "Software Development Tools" Submission Deadline: February 19th, 2014Dear ,Journal of Software Engineering and Applications (JSEA) is seeking papers for the upcomi
@gmx.com) ADVANCED IN EXTREMELY PERFECT WAY THE CONTINUOUS
WALL STREET CRASH OF 1987 ( AS SAID.. AT THAT TIME HE WAS, MORE OR LESS, JUST
20 YEARS OLD)! AS THE ONE OF 2007, 2008 AND BEGINNING OF 2009 WITH "JUST" 1 AND
HALF YEAR OF INCREDIBLY WINNING FORETASTE! GENIUS, KING MIDAS, CIVIL H
handle. I want to be able to handle the start tags of any and
all tags, like how one would do in the Xerces C++ XML parser. In other
words, I would like a simple start() method that is called whenever any tag
is encountered. How may I do this?
Thank you...
--
http://mail.python.o
"Just Another Victim of the Ambient Morality" <[EMAIL PROTECTED]> wrote
in message news:[EMAIL PROTECTED]
>I'm trying to parse HTML in a very generic way.
>So far, I'm using SGMLParser in the sgmllib module. The problem is
> that it forces you to pars
"Just Another Victim of the Ambient Morality" <[EMAIL PROTECTED]> wrote
in message news:[EMAIL PROTECTED]
>
>Okay, I think I found what I'm looking for in HTMLParser in the
> HTMLParser module.
Except it appears to be buggy or, at least, not very robust.
I need a red-black tree in Python and I was wondering if there was one
built in or if there's a good implementation out there. Something that,
lets face it, does whatever the C++ std::map<> allows you to do...
Thank you...
--
http://mail.python.org/mailman/listinfo/python-list
I can't seem to get VideoCapture (http://videocapture.sourceforge.net/)
to work with my version of Python (2.5). Why is that? I've followed the
instructions which made it look easy but, as it happens all too often, it
simply doesn't work. The error I get is that the .py
uplicate this behaviour? Is it a bug?
These are serious problems for me and I would greatly appreciate a
deeper understanding of these issues.
Thank you...
--
http://mail.python.org/mailman/listinfo/python-list
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Just Another Victim of the Ambient Morality schrieb:
>> HTMLParser is behaving in, what I find to be, strange ways and I
>> would like to better understand what it is doing and w
I'm trying to parse with pyparsing but the grammar I'm using is somewhat
unorthodox. I need to be able to parse something like the following:
UPPER CASE WORDS And Title Like Words
...into two sentences:
UPPER CASE WORDS
And Title Like Words
I'm finding this surprisingly hard to do
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Oct 22, 4:18 am, "Just Another Victim of the Ambient Morality"
> <[EMAIL PROTECTED]> wrote:
>> I'm trying to parse with pyparsing but the grammar I'm usin
Is there a Python library to communicate with a usenet server? I did a
bit of googling and found some sites that suggest that you can roll your own
fairly easily but, mostly, I got a lot of false positives with talk of
Python libraries on usenet and I am really hoping this work has already
Is pyparsing really a recursive descent parser? I ask this because
there are grammars it can't parse that my recursive descent parser would
parse, should I have written one. For instance:
from pyparsing import *
grammar = OneOrMore(Word(alphas)) + Literal('end')
grammar.parseString('Firs
"Grant Edwards" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2007-10-30, Just Another Victim of the Ambient Morality
> <[EMAIL PROTECTED]> wrote:
>
>> Is there a Python library to communicate with a usenet server?
>
> Which protoc
a way to get pyparsing to parse a grammar like this?
>>
>> Negative lookahead maybe:
>>
>> grammar = (OneOrMore(NotAny(Literal('end')) + Word(alphas))
>>+ Literal('end'))
>>
>> Ciao,
>> Marc 'BlackJack' Rin
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Nov 3, 12:33 am, "Just Another Victim of the Ambient Morality"
> <[EMAIL PROTECTED]> wrote:
>> It has recursion in it but that's not sufficient to call it a
>
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2007-11-03, Paul McGuire <[EMAIL PROTECTED]> wrote:
>> On Nov 3, 12:33 am, "Just Another Victim of the Ambient Morality"
>><[EMAIL PROTECTED]> wrote:
>>>
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2007-11-04, Just Another Victim of the Ambient Morality
> <[EMAIL PROTECTED]> wrote:
>>
>> "Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
>> n
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2007-11-04, Just Another Victim of the Ambient Morality
> <[EMAIL PROTECTED]> wrote:
>>> Consider writing a recursive decent parser by hand to parse
>>> the l
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2007-11-04, Just Another Victim of the Ambient Morality
> <[EMAIL PROTECTED]> wrote:
>> "Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
>> news:[EMAIL PR
"Kay Schluehr" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Nov 4, 10:44 pm, "Just Another Victim of the Ambient Morality"
> <[EMAIL PROTECTED]>
>
>> I believe there is a cure and it's called recursive descent parsing.
>
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2007-11-05, Just Another Victim of the Ambient Morality
> <[EMAIL PROTECTED]> wrote:
>>
>> "Kay Schluehr" <[EMAIL PROTECTED]> wrote in message
>> news:
How do you change certain elements in a list? I'm looking to do the
Python equivalent of this Ruby code:
-> first = [1, 2]
=> [1, 2]
-> second = first
=> [1, 2]
-> first.map! {|i| i + 1}
=> [2, 3]
-> first
=> [2, 3]
-> second
=> [2, 3]
I
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2007-11-05, Just Another Victim of the Ambient Morality
> <[EMAIL PROTECTED]> wrote:
>> "Kay Schluehr" <[EMAIL PROTECTED]> wrote in message
>> news:[EMAIL PRO
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2007-11-07, Just Another Victim of the Ambient Morality
> <[EMAIL PROTECTED]> wrote:
>> "Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
>> news:[EMAIL PRO
"Chris Mellon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Nov 7, 2007 3:15 PM, Just Another Victim of the Ambient Morality
> <[EMAIL PROTECTED]> wrote:
>
>> > In short, it hasn't really evovled into a user-friendly package
&g
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Wed, 07 Nov 2007 21:15:50 +0000, Just Another Victim of the Ambient
> Morality wrote:
>
>> Why can't I find a pyparsing-esque library with this implementation?
>>
"Chris Mellon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Nov 7, 2007 5:15 PM, Just Another Victim of the Ambient Morality
> <[EMAIL PROTECTED]> wrote:
>>
>> "Chris Mellon" <[EMAIL PROTECTED]> wrote in message
>
I've done a google search on this but, amazingly, I'm the first guy to
ever need this! Everyone else seems to need the reverse of this. Actually,
I did find some people who complained about this and rolled their own
solution but I refuse to believe that Python doesn't
This won't compile for me:
regex = re.compile('(.*\\).*')
I get the error:
sre_constants.error: unbalanced parenthesis
I'm running Python 2.5 on WinXP. I've tried this expression with
another RE engine in another language and it works just fine which leads me
to believe the p
"Paul Hankin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Nov 27, 3:48 pm, "Just Another Victim of the Ambient Morality"
> <[EMAIL PROTECTED]> wrote:
>> This won't compile for me:
>>
>> regex = re.compile(
It may sound like a strange question but that's probably only because I
don't know the proper terminology. I have an iterable object, like a list,
and I want to perform a transform on it (do an operation on each of the
elements) and then pass it onto something else that e
I'm looking for a linked list implementation. Something iterable with
constant time insertion anywhere in the list. I was wondering if deque() is
the class to use or if there's something else. Is there?
Thank you...
--
http://mail.python.org/mailman/listinfo/python-list
ks like the MySQLdb version doesn't match the _mysql version. If
these were two different libraries, I might understand how this error
happened. However, they're part of the same library. _mysql is just a
Python binding to the MySQL C API and MySQLdb is just a Python wrapper
arou
I'm confused by this behaviour:
import re
regex = re.compile('foo')
match = regex.match('whatfooever')
In my experience with regular expressions, regex should have found a
match. However, in this case regex.match() returns None. Why is that?
What am I missing?
Thank you...
-
tiful Soup?
Has there been any word on Mechanize?
What about DB?
PIL would be nice, too, now that I think about it.
Anyway, I'd love to hear some news about any of these things in
particular or even anything in general. Am I the only one who's psyched for
this version of P
ty living with.
>
> I don't like arbitrary symbols. Most people don't -- that's why "line
> noise" is unpopular. It's hard to read, hard to write, hard to maintain,
> and hard to talk about. The more line-noise, the worse the language.
It's not &quo
I'm desperately trying to declare an adjacency list table with
declarative_base() but I can't figure it out. Strangely, all the
documentation avoids declarative_base() like the plague and does everything
the hard way. What the hell is this thing for if we're not supposed to use
it?
If
80 matches
Mail list logo