On 30 September 2017 at 21:12, Stefan Ram wrote:
> I would like to write source code similar to:
>
> country( 'USA' )
> state( 'Alabama' )
> town( 'Abbeville' )
> town( 'Addison' )
> state( 'Arizona' )
> town( 'Apache Junction' )
> town( 'Avondale )
> town( 'Benson' )
>
On 23 November 2016 at 19:40, Daiyue Weng wrote:
> Hi, I am wondering how to concatenate corresponding strings in two lists,
> assuming that the lists are of same length, e.g.
>
> val_1 = ['a', 'b', 'c']
> val_2 = ['A', 'B', 'C']
>
> # concatenate corresponding strings in 'val_1' and 'val_2'
> # a
On 16 September 2016 at 14:24, meInvent bbird wrote:
> im = img.copy()
> cntcounter = 0
> for cnt in contours:
> epsilon = 0.1*cv2.arcLength(cnt,True)
> approx = cv2.approxPolyDP(cnt,epsilon,True)
> #peri = cv2.arcLength(cnt, True)
> #approx = cv2.approxPolyDP(c, 0.
On 26 August 2016 at 17:58, Joonas Liik wrote:
> On 26 August 2016 at 16:10, Frank Millman wrote:
>> "Joonas Liik" wrote in message
>> news:cab1gnpqnjdenaa-gzgt0tbcvwjakngd3yroixgyy+mim7fw...@mail.gmail.com...
>>
>>> On 26 August 2016 at 08:22, Frank M
On 26 August 2016 at 16:10, Frank Millman wrote:
> "Joonas Liik" wrote in message
> news:cab1gnpqnjdenaa-gzgt0tbcvwjakngd3yroixgyy+mim7fw...@mail.gmail.com...
>
>> On 26 August 2016 at 08:22, Frank Millman wrote:
>> >
>> > So this is my conversi
On 26 August 2016 at 08:22, Frank Millman wrote:
> "Peter Otten" wrote in message news:npn25e$s5n$1...@blaine.gmane.org...
>
> Frank Millman wrote:
>
>>> As you have to keep the "<", why bother?
>>
>>
>> If you mean why don't I convert the '<' to '<', the answer is that I do
>> - I just omitted t
On 11 July 2016 at 20:52, wrote:
> What kind of statistic law or mathematical conjecture or is it even a
> physical law is violated by compression of random binary data?
>
> I only know that Shanon theorised it could not be done, but were there any
> proof?
Compression relies on some items in
On 26 June 2016 at 18:28, Ari Freund via Python-list
wrote:
> Thanks everybody. There seems to be a lot of resistance to dict unpacking,
> in addition to the problem with my proposed shorthand dict() initialization
> syntax pointed out by Steven D'Aprano, so I won't be pursuing this.
> --
> htt
On 26 June 2016 at 04:47, Ho Yeung Lee wrote:
> what is the command or code to write to use virtual memory if i use extra
> 20 GB from hard disk as memory, means from 70GB memory to 90GB memory
> and left 10GB for file?
>
> Michael Torrie於 2016年6月25日星期六 UTC+8上午11時00分36秒寫道:
>> On 06/24/2016 08:44 P
On 18 June 2016 at 23:47, Ethan Furman wrote:
> On 06/18/2016 07:05 AM, Joonas Liik wrote:
>>
>> On 18 June 2016 at 15:04, Pete Forman wrote:
>
>
>>> with obj:
>>> .a = 1# equivalent to obj.a = 1
>>> .total = .total + 1
On 18 June 2016 at 15:04, Pete Forman wrote:
> Rustom Mody writes:
>
>> On Friday, June 17, 2016 at 2:58:19 PM UTC+5:30, Steven D'Aprano wrote:
>>> On Fri, 17 Jun 2016 06:13 pm, Ned Batchelder wrote:
>>>
>>> > To me, it's a toss-up. The chained version is nice in that it
>>> > removes the repetit
On 8 June 2016 at 12:20, meInvent bbird wrote:
> just extract b[i][0:1] and b[i][1:2] out of for loop
>
> but i depend on for loop
>
> def node(mmm, A, B):
> H2 = [MM[mmm][A+B] for i in range(len(b))]
> return H2
>
> node(5, b[i][0:1], b[i][1:2])
>
> it is not convenient to disclose in detail
>
>
> I know that sort() returns None, but I guess that it would be returned x
> that was sorted. Why so?
if it returned a sorted list it might lead some people to believe it
did not modify the oridinal list which would lead to a ton of
confusion for new users.
--
https://mail.python.org/mailman/li
I have this feeling that you would get a lot more useful anwsers if
you were to describe your actual problem in stead of what you think
the solution is. There might be other, better solutions but since we
know so little about what you are doing we will likely never find them
by just guessing..
--
On 16 July 2015 at 21:58, Steven D'Aprano wrote:
> On Fri, 17 Jul 2015 03:34 am, Joonas Liik wrote:
>
>> Now i admit that it is possible to have infinite recursion but it is
>> also possiblew to have infinite loops. and we don't kill your code
>> after 1000
On 16 July 2015 at 20:49, Chris Angelico wrote:
>
> This sounds like a denial-of-service attack. If you can state that no
> reasonable document will ever have more than 100 levels of nesting,
> then you can equally state that cutting the parser off with a tidy
> exception if it exceeds 100 levels
On 16 July 2015 at 20:03, Chris Angelico wrote:
>
> The trouble with that is that it can quickly run you out memory when
> you accidentally trigger infinite recursion. A classic example is a
> simple wrapper function...
>
> def print(msg):
> print(ctime()+" "+msg)
>
> With the recursion limit
Wouldn't it be possible to have like a dynamically
sized stack so that you can grow it endlessly
with some acceptable overhead..
That would pretty much take care of the stack-overflow
argument without many painful side effects on
the semantics at least..
--
https://mail.python.org/mailman/listinf
It sounds to me more like it is possible to use long file names on windows
but it is a pain and in python, on windows it is basically impossible.
So shouldn't it be possible to maniulate these files with extended names..
I mean even if you had to use some special function to ask for long names
it
Personally, i have had AVG give at least 2 false positives (fyi one of
them was like python2.6)
as long as antivirus software can give so many false positives i would
thing preventing your AV from nuking someone elses data is a
reasonable thing.
--
https://mail.python.org/mailman/listinfo/python-
On 21 June 2015 at 17:38, Sahlusar wrote:
>
> [snip]
> I do agree with you Denis that this is an unconventional approach. I was
> wondering then that perhaps I should add additional functionality at the XML
> to JSON step? So far, with JSON objects without nested lists (as values) I
> have been
this.. might not throw an eror, but you have 2 keys with the same name
"F", and 1 of them will probably be disgarded..., you have data
corruption even before you try to process it.
{
"F": "False",
"F": {
"Int32": ["0",
"0",
"0"]
},
}
you mentioned Excel at one point.
perhaps you could mock up w
You say you are taking this from an xml file and want to get a CSV file..
Why are you making an intermediate JSON file?
Why do you need the CSV output?
Could you perhaps be better off using another format?
Your data seems to be a quite deeply nested hierarchical structure and
doesn't
seem to su
Perhaps its just me, but it seems to me that this release is mighty picky
about annotations.
More specifically everything is fine in the interactive interpreter but the
same code won't fly when run as a file.
example:
def some_function(my_arg:"my random annotation")->"my random return type
annota
You think "(f)" makes a tuple, but it does not.
the parentesis is not the tuple constructor, the comma is
try:
t=thread.start_new_thread(proc,(f,))
--
https://mail.python.org/mailman/listinfo/python-list
my_dict = {1: 'D', 2: 'B', 3: 'A', 4: 'E', 5: 'B'}
# dict.items() returns an iterator that returns pairs of (key, value) pairs
# the key argument to sorted tells sorted what to sort by,
operator.itemgetter is a factory function , itemgetter(1)== lambda
iterable: iterable[1]
sorted_dict = sorted(my
>>> ff=sorted({1: 'D', 2: 'B', 3: 'B', 4: 'E', 5: 'A'})
>>> ff
[1, 2, 3, 4, 5]
sorted({1: 'D', 2: 'B', 3: 'B', 4: 'E', 5: 'A'}) is equivalent to
sorted(iter({1: 'D', 2: 'B', 3: 'B', 4: 'E', 5: 'A'}))
and iter(dict) iterates over the dict keys, so when you do
iter({1: 'D', 2: 'B', 3: 'B', 4: 'E',
Balancing of trees is kind of irrelevant when "tree" means "search space"
no?
And you definitely dont need to keep the entire tree in memory at the same
time.
By cropping unsuitable branches early (and not keeping the entire tree in
memory)
it is quite easy to have more than 1000 of call stack and
I agree, stack overflow is literally the main issue that ive run in to
(tree traversal)
I've yet to refactor recursion to iterative for speed, but i have done so
to avoid hitting the stack size limit.
Tree traversal and similar problems in particular lend themselves well to
recursion and are not q
29 matches
Mail list logo