On Fri, Jul 15, 2011 at 4:03 AM, Ellerbee, Edward wrote:
> for makenewlist in range(0,count):
> sortlist.append(npalist.pop(0) + nxxlist.pop(0))
This can alternatively be done with map():
sortlist = map(lambda x,y: x+y, npalist, nxxlist)
However, I'm not sure what your code is meant to do i
On Fri, Jul 15, 2011 at 11:32 AM, Steven D'Aprano
wrote:
> Inside wrote:
>
>> As telling in the subject,because "list" and "tuple" aren't functions,they
>> are types.Is that right?
>
> Yes they are types. But they can still be used as functions. Does it matter?
Python is duck-typed, even in its d
On Fri, Jul 15, 2011 at 8:34 AM, rantingrick wrote:
>
>
>
>
>
>
>
> That's it. Go ahead, try to prove me wrong!
>
Does MouseClick mean Mouse Button Down, or does it mean Mouse Button
Pressed Then Released Within A Short Time Without The Mouse Moving In
Between? Both events are needed.
On Fri, Jul 15, 2011 at 3:28 PM, Steven D'Aprano
wrote:
> My question is, should I accept None as the missing value, or a dedicated
> singleton?
>
> In favour of None: it's already there, no extra code required. People may
> expect it to work.
>
> Against None: it's too easy to mistakenly add None
Was tried at least once before:
http://www.python.org/dev/peps/pep-0287/
Check in here with your ideas:
http://www.python.org/community/sigs/current/doc-sig/
Have any other languages mandated the use of a specific documentation markup?
Michael
On Thu, Jul 14, 2011 at 7:02 PM, rantingrick wrote
Hello folks,
I'm designing an API for some lightweight calculator-like statistics
functions, such as mean, standard deviation, etc., and I want to support
missing values. Missing values should be just ignored. E.g.:
mean([1, 2, MISSING, 3]) => 6/3 = 2 rather than 6/4 or raising an error.
My ques
On Thu, 14 Jul 2011 10:22:44 -0700, Miki Tebeka wrote:
> I'm trying to decode JSON output of a Java program (jackson) and having
> some issues. The cause of the problem is the following snippet:
> {
> "description": "... lives\uMOVE™ OFFERS ",
> }
> Which causes ValueError: Invalid
Inside writes:
> But I can't follow your opinion.Why?because of the list & tuple are
> placed at built-in function,so before I type 'list' unintentionally on
> the pyshell and it show me "", I never know that the name
> 'list' is a type,I used to consider it's a function to produce 'list'
> type.
On 7/14/2011 9:51 PM, Ben Finney wrote:
Steven D'Aprano writes:
Inside wrote:
As telling in the subject,because "list" and "tuple" aren't functions,they
are types.Is that right?
At one time (before 2.2), they were functions and not classes.
Yes they are types. But they can still be used
Hey guy,thx for you feedback first.
But I can't follow your opinion.Why?because of the list & tuple are placed at
built-in function,so before I type 'list' unintentionally on the pyshell and it
show me "", I never know that the name 'list' is a type,I used to
consider it's a function to produce
Excerpts from rantingrick's message of Thu Jul 14 21:36:15 -0400 2011:
> On Jul 14, 8:21pm, Inside wrote:
> > As telling in the subject,because "list" and "tuple" aren't functions,they
> > are types.Is that right?
>
> You wanna see some warts in the docs. Okay, try to use the search box
> to fin
Steven D'Aprano writes:
> Inside wrote:
>
> > As telling in the subject,because "list" and "tuple" aren't functions,they
> > are types.Is that right?
>
> Yes they are types. But they can still be used as functions. Does it matter?
As a newcomer to the documentation I looked fruitlessly in the ta
On Jul 14, 8:21 pm, Inside wrote:
> As telling in the subject,because "list" and "tuple" aren't functions,they
> are types.Is that right?
You wanna see some warts in the docs. Okay, try to use the search box
to find list, dict, or tuple and see what happens...
http://docs.python.org/
Search: [
Inside wrote:
> As telling in the subject,because "list" and "tuple" aren't functions,they
> are types.Is that right?
Yes they are types. But they can still be used as functions. Does it matter?
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
As telling in the subject,because "list" and "tuple" aren't functions,they are
types.Is that right?
--
http://mail.python.org/mailman/listinfo/python-list
rantingrick writes:
> ---
> New Syntax Specification For Documentation Strings
> ---
>
> """ {DOC TAG HERE}: {MODULE_NAME|SHORT_SUMMARY_HERE}.
> {NEWLINE}
> {LONG_DESCRIPTION_HERE}
> {NEWLINE}
> Arguments: (if applicable)
>
Hello Folks,
Lately i have been musing over the ideas of method tagging.
Specifically i am referring to method identifiers. As most of you know
i had proposed to add "syntactical markers" to the language to deal
with the ambiguities that arise whist eyeball parsing sub classed
methods that clobbe
On 14/07/2011 21:53, Peter Otten wrote:
MRAB wrote:
for line2 in nxxReg.findall(soup):
nxxlist.insert(count2, line2)
count2 = count2 + 1
enumerate will help you here:
for count2, line2 in enumerate(nxxReg.findall(soup)):
nxxlist.insert(count2, line2)
An insert() at the end
# Multiplicity and Asininity in Tkinter Event API! #
The problems with Tkinter events are two fold:
Probl
I'm working on a tool that runs a number of process is separate thread.
I've, up to this point, been using threading.Thread, but from what I
read multiprocess will allow multiple processors to be used
From the python docs on multiprocessing.
I have run into an issue when modifying the thread obj
Hi Ryan.
Best of luck with the conference.
>Thanks also to Linux Australia, who provide the overarching legal and
>organisational structure for PyCon Australia.
I want to talk to somebody from Linux Australia about this overarching legal
and organisational structure.
Do you have an email addre
MRAB wrote:
>> for line2 in nxxReg.findall(soup):
>> nxxlist.insert(count2, line2)
>> count2 = count2 + 1
>>
> enumerate will help you here:
> for count2, line2 in enumerate(nxxReg.findall(soup)):
> nxxlist.insert(count2, line2)
An insert() at the end of a list is usually spelt appe
Billy Mays writes:
> Is there any way to just create a new generator that clears its
> closed` status?
You can define getLines in terms of the readline file method, which does
return new data when it is available.
def getLines(f):
lines = []
while True:
line = f.readline()
On 7/14/2011 3:46 PM, Billy Mays wrote:
I noticed that if a file is being continuously written to, the file
generator does not notice it:
Because it does not look, as Ian explained.
def getLines(f):
lines = []
for line in f:
lines.append(line)
return lines
This nearly duplicates .readlines,
On 07/14/2011 04:00 PM, Ian Kelly wrote:
On Thu, Jul 14, 2011 at 1:46 PM, Billy Mays wrote:
def getLines(f):
lines = []
for line in f:
lines.append(line)
return lines
with open('/var/log/syslog', 'rb') as f:
lines = getLines(f)
# do some processing with lines
#
On 7/14/2011 3:20 PM, MRAB wrote:
On 14/07/2011 18:22, Miki Tebeka wrote:
Greetings,
I'm trying to decode JSON output of a Java program (jackson) and
having some issues.
The cause of the problem is the following snippet:
{
"description": "... lives\uMOVE™ OFFERS ",
}
Which causes ValueError: In
On Thu, Jul 14, 2011 at 1:46 PM, Billy Mays wrote:
> def getLines(f):
> lines = []
> for line in f:
> lines.append(line)
> return lines
>
> with open('/var/log/syslog', 'rb') as f:
> lines = getLines(f)
> # do some processing with lines
> # /var/log/syslog gets updated in
I noticed that if a file is being continuously written to, the file
generator does not notice it:
def getLines(f):
lines = []
for line in f:
lines.append(line)
return lines
with open('/var/log/syslog', 'rb') as f:
lines = getLines(f)
# do some processing with lines
On 14/07/2011 18:22, Miki Tebeka wrote:
Greetings,
I'm trying to decode JSON output of a Java program (jackson) and having some
issues.
The cause of the problem is the following snippet:
{
"description": "... lives\uMOVE™ OFFERS ",
}
Which causes ValueError: Invalid \u es
[snip]
raw_input() returns a string, so there's no need for these 3 lines:
> y = str(y)
> z = str(z)
> p = str(p)
> pagedef = ("http://www.localcallingguide.com/xmllocalprefix.php?npa=";
+ y + "&nxx=" + z)
> print "Querying", pagedef
>
> #--Get info from NANPA.com --
> urllib2.inst
For me, there are some things I don't like much. One-character
variable names stand out (tend to make the code hard to read).
Violation of PEP 8 guidelines, especially wrt spacing. e.g.
result.append("%s[%s]%s" % (lastprefix, tails, lastsuffix))
not
result.append("%s[%s]%s"%(lastprefix,tails,l
On 14 Jul., 17:31, Billy Mays wrote:
> On 07/14/2011 11:00 AM, Christian wrote:
>
>
>
>
>
>
>
>
>
> > Hi,
>
> > I get some problem when i like to set the table name dynamic.
> > I'm appreciate for any help.
>
> > Christian
>
> > ### works
> > newcur.execute ( """ INSERT INTO events (id1,id2
I've been working on this for 3 weeks as a project while I'm learning
python. It's ugly, only function in there is from a fellow lister, but
it works perfectly and does what it is intended to do.
I'd love to hear comments on how I could improve this code, what would
be good to turn into a function
Greetings,
I'm trying to decode JSON output of a Java program (jackson) and having some
issues.
The cause of the problem is the following snippet:
{
"description": "... lives\uMOVE™ OFFERS ",
}
Which causes ValueError: Invalid \u escape.
Any ideas on how to fix this?
Thanks,
On Thu, Jul 14, 2011 at 11:00 AM, monkeys paw wrote:
> You could use the below code. time.sleep(# seconds in a day)
> where i == 30 would run once a day for a month
>
> import time
> i=0
> while (1):
> print 'hello'
> time.sleep(2) # Change this to number of seconds in a day
>
On 7/9/2011 10:01 PM, John Salerno wrote:
Thanks everyone! I probably should have said something like "Python,
if possible and efficient, otherwise any other method" ! :)
I'll look into the Task Scheduler. Thanks again!
You could use the below code. time.sleep(# seconds in a day)
where i == 30
On 07/14/2011 11:00 AM, Christian wrote:
Hi,
I get some problem when i like to set the table name dynamic.
I'm appreciate for any help.
Christian
### works
newcur.execute ( """ INSERT INTO events (id1,id2) VALUES (%s,%s);
""" , (rs[1],rs[2]))
### works not
newcur.execute ( """ INSE
On Fri, Jul 15, 2011 at 1:00 AM, Christian wrote:
> Hi,
>
> I get some problem when i like to set the table name dynamic.
> I'm appreciate for any help.
>
> ### works but is not really perfect: None from rs list result in
> "None" instead of NULL.
> newcur.execute ( """ INSERT INTO %s_events (id
On Jul 14, 10:34 am, Grant Edwards wrote:
> On 2011-07-13, Thorsten Kampe wrote:
>
> > * Grant Edwards (Wed, 13 Jul 2011 13:03:22 + (UTC))
> >> On 2011-07-13, Thorsten Kampe wrote:
>
> >> >> and that that block is to be considered in relation to what was just
> >> >> said, before the colon.
Hi,
I get some problem when i like to set the table name dynamic.
I'm appreciate for any help.
Christian
### works
newcur.execute ( """ INSERT INTO events (id1,id2) VALUES (%s,%s);
""" , (rs[1],rs[2]))
### works not
newcur.execute ( """ INSERT INTO %s_events (id1,id2) VALUES (%s,
On Fri, Jul 15, 2011 at 12:53 AM, Ellerbee, Edward wrote:
> Holy cow, that's perfect!
>
> Thanks so much :)
>
> Would it be alright if I post my code on the list for critiquing? I'm
> learning python to supplement my voice engineering position - time
> consuming tasks that can be automated will ta
Holy cow, that's perfect!
Thanks so much :)
Would it be alright if I post my code on the list for critiquing? I'm
learning python to supplement my voice engineering position - time
consuming tasks that can be automated will take less time.
Edward Ellerbee
-Original Message-
From: pyt
On Fri, Jul 15, 2011 at 12:04 AM, Ellerbee, Edward wrote:
> Hey Chris,
>
> I was reading over this again, trying to understand the logic (I'm a
> n00b)
>
> Could you explain this a bit? I'd like to build this emit function, but
> I still don't have a firm grasp on functions. All of my code is line
On 2011-07-13, Thorsten Kampe wrote:
> * Grant Edwards (Wed, 13 Jul 2011 13:03:22 + (UTC))
>> On 2011-07-13, Thorsten Kampe wrote:
>>
>> >> and that that block is to be considered in relation to what was just
>> >> said, before the colon.
>> >
>> > The indentation makes it abundantly clear t
Hi All,
PyDev 2.2.1 has been released
Details on PyDev: http://pydev.org
Details on its development: http://pydev.blogspot.com
Release Highlights:
---
Quick-outline
* Parent methods may be shown with a 2nd Ctrl+O.
* The initial node is selected with the current lo
Thank you all for the advice, let me spin this in a different way.
I've built a program that goes to the NANPA website, scrapes area
code/exchange (npa/nxx) digits for a specified area - be it carolina,
alabama, texas, etc - drops it into a file, then massages the data and
prints out the correct f
On Jul 14, 3:07 am, marco wrote:
> Hello gals and guys,
>
> I'm an experienced Python user and I'd like to begin playing with
> Twisted.
> I started RTFM the tutorial advised on the official site and I found it
> really useful and well done.
>
> Now I'd like to practice a bit by coding a little pr
On Wednesday, July 13, 2011 5:39:16 AM UTC-7, Anthony Kong wrote:
[snip]
> I think I will go through the following items:
>
> itertools module
> functools module
> concept of currying ('partial')
>
>
> I would therefore want to ask your input e.g.
>
> Is there any good example to illustrate the
On Jul 14, 4:32 am, Gregory Ewing wrote:
> Anthony Kong wrote:
> > So I have picked this topic for one of my presentation. It is because
> > functional programming technique is one of my favorite in my bag of python
> > trick.
>
> I'm not sure it's a good idea to emphasise functional
> programmi
On Jul 13, 1:39 pm, Anthony Kong wrote:
> (My post did not appear in the mailing list, so this is my second try.
> Apology if it ends up posted twice)
>
> Hi, all,
>
> If you have read my previous posts to the group, you probably have some idea
> why I asked this question.
>
> I am giving a few
On Thu, Jul 14, 2011 at 5:07 PM, marco wrote:
> Now I'd like to practice a bit by coding a little program that reads
> strings from a serial device and redirects them remotely via TCP. For
> that sake I'm trying to use deferred.
The obvious solution (to my mind) is two threads, one for each
direc
Hello gals and guys,
I'm an experienced Python user and I'd like to begin playing with
Twisted.
I started RTFM the tutorial advised on the official site and I found it
really useful and well done.
Now I'd like to practice a bit by coding a little program that reads
strings from a serial device an
52 matches
Mail list logo