Hi,
I am working one tool, which will do compile/run the workspace (that code
is written on c/c++). on that my requirment is i need to compile subfolder
also, i have wrote code for that also.
My problem is , i am unable to write the Unit test case for that. Since
my method (called run_subfolder)
On Fri, 22 Feb 2013 13:37:20 -0800, piterrr.dolinski wrote:
> Today I learned the hard way that all function parameters in Python are
> passed by reference (meaning whatever happens to them inside a function,
> new values are always passed to caller). Not good.
Today you learned wrong.
This is a
On 23/02/2013 02:40, Mitya Sirenef wrote:
On 02/22/2013 09:18 PM, Chris Angelico wrote:
On Sat, Feb 23, 2013 at 1:02 PM, Steven D'Aprano
> wrote:
>> On Fri, 22 Feb 2013 20:47:20 -0500, Mitya Sirenef wrote:
>>
>>> It's been used for many important projects by a huge number of big
>>> comp
Hello
one problem, thanks for help
My script like this:
/hostname = xxx//
//username = xxx//
//password = xxx//
//t = paramiko.Transport((hostname, 22))//
//t.connect(username=username, password=password)//# here will be blocked
//sftp = paramiko.SFTPClient.from_transport(t)/
I used gdb attach th
On Friday, February 22, 2013 6:04:21 PM UTC-7, Terry Reedy wrote:
>[...] the first 'killer app' for Python was nuclear weapon calculations...
Gives a whole new meaning to the phrase "killer app", doesn't it?
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, Feb 23, 2013 at 1:40 PM, Mitya Sirenef wrote:
> It's also worth noting that if there's a new language that is somewhat
> better than all established languages, but not to the extent that it
> will ever replace them (because of network effects), it's not really
> better for any practical pu
On 02/22/2013 09:18 PM, Chris Angelico wrote:
On Sat, Feb 23, 2013 at 1:02 PM, Steven D'Aprano
> wrote:
>> On Fri, 22 Feb 2013 20:47:20 -0500, Mitya Sirenef wrote:
>>
>>> It's been used for many important projects by a huge number of big
>>> companies:
>>>
>>> http://www.python.org/about/succe
On Sat, Feb 23, 2013 at 1:02 PM, Steven D'Aprano
wrote:
> On Fri, 22 Feb 2013 20:47:20 -0500, Mitya Sirenef wrote:
>
>> It's been used for many important projects by a huge number of big
>> companies:
>>
>> http://www.python.org/about/success/
>>
>> Unlike Java and C#, it's not backed by a marketi
On 22/02/2013 16:29, Timothy Madden wrote:
Hello
I am trying to write a DBGp client in python, to be used for debugging
mostly php scripts.
Currently the XDebug module for php allows me to set breakpoints on any
line, include blank ones and lines that are not considered executable,
resulting in
On Fri, 22 Feb 2013 20:47:20 -0500, Mitya Sirenef wrote:
> It's been used for many important projects by a huge number of big
> companies:
>
> http://www.python.org/about/success/
>
> Unlike Java and C#, it's not backed by a marketing effort of a large
> company, so its success is entirely due t
On 02/22/2013 04:37 PM, piterrr.dolin...@gmail.com wrote:
Thanks to everyone for all the posts, some friendly some not. I read all of
them with genuine interest.
>
> So I am continuing to learn Python, here are my new observations for
your consideration.
>
> There seems to be a "heated" argu
On Friday, February 22, 2013 11:29:42 AM UTC-5, Timothy Madden wrote:
> Hello
>
>
>
> I am trying to write a DBGp client in python, to be used for debugging
>
> mostly php scripts.
>
>
>
> Currently the XDebug module for php allows me to set breakpoints on any
>
> line, include blank ones
On 02/22/2013 06:58 AM, Rui Maciel wrote:
Mitya Sirenef wrote:
>
>> Looks very unclear and confusing to me. Whether it's C# or ruby or
>> anything else, most devs don't indent like that;
>
> The Go programming language makes that style mandatory.
>
>
> Rui Maciel
I was referring to different i
On 2/22/2013 4:37 PM, piterrr.dolin...@gmail.com wrote:
Yours is the first post here, that I know of, from someone 'forced' to
learn and use Python at their job. Several people have instead
complained about being prohibited from using Python at work. I am sorry
that you have been introduced to
On Sat, Feb 23, 2013 at 11:20 AM, Dennis Lee Bieber
wrote:
> Problem: SQLite3 (and M$ JET/Access) are considered "file server"
> databases. Each instance of the program accessing the database is
> directly opening the database file(s). While SQLite3 has a fairly
> complex locking system, t
On Sat, Feb 23, 2013 at 10:36 AM, Xx7 wrote:
> Listview example in a GUI
Sounds to me like you may be talking about GTK, but I'm not 100% sure
there. You really need to give a LOT more information. Actually,
you'll probably find that Google Search has crystal balls every bit as
good as ours; if y
On Sat, Feb 23, 2013 at 11:03 AM, Steven D'Aprano
wrote:
> On Sat, 23 Feb 2013 01:05:15 +1100, Chris Angelico wrote:
>
>> Or else golang.org is wrong. That's certainly possible, but you know
>> what they say about extraordinary claims.
>
> They must be true?
>
> "Extraordinary claims are always tr
On Sat, Feb 23, 2013 at 10:38 AM, wrote:
> I think this obvious shortcomming is the main reason that, for example, when
> x holds the value of 5, x is considered to be "true". You see, I have to
> maintain Python files (ubuntu server scripts) which are 2000 lines long, all
> sequential code, n
On Fri, 22 Feb 2013 18:29:42 +0200, Timothy Madden wrote:
[...]
> For that I would like to write a php parser, in order to detect the
> proper breakpoints line for statements spanning multiple lines.
>
> Is there an (open-source) way to do to this in python code ?
Try pyparsing:
http://pyparsi
On Sat, 23 Feb 2013 01:05:15 +1100, Chris Angelico wrote:
> Or else golang.org is wrong. That's certainly possible, but you know
> what they say about extraordinary claims.
They must be true?
"Extraordinary claims are always true" would be an extraordinary claim,
and therefore true. I learned t
On 2/22/2013 6:36 PM, Xx7 wrote:
Listview example in a GUI
The documentation for each GUI framework should have an example for each
of its widgets. Specific questions about any framework other than tk
access though tkinter are probably best directed to framework-specific
mailing lists.
--
Hi Ian,
Thanks for typing all this for me. Really useful. I did some googling of my own
and I found that there was no concept of boolean in older versions of Python
like you said. (BTW, how does this omission go well with proper language
design, as Oscar seems to have hinted?) I think this obvi
On 02/22/2013 02:49 PM, Monte Milanuk wrote:
> Web2py does seem pretty attractive in that it seems to come with a lot
> of functionality rolled in already. It seems to be pretty easy to
> deploy... since this would be more of a case where the volunteer match
> directors are not necessarily comp
Listview example in a GUI
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-02-22 22:53, James Harris wrote:
On Feb 22, 6:40 pm, Zachary Ware
wrote:
On Fri, Feb 22, 2013 at 12:16 PM, Walter Hurry wrote:
> I use FreeBSD or Linux, but my son is learning Python and is using
> Windows.
> My question is this: Would it be good practice for him to put #!/usr/bin
On Feb 22, 6:40 pm, Zachary Ware
wrote:
> On Fri, Feb 22, 2013 at 12:16 PM, Walter Hurry
> wrote:
> > I use FreeBSD or Linux, but my son is learning Python and is using
> > Windows.
>
> > My question is this: Would it be good practice for him to put #!/usr/bin/
> > env python at the top of his
On Fri, Feb 22, 2013 at 2:37 PM, wrote:
> There seems to be a "heated" argument about Python's apparently intentional
> ambiguity in conditional statements. Specifically, the issue is, is it more
> appropriate to write (as an example)
>
> if (some statement):# short form
>
> rather
On 2/22/2013 1:03 PM, Xx7 wrote:
Hi, could somebody possibly provide a basic listview example? thanks!
Hi, could you possibly explain what you mean by listview? thanks!
(There is no such class that I know of.)
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
On 2/22/2013 4:35 AM, Wolfgang Maier wrote:
Dear all,
I am wondering what the rules are that determine whether a built-in type is
subclassable or not.
As examples, why can you base your classes on int or set,
but not on bool or range?
Also: can you use introspection to find out whether a type is
On 22 February 2013 21:37, wrote:
> Thanks to everyone for all the posts, some friendly some not. I read all of
> them with genuine interest.
>
> So I am continuing to learn Python, here are my new observations for your
> consideration.
>
> There seems to be a "heated" argument about Python's a
On 02/22/2013 08:57 AM, Alec Taylor wrote:
Monte: I noticed you mentioned web2py; that would be my recommendation.
You also mention different features being available to different
users; perfect use-case for web2py's built-in RBAC.
Scalability: Go with Postgres, MySQL; or considering how much d
Thanks to everyone for all the posts, some friendly some not. I read all of
them with genuine interest.
So I am continuing to learn Python, here are my new observations for your
consideration.
There seems to be a "heated" argument about Python's apparently intentional
ambiguity in conditional
On 22 February 2013 13:04, Andrew Robinson wrote:
>
> How would you get an interpreter thread to check for a shutdown request
> every N cycles?
> I've read about how to set a timeout based on time, but not on any kind of
> cycle (eg: instruction cycle?) count.
>
> Do you have a python example?
wh
On Fri, Feb 22, 2013 at 6:04 AM, Andrew Robinson
wrote:
> It's still surprising that even C# would allow a killing of threads.
>
> Resources can be allocated by a thread and tied up was one of the comments
> made on the site I linked; so those resources could be permanently tied up
> until process
On 02/22/2013 08:23 PM, Ian Kelly wrote:
On Fri, Feb 22, 2013 at 5:09 AM, Andrew Robinson
wrote:
On 02/22/2013 07:21 PM, Ian Kelly wrote:
I am curious about how he deals with infinite loops in the generated
programs. Probably he just kills the threads after they pass some
time threshold?
I'm
On Fri, Feb 22, 2013 at 5:09 AM, Andrew Robinson
wrote:
> On 02/22/2013 07:21 PM, Ian Kelly wrote:
>> I am curious about how he deals with infinite loops in the generated
>> programs. Probably he just kills the threads after they pass some
>> time threshold?
>
> I'm under the impression that Pyth
On 02/22/2013 07:21 PM, Ian Kelly wrote:
On Fri, Feb 22, 2013 at 4:41 AM, Chris Angelico wrote:
That's not artificial intelligence, though. It's artificial program
generation based on a known target output. The "Fitness" calculation
is based on a specific target string. This is fine for devisin
On Fri, Feb 22, 2013 at 4:41 AM, Chris Angelico wrote:
> That's not artificial intelligence, though. It's artificial program
> generation based on a known target output. The "Fitness" calculation
> is based on a specific target string. This is fine for devising a
> program that will produce the en
On 02/22/2013 01:27 PM, Morten Engvoldsen wrote:
Hi,
Just to make it more clear: I am looking for how to generate the weight in :
1, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7.. format for any
length of number instead of
weights = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2, 1]
only for fixed digi
On Fri, Feb 22, 2013 at 11:27 AM, Morten Engvoldsen
wrote:
> Hi,
> Just to make it more clear: I am looking for how to generate the weight in :
> 1, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7.. format for any
> length of number instead of
>
> weights = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2, 1]
On Fri, Feb 22, 2013 at 12:16 PM, Walter Hurry wrote:
> I use FreeBSD or Linux, but my son is learning Python and is using
> Windows.
>
> My question is this: Would it be good practice for him to put #!/usr/bin/
> env python at the top of his scripts, so that if made executable on *nix
> they will
On 02/22/2013 01:16 PM, Walter Hurry wrote:
I use FreeBSD or Linux, but my son is learning Python and is using
Windows.
My question is this: Would it be good practice for him to put #!/usr/bin/
env python at the top of his scripts, so that if made executable on *nix
they will be OK? As I underst
Hi,
Just to make it more clear: I am looking for how to generate the weight in :
1, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7.. format for any
length of number instead of
weights = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2, 1]
only for fixed digit.
My below code can check only for 9 digit, so if
I use FreeBSD or Linux, but my son is learning Python and is using
Windows.
My question is this: Would it be good practice for him to put #!/usr/bin/
env python at the top of his scripts, so that if made executable on *nix
they will be OK? As I understand it this will have no effect on Windows
Τη Παρασκευή, 22 Φεβρουαρίου 2013 7:38:47 μ.μ. UTC+2, ο χρήστης Ferrous Cranus
έγραψε:
> Τη Παρασκευή, 22 Φεβρουαρίου 2013 5:25:41 μ.μ. UTC+2, ο χρήστης Lele Gaifax
> έγραψε:
>
> > Ferrous Cranus writes:
>
> >
>
> >
>
> >
>
> > > but the try: solution is much more less hassle.
>
> >
>
Τη Παρασκευή, 22 Φεβρουαρίου 2013 5:25:41 μ.μ. UTC+2, ο χρήστης Lele Gaifax
έγραψε:
> Ferrous Cranus writes:
>
>
>
> > but the try: solution is much more less hassle.
>
>
>
> ... not to mention it is more effective than your simplicistic check :-)
>
>
>
> ciao, lele.
>
> --
>
> nickna
On 2013-02-22 14:55, Hala Gamal wrote:
my code works well with english file but when i use text file encodede"utf-8" "my
file contain some arabic letters" it doesn't work.
my code:
# encoding: utf-8
from whoosh import fields, index
import os.path
import re,string
import codecs
from whoosh.qparse
Hi,
My below code is wrong :
elif mod == 11:
>> if not len(checknum)!= 11:
>> return False
>> weights = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2, 1]
>> return (sum(w * int(x) for w, x in zip(weights, checknum)) % 11)
==0
it works for 9 digit number , not 11 digit number,
On Fri, Feb 22, 2013 at 12:00 PM, Christian Heimes wrote:
> Am 22.02.2013 10:35, schrieb Wolfgang Maier:
>> Also: can you use introspection to find out whether a type is valid as a
>> base type?
>
> I don't think so. For CPython the information is stored in the type's
> structure. When type->tp_fl
[snip]
> As for which version if Python, I have been using Python 2 to learn on
> as I heard that Python 3 was still largely unadopted due to a lack of
> library support etc... by comparison. Are people adopting it fast
> enough now that I should consider learning on 3 instead of 2?
>
[snip]
You s
On 02/22/2013 12:09 AM, qoresu...@gmail.com wrote:
Initially I was just trying the html, but later when I attempted more
complicated sites that weren't my own I noticed that large bulks of the site
were lost in the process. The urllib code essentially looks like what I was
trying but it didn't
Monte: I noticed you mentioned web2py; that would be my recommendation.
You also mention different features being available to different
users; perfect use-case for web2py's built-in RBAC.
Scalability: Go with Postgres, MySQL; or considering how much data
you're talking about, even SQLite would b
Yes, I am looking at a database-centric application. I know that the
'larger' databases such as PostgreSQL, MySQL, etc. would not have any
problem handling that small amount of traffic.
My concern is that using postgres or mysql for this would be akin to
using a sledgehammer to swat a fly, wh
Hi,
Just to clear the confusion: i am talking about below part of my code:
elif mod == 11:
>> if not len(checknum)!= 11:
>> return False
>> weights = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2, 1]
>> return (sum(w * int(x) for w, x in zip(weights, checknum)) % 11)
==0
for w
On Sat, Feb 23, 2013 at 3:29 AM, Timothy Madden wrote:
> For that I would like to write a php parser, in order to detect the proper
> breakpoints line for statements spanning multiple lines.
Are you able to drop to PHP itself for that? It makes its own lexer
available to user-code:
http://php.ne
Hi,
Thanks for your reply.
Here in your code i think you didn't multiply the given number with the
weight i have mentioned. The each digit of the given number should
multiply with weight ...4,3,2,7,6, 5, 4, 3, 2, 7, 6, 5, 4, 3,2,
1 in this format. That is in detail:
To verify the nu
Hello
I am trying to write a DBGp client in python, to be used for debugging
mostly php scripts.
Currently the XDebug module for php allows me to set breakpoints on any
line, include blank ones and lines that are not considered executable,
resulting in breakpoints that will never be hit, eve
On 2013-02-22 07:07, Ferrous Cranus wrote:
> Actually it can, but instead of try: i have to create a function:
>
> def is_sane_date(date):
> parts = [int(part) for part in date.split() if part.isdigit()]
> if len(parts) == 3 and \
> 1 <= parts[0] <= 31 and \
> 1 <= parts[
> I've been working at learning python off and on now for a while, with
> a couple programs in mind as a goal - kind of specialized stuff that
> I can't seem to find a good match for already available, competitor
> records, score-keeping & results for an amateur sports tournament.
So you want to
Hi,
One problem, thanks for help.
import gevent.monkey
gevent.monkey.match_all()
from lxml import etree
# I using xpath parse the html
def _get(p):
url = BUILD_URL(p)
html = urllib2.urlopen(url)
# RUN AT HERE AND BLOCKING
# ver1
tree = etree.parse(html, parse)
# ver
Hala Gamal wrote:
> my code works well with english file but when i use text file
> encodede"utf-8" "my file contain some arabic letters" it doesn't work. my
> code:
> with codecs.open("tt.txt",encoding='utf-8') as txtfile:
Try encoding="utf-8-sig" in the above to remove the byte order mark (B
Whoops, my mistake:
In [5]: [not len(x) >= 2 and len(x)<=25 for x in [str(y) for y in xrange(30)]]
Out [5]: [True]*10, [False]*20
But still, I'm guessing that's not the result you were looking for…
On Sat, Feb 23, 2013 at 2:30 AM, Alec Taylor wrote:
> Out[1]: '0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Out[1]: '0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
24 25 26 27 28 29'
In [2]: [not len(x) >= 2 and len(x)<=25 for x in _]
Out[2]: [True]*79 # shorthand to prevent spam
I trust you can see the error now!
On Sat, Feb 23, 2013 at 2:09 AM, Morten Engvoldsen wrote:
> Hi ,
> I ha
Ferrous Cranus writes:
> but the try: solution is much more less hassle.
... not to mention it is more effective than your simplicistic check :-)
ciao, lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l
On 2013-02-22, Gisle Vanem wrote:
> Disregarding the probability math in the above, the question
> IMHO boils down to whether "art can be produced by accident"
> (quote from above). I seems to recall elephant painting selling
> for lots of dollars some years ago. And long dull poems written
> by c
Τη Παρασκευή, 22 Φεβρουαρίου 2013 3:35:31 μ.μ. UTC+2, ο χρήστης Lele Gaifax
έγραψε:
> Ferrous Cranus writes:
>
>
>
> > Let me ask it like this:
>
> > How can i avoid using try: except: for checkign the date but instead check
> > it with an if statement:
>
>
>
> Let me answer this way: you
Hi ,
I have wrote the below code to validate a number using modulus 10 and 11:
def is_valid_number(checknum, mod):
if mod == 10:
if not len(checknum) >= 2 and len(checknum) <=25:
return False
number = tuple(int(i) for i in reversed(str(checknum)) )
return (s
On Sat, Feb 23, 2013 at 1:45 AM, Steve Simmons wrote:
> Oooh, this is making my head spin. Are you saying that the OP's question
> about proper indentation has resulted in an incorrectly answered post due to
> poor indentation of a reference to the indentation of another reference?
...
Steve Simmons wrote:
>
> On 22/02/2013 15:26, Duncan Booth wrote:
>> Rui Maciel wrote:
>>
>>> Chris Angelico wrote:
>>>
On Fri, Feb 22, 2013 at 10:58 PM, Rui Maciel
wrote:
> Mitya Sirenef wrote:
>
>> Looks very unclear and confusing to me. Whether it's C# or ruby
>> o
my code works well with english file but when i use text file encodede"utf-8"
"my file contain some arabic letters" it doesn't work.
my code:
# encoding: utf-8
from whoosh import fields, index
import os.path
import re,string
import codecs
from whoosh.qparser import QueryParser
# This list associa
I made this to explore with the libraries requests, and docopt. Tell me what
you think, and if you see a bug make a git issue if you'd like.
https://github.com/jawerty/res
--
http://mail.python.org/mailman/listinfo/python-list
On 22/02/2013 15:26, Duncan Booth wrote:
Rui Maciel wrote:
Chris Angelico wrote:
On Fri, Feb 22, 2013 at 10:58 PM, Rui Maciel
wrote:
Mitya Sirenef wrote:
Looks very unclear and confusing to me. Whether it's C# or ruby or
anything else, most devs don't indent like that;
The Go programmi
Rui Maciel wrote:
> Chris Angelico wrote:
>
>> On Fri, Feb 22, 2013 at 10:58 PM, Rui Maciel
>> wrote:
>>> Mitya Sirenef wrote:
>>>
Looks very unclear and confusing to me. Whether it's C# or ruby or
anything else, most devs don't indent like that;
>>>
>>> The Go programming language m
Lele Gaifax wrote:
>Ferrous Cranus writes:
>
>> Let me ask it like this:
>> How can i avoid using try: except: for checkign the date but instead
>> check it with an if statement:
>
>Let me answer this way: you can't, without resorting to the simple
>helper functions I wrote in my previous message
On Sat, Feb 23, 2013 at 12:50 AM, Rui Maciel wrote:
> Chris Angelico wrote:
>
>> On Fri, Feb 22, 2013 at 10:58 PM, Rui Maciel wrote:
>>> Mitya Sirenef wrote:
>>>
Looks very unclear and confusing to me. Whether it's C# or ruby or
anything else, most devs don't indent like that;
>>>
>>> T
On Sat, Feb 23, 2013 at 12:35 AM, Lele Gaifax wrote:
> Ferrous Cranus writes:
>
>> Let me ask it like this:
>> How can i avoid using try: except: for checkign the date but instead check
>> it with an if statement:
>
> Let me answer this way: you can't, without resorting to the simple
> helper fu
- Original Message -
> I am having issues with the urllib and lxml.html modules.
> Here is my original code: import urllib import lxml . html
> down = 'http://v.163.com/special/visualizingdata/' file = urllib .
> urlopen ( down ). read () root = lxml . html . document_fromstring (
> file
Chris Angelico wrote:
> On Fri, Feb 22, 2013 at 10:58 PM, Rui Maciel wrote:
>> Mitya Sirenef wrote:
>>
>>> Looks very unclear and confusing to me. Whether it's C# or ruby or
>>> anything else, most devs don't indent like that;
>>
>> The Go programming language makes that style mandatory.
>
> [ci
Ferrous Cranus writes:
> Let me ask it like this:
> How can i avoid using try: except: for checkign the date but instead check it
> with an if statement:
Let me answer this way: you can't, without resorting to the simple
helper functions I wrote in my previous message.
Why do you dislike that
i made a liitle typo at the ned, i meant this:
if ( eval( datetime.strptime(date, '%d %m %Y') ) ):
date = datetime.strptime(date, '%d %m %Y').strftime('%Y-%m-%d')
else:
print( "Date wasn't entered properly" )
--
http://mail.python.org/mailman/listinfo/python-list
Τη Παρασκευή, 22 Φεβρουαρίου 2013 2:03:39 μ.μ. UTC+2, ο χρήστης Lele Gaifax
έγραψε:
> Ferrous Cranus writes:
>
>
>
> > I'am thinking if somehting like the follwoing work:
>
> >
>
> > if( task and ( price and price.isdigit() and price.__len__() <= 3 ) and (
> > date and eval( datetime.strpti
Hi anonymous,
your code is working perfectly right. It's just that the only time that
you find anything matching //div[@class="col f-cb"] is this one:
名称
视频下载
课程简介
And obviously, there's no in there, so the xpath won't match.
Cheers,
Philipp
On 02/22/2013 02:24 AM, python wrote
"Chris Angelico" wrote:
That's not artificial intelligence, though. It's artificial program
generation based on a known target output. The "Fitness" calculation
is based on a specific target string. This is fine for devising a
program that will produce the entire works of Shakespeare, since the
On Fri, Feb 22, 2013 at 10:58 PM, Rui Maciel wrote:
> Mitya Sirenef wrote:
>
>> Looks very unclear and confusing to me. Whether it's C# or ruby or
>> anything else, most devs don't indent like that;
>
> The Go programming language makes that style mandatory.
[citation needed]
What do you mean by
Mitya Sirenef wrote:
> Looks very unclear and confusing to me. Whether it's C# or ruby or
> anything else, most devs don't indent like that;
The Go programming language makes that style mandatory.
Rui Maciel
--
http://mail.python.org/mailman/listinfo/python-list
Ferrous Cranus writes:
> I'am thinking if somehting like the follwoing work:
>
> if( task and ( price and price.isdigit() and price.__len__() <= 3 ) and (
> date and eval( datetime.strptime(date, '%d %m %Y').strftime('%Y-%m-%d') ) ) ):
a) you should not (usually) call “dunder methods” directly,
> I'am thinking if somehting like the follwoing work:
>
> if( task and ( price and price.isdigit() and price.__len__() <= 3 ) and (
> date and eval( datetime.strptime(date, '%d %m %Y').strftime('%Y-%m-%d') ) ) ):
I just tried it out this workaround so to avoid having an extra try: except:
but
On 22.02.13 11:16, Steven D'Aprano wrote:
On Fri, 22 Feb 2013 08:23:27 +1100, Chris Angelico wrote:
and you can cast out 1's in binary to find out if it's a
multiple of 1, too.
O_o
I wanna see the numbers that aren't a multiple of 1.
What "to be a multiple of" means? If A is a multiple of B
On Fri, Feb 22, 2013 at 9:11 PM, Gisle Vanem wrote:
> Here is something interesting that you pythonistas might be
> interested in:
> http://www.primaryobjects.com/CMS/Article149.aspx
>
> """This article describes an experiment to produce an AI program, capable of
> developing its own programs, usi
Gisle Vanem wrote:
> Here is something interesting that you pythonistas might be
> interested in:
> http://www.primaryobjects.com/CMS/Article149.aspx
>
> """This article describes an experiment to produce an AI program,
> capable of
> developing its own programs, using a genetic algorithm
On Fri, Feb 22, 2013 at 10:05 PM, Steve Simmons wrote:
> I thank you for your post but I must complain in the strongest possible
> terms that it was not enclosed in the correct delimeters. It should have
> been enclosed in a ... pair (or ... if you
> are American).
Steve, you clearly do not un
Here is something interesting that you pythonistas might be
interested in:
http://www.primaryobjects.com/CMS/Article149.aspx
"""This article describes an experiment to produce an AI program, capable of
developing its own programs, using a genetic algorithm implementation with
self-modifyi
Dear Mr D'Aprano,
I thank you for your post but I must complain in the strongest possible
terms that it was not enclosed in the correct delimeters. It should
have been enclosed in a ... pair (or
... if you are American).
I was drinking coffee at the time I started reading your post and,
- Original Message -
> Hi Chris,
>
> Thanks for this. Regarding ambiguity, you will never find me write
> ambiguous code. I don't sabotage my own work. But the reality is
> that in addition to writing my own code, I have to maintain
> existing. I find it incredibly confusing then I see a s
On 22.02.13 07:57, Jason Friedman wrote:
Yep, that looks like a docs bug (it was probably copied straight in
from the 2.x docs). Nice and easy to fix, you could submit a patch
with the bug report and make the devs love you!
Done: http://bugs.python.org/issue17271.
Fixed. Thank you.
--
http:
Τη Παρασκευή, 22 Φεβρουαρίου 2013 8:20:20 π.μ. UTC+2, ο χρήστης
rob.mar...@gmail.com έγραψε:
> The datetime function: strptime() DOES check the date for validity. So try
> something like:
>
>
>
> from datetime import datetime
>
>
>
> def get_date():
>
> while True:
>
> try:
>
>
Am 22.02.2013 10:35, schrieb Wolfgang Maier:
> Also: can you use introspection to find out whether a type is valid as a
> base type?
I don't think so. For CPython the information is stored in the type's
structure. When type->tp_flags & Py_TPFLAGS_BASETYPE is true then
subclassing is allowed. But I
On Fri, 22 Feb 2013 09:35:25 +, Wolfgang Maier wrote:
> Dear all,
> I am wondering what the rules are that determine whether a built-in type
> is subclassable or not.
The type-designer thought it should, or shouldn't, be.
> As examples, why can you base your classes on int or set, but not o
Hi,
> I would like to stop the script running in response to a CTRL-C.
how about "KeyboardInterrupt"?
try:
...
except KeyboardInterrupt:
print "You pressed Ctrl+C"
Roland
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 19 Feb 2013 22:38:32 -0500, Terry Reedy wrote:
> On 2/18/2013 7:18 PM, Steven D'Aprano wrote:
>> Terry Reedy wrote:
>>
>>> On 2/18/2013 6:47 AM, John Reid wrote:
>>>
I was hoping namedtuples could be used as replacements for tuples
in all instances.
>>>
>>> This is a mistake in
1 - 100 of 107 matches
Mail list logo