Lauren Porter wrote:
> Hello all! I've been trying to create a game in Python Processing where a
> spaceship moves horizontally in order to miss a collision with an
> asteroid. I'm having difficulty making it so that the game quits when an
> asteroid hits the spaceship, could anybody help? Here
Ethan Furman wrote:
> On 12/07/2017 10:53 AM, Peter Otten wrote:
>> Ethan Furman wrote:
>>
>>> The simple answer is No, and all the answers agree on that point.
>>>
>>> It does beg the question of what an identity function is, though.
>>>
>
Ethan Furman wrote:
> The simple answer is No, and all the answers agree on that point.
>
> It does beg the question of what an identity function is, though.
>
> My contention is that an identity function is a do-nothing function that
> simply returns what it was given:
>
> --> identity(1)
> 1
Chris Angelico wrote:
> On Thu, Dec 7, 2017 at 3:56 AM, Dennis Lee Bieber
> wrote:
>> Granted, the statistics module in newer Python releases makes the
>> entire assignment trivial...
>>
>> ClgubaJva 3.5.3 (qrsnhyg, Wha 26 2017, 16:17:54) [ZFP i.1900 64 ovg
>>
Paul Moore wrote:
> On 2 December 2017 at 03:32, Peng Yu wrote:
>> Where is `?reload=true` from? How to just get the redict URL that one
>> would get from the browser? Thanks.
>>
>>> 'http://ieeexplore.ieee.org:80/document/771073/?reload=true'
>
> The reload=true comes
Peng Yu wrote:
> Hi,
>
> Does anybody know how only get the redirected URL but not the actual
> content?
>
> I guess the request module probably should be used. But I am not sure
> how to do it exactly.
>
> Can somebody show me the best way to request
> (https://doi.org/10.1109/5.771073) and
Skip Montanaro wrote:
>> I'm 99.5% certain it's not gate_news.
>
> A funny thing. All messages I have looked at so far with the "nospam"
> thing have a Message-ID from binkp.net. (They are also all Usenet
> posts.) For example:
>
> Newsgroups: comp.lang.python
> Subject: Re: I have anaconda,
Greg Tibbet wrote:
>
> I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit
> of Java and trying to learn this new-fangled Python language!
>
> I've got a small program that uses PIL to create an image, draw some
> primitives (rectanges, ellipses, etc...) and save it. Works
Greg Tibbet wrote:
>
> I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit
> of Java and trying to learn this new-fangled Python language!
>
> I've got a small program that uses PIL to create an image, draw some
> primitives (rectanges, ellipses, etc...) and save it. Works
Greg Tibbet wrote:
>
> I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit
> of Java and trying to learn this new-fangled Python language!
>
> I've got a small program that uses PIL to create an image, draw some
> primitives (rectanges, ellipses, etc...) and save it. Works
shalu.ash...@gmail.com wrote:
> Hi, All,
>
> I have 6 variables in CSV file. One is rainfall (dependent, at y-axis) and
> others are predictors (at x). I want to do multiple regression and create
> a correlation matrix between rainfall (y) and predictors (x; n1=5). Thus I
> want to read rainfall
Andrew Z wrote:
> well, yeah, it's unidirectional and final destination is always the same
> and have little to do with the question.
>
> Say, i have a dict:
>
> fut_suffix ={ 1 : 'F',
> 2 : 'G',
> 3 : 'H',
> 4 : 'J',
> 5 : 'K',
>
Radhey Parashar wrote:
> I am facing 1 issue with python related to append command in a list
> class CITY:
>
> num = 0
>
> connectivity = []
The way you wrote it the connectivity list is shared between all instances
of the CITY class. Consult a Python tutorial to learn why.
To get
Daiyue Weng wrote:
> I have a nested dictionary of defaultdict(dict) whose sub dict have int
> keys and lists (list of ints) as values,
>
> 'A' = {2092: [1573], 2093: [1576, 1575], 2094: [1577], 2095:
> [1574]}'B' = {2098: [1], 2099: [2, 3], 2101: [4], 2102: [5]}'C' =
> {2001: [6], 2003: [7, 8],
ast wrote:
> Hello
>
> Here is my module tmp.py:
>
> a=0
>
> def test():
> global a
> print(a)
> a+=1
>
> If I import function "test" from module "tmp" with:
>
from tmp import test
>
> it works
>
test()
> 0
test()
> 1
>
> But where variable "a" is located ? I
tysondog...@gmail.com wrote:
> I am trying to delete duplicates but the job just finishes with an exit
> code 0 and does not delete any duplicates.
>
> The duplicates for the data always exist in Column F and I am desiring to
> delete the entire row B-I
>
> Any ideas?
>
>
> import openpyxl
>
Peter Otten <__pete...@web.de> added the comment:
A possible workaround is to use create_function():
>>> import sqlite3, math
>>> db = sqlite3.connect(":memory:")
>>> db.execute("select sin(?);", (math.pi,)).fetchone()
Traceback (m
Steve D'Aprano wrote:
> I'm trying to dump a Firefox IndexDB sqlite file to text using Python 3.5.
>
>
> import sqlite3
> con = sqlite3.connect('foo.sqlite')
> with open('dump.sql', 'w') as f:
> for line in con.iterdump():
> f.write(line + '\n')
>
>
> The error I get is:
>
>
ROGER GRAYDON CHRISTMAN wrote:
> Just a quick question on how best to read a remote CSV file.
> So far, I tried:
>
> filelink = urllib.request.urlopen(path)
> dictread = csv.DictReader(filelink)
> for row in dictread:...
> But I'm running into the difference between strings and bytes.
> I'd
David Gabriel wrote:
> Dears,
>
> When I run this command I got this error message:
>
> ubuntu@orchestrateur:/tmp/pack$ virtualenv -p $(which python3.5) .
> Running virtualenv with interpreter /usr/local/sbin/.
> Traceback (most recent call last):
> File "/usr/bin/virtualenv", line 3, in
>
C W wrote:
> Oh, I was running a debug file, that's why the path is different.
>
> The file is here,
> https://www.dropbox.com/s/6jx4rzyg9xwl95m/train_catvnoncat.h5?dl=0
>
> Is anyone able to get it working? Thank you!
Hm, that file seems to contain HTML and that causes an OSError here, too:
ast wrote:
> Hi,
>
> I know two Python's objects which have an intrinsic
> name, classes and functions.
>
> def f():
> pass
>
f.__name__
> 'f'
g = f
g.__name__
> 'f'
>
> class Test:
> pass
>
Test.__name__
> 'Test'
Test2 = Test
Test2.__name__
> 'Test'
>
jf...@ms4.hinet.net wrote:
> Peter Otten於 2017年10月19日星期四 UTC+8下午6時04分39秒寫道:
>> jf...@ms4.hinet.net wrote:
>>
>> > Peter Otten at 2017-10-19 UTC+8 PM 3:24:30 wrote:
>> >> It's not clear to me what you mean with this. Did you place the table
>> >> fr
Israel Brewster wrote:
>
>> On Oct 19, 2017, at 10:02 AM, Stefan Ram wrote:
>>
>> Israel Brewster writes:
>>> t10 = {'daily': 0, 'WTD': 0, 'MTD': 0, 'YTD': 0,}
>>> increment the appropriate bin counts using a bunch of if statements.
>>
>> I
jf...@ms4.hinet.net wrote:
> Peter Otten at 2017-10-19 UTC+8 PM 3:24:30 wrote:
>> It's not clear to me what you mean with this. Did you place the table
>> from the recipe elsewhere inside a window that you created or did you
>> make changes in the recipe's code?
>
> T
jf...@ms4.hinet.net wrote:
> In last few days, I tried to experiment with the scrolling table
> implemented in canvas, started from this example:
> http://code.activestate.com/recipes/580793-tkinter-table-with-scrollbars/.
> Everything works fine until I moved the scrolling_area instance (which
Daniel Flick wrote:
> On Tuesday, October 17, 2017 at 4:25:02 PM UTC-5, Daniel Flick wrote:
>>
>> Peter, I am not following. Are you saying that there is a function that
>> returns the network only? network_address was giving me the mask
>> attached to the end but maybe I was doing something
Daniel Flick wrote:
> I am very new to Python and have been struggling to find some info on
> processing IP addresses.
>
> get_network returns 192.168.1.128/25 but I need 192.168.1.128 only. I can
> do this with netaddr but I am working with Mako templates and ipaddress is
> a built in module
Stefan Ram wrote:
> Peter Otten <__pete...@web.de> writes:
>>team.pop(2)
>>Stefan's explanation may work for
>>del x
>>if you discard
>>x = None # get rid of the huge object that x was bound to before
>>as a hack
>
> »x = None« observably has
bartc wrote:
> On 16/10/2017 16:58, Stefan Ram wrote:
>> Xue Feng writes:
>>> I wonder why 'del' is not a function or method.
>>
>>Assume,
>>
>> x = 2.
>>
>>When a function »f« is called with the argument »x«,
>>this is written as
>>
>> f( x )
>>
>>. The
Andrew Z wrote:
> Hello,
> pos = {"CLown":10,"BArbie":20}
> I want to return integer (10) for the keyword that starts with "CL"
>
>
> cl_ = [v for k, v in pos.items() if k.startswith('CL')]
> cl_pos = cl_[0]
> if cl_pos > 0:
>
>blah..
>
>
> There are 2 issues with the above:
> a. ugly -
Andrew Z wrote:
> Hello,
>
> apparently my reading comprehension is nose diving these days. After
> reading python cookbook and a few other tutorials i still can't get a
> simple logging from a few files to work.
> I suspected my file organization - all files are in the same directory,
>
Stefan Ram wrote:
> Which advice do you refer to?
Teach the parts that are most useful first, i. e. for loops over anything
but range rather than while loops.
--
https://mail.python.org/mailman/listinfo/python-list
Sayth Renshaw wrote:
> Thanks. Updated the script. But shouldn't it create the file if it doesn't
> exist? Which none of them will.
> pathlib.PurePath(r'C:\Users\Sayth\Projects\results', file_name)
> with open(result_path, 'a') as f:
> f.write(data)
> ##Output
>
John Black wrote:
> I want sep="" to be the default without having to specify it every time I
> call print. Is that possible?
No, but you can replace the print function with your own:
>>> print = functools.partial(print, sep="")
>>> print("I", "recommend", "you", "choose", "another", "name",
Chris Angelico wrote:
> On Fri, Oct 6, 2017 at 4:14 PM, Gregory Ewing
> wrote:
>> Steve D'Aprano wrote:
>>>
>>> Plus the downtime and labour needed to install the memory, if the
>>> computer will even take it.
>>
>>
>> Obviously we need an architecture that supports
Thomas Nyberg wrote:
> Hello,
>
> I'm trying to understand native namespaces. I'm currently using python
> 3.5 as packaged in debian 9. I've been following the instructions here:
>
> https://packaging.python.org/guides/packaging-namespace-packages/#native-namespace-packages
>
> Those
Thomas Nyberg wrote:
> Hello,
>
> I'm trying to understand native namespaces. I'm currently using python
> 3.5 as packaged in debian 9. I've been following the instructions here:
>
> https://packaging.python.org/guides/packaging-namespace-packages/#native-namespace-packages
>
> Those
Stefan Ram wrote:
> "ROGER GRAYDON CHRISTMAN" writes:
>>On Wed, Oct 4, 2017 22:42 Stefan Ram (r...@zedat.fu-berlin.de) wrote:
>>Steve D'Aprano writes:
So, "bottom-up" in this case means: iterators should be
taught before for-loops.
Why?
Stefan Ram wrote:
> bartc writes:
>>Note that your reverse-indentation style is confusing!
>
> In Python, indentation can be significant.
>
> Sometimes, some lines in Python must be indented by 0.
Are there any editors that do not support a dedent operation?
In the
Stefan Ram wrote:
> Is this the best way to write a "loop and a half" in Python?
>
> x = 1
> while x:
> x = int( input( "Number (enter 0 to terminate)? " ))
> if x:
> print( f'Square = { x**2 }' )
>
> In a C-like language, one could write:
>
> while x = int( input( "Number
Neal Becker wrote:
> In the following code (python3):
>
> for rb in filter (lambda b : b in some_seq, seq):
> ... some code that might modify some_seq
>
> I'm assuming that the test 'b in some_seq' is applied late, at the start
> of each iteration (but it doesn't seem to be working that way
bartc wrote:
> On 02/10/2017 08:41, Peter Otten wrote:
>> Daniel Bastos wrote:
>>
>>> def make_sequence_non_recursive(N, x0 = 2, c = -1):
>>>"What's wrong with this function? It's very slow."
>>>last = x0
>>>def sequence
Daniel Bastos wrote:
> def make_sequence_non_recursive(N, x0 = 2, c = -1):
> "What's wrong with this function? It's very slow."
> last = x0
> def sequence():
> nonlocal last
> next = last
> last = last**2 + c
> return next % N
> return sequence
>
> It crawls pretty soon.
Steve D'Aprano wrote:
> In the standard library's contextlib.py module, there is a class for
> redirecting standard I/O streams, and two public functions. The code is
> short enough to reproduce here:
>
> # From Python 3.5
>
> class _RedirectStream:
> _stream = None
> def __init__(self,
Matt Wheeler wrote:
> With deepest apologies to all involved...
>
> On Tue, 26 Sep 2017 at 08:42 Gregory Ewing
> wrote:
>
>> Ben Bacarisse wrote:
>> > Think functional! This is 257 characters:
>>
>> 250 chars, 17 shorter than the text it produces:
>>
>>
Bill wrote:
> Ever since I download the MyCharm IDE a few days ago, I've been noticing
> all sort of "spacing conventions (from PEP) that are suggested. How do
> folks regard these in general?
>
> For instance, the conventions suggest that
>
> if x>y :
> pass
>
> should be written
>
Stefan Ram wrote:
> Why do we newbies write »print 2«? Here's another hint.
> This is an original transcript of what happened to me today:
>
> |>>> import( operator )
> | File "", line 1
> |import( operator )
> | ^
> |SyntaxError: invalid syntax
> |
> |>>> import operator
> |
>
Bernie Connors wrote:
> On Tuesday, September 26, 2017 at 12:32:18 PM UTC-3, Bernie Connors wrote:
>> Hello,
>>
>> My first post here on C.L.P. I have only written a few python
>> scripts in 2.7 and now I'm trying my first python 3 script. Can
>> you tell me why this snippet
Jerry Hill wrote:
> On Tue, Sep 26, 2017 at 12:32 PM, Peter Otten <__pete...@web.de> wrote:
>> Newer Python versions will show
>>
>> Help on built-in function sin in module math:
>>
>> sin(x, /)
>> Return the sine of x (measured in radians).
Stefan Ram wrote:
> Here's a console transcript:
>
> |>>> from math import sin
> |>>> help( sin )
> |Help on built-in function sin in module math:
> |
> |sin(...)
> |sin(x)
> |
> |Return the sine of x (measured in radians).
> |
> |>>> sin( x = 2.0 )
> |Traceback (most recent call
Kryptxy via Python-list wrote:
> Sent with [ProtonMail](https://protonmail.com) Secure Email.
>
>> Original Message
>> Subject: Re: Running a GUI program haults the calling program (linux)
>> Local Time: 26 September 2017 12:09 PM
>> UTC Time: 26 September 2017 06:39
>> From:
john polo wrote:
> Python List,
>
> I am trying to make practice data for plotting purposes. I am using
> Python 3.6. The instructions I have are
>
> import matplotlib.pyplot as plt
> import math
> import numpy as np
> t = np.arange(0, 2.5, 0.1)
> y1 = map(math.sin, math.pi*t)
> plt.plot(t,y1)
Steve D'Aprano wrote:
> Is there a way to log when the garbage collector finds and collects a
> reference cycle?
>
> I don't care about objects claimed by the reference counter, I only care
> about cycles.
I don't know, and I don't think so. Would a structure like
a --- b --- c
| | |
d
Peter Otten wrote:
> validationma...@gmail.com wrote:
>
>> i have a code in python to search and replace what i need though is to
>> replace the first say 10 instances of the number 1 with 2 and the second
>> 10 instances with the number 3. anybody knows how to do that?
validationma...@gmail.com wrote:
> i have a code in python to search and replace what i need though is to
> replace the first say 10 instances of the number 1 with 2 and the second
> 10 instances with the number 3. anybody knows how to do that?
>
> fin = open(r'F:\1\xxx.txt')
> fout =
Pavol Lisy wrote:
> pandas is one of reasons why python is so popular these days. But
> "there is only milion way how to do it" (and other unpythonic issues)
> I see there every time I am looking at it. :)
Yeah, such a useful tool with such a byzantine API, completely at odds with
the zen -- I
Exposito, Pedro (RIS-MDW) wrote:
> This code does a "where" clause on a panda data frame...
>
> Code:
> import pandas as pd;
> col_names = ['Name', 'Age', 'Weight', "Education"];
> # create panda dataframe
> x = pd.read_csv('test.dat', sep='|', header=None, names = col_names);
>
zljubi...@gmail.com wrote:
> I have sliced the pandas dataframe
>
> end_date = df[-1:]['end']
>
> type(end_date)
> Out[4]: pandas.core.series.Series
>
> end_date
> Out[3]:
> 48173 2017-09-20 04:47:59
> Name: end, dtype: datetime64[ns]
>
> 1.How to get rid of index value 48173 and get
Bill wrote:
> Robin Becker wrote:
>> On 16/09/2017 01:58, Steve D'Aprano wrote:
>>
>>>
>>> If you want to test for None specifically:
>>>
>>> if any(v is None for v in values):
>>> print "at least one value was None"
>>>
>> ...
>>
>> for some reason that seems slow on my machine
leam hall wrote:
> Doesn't seem to work. The failing code takes the strings as is from the
> database. it will occasionally fail when a name comes up that uses
> a non-ascii character.
Your problem in nuce: the Python 2 __str__() method must not return unicode.
>>> class Character:
... def
Leam Hall wrote:
> I do not understand your last sentence about reference cycle.
Currently you have
- create Career instance which stores character as an attribute
- make modifications to character
- forget about Career instance
My suggestion
- create Career instance which stores character
Josef Meile wrote:
> Hi
>
> I'm working with gettext and need to define a language Fallback. I got
> this working, but with a global variable. I don't really like this and I
> would like to pass this variable to the gettext Fallback's contructor, but
> I don't know how. For simplicity, I won't
Andrej Viktorovich wrote:
> Hello,
>
> I have Python package tst in my workspace.
>
> tst has files:
> __init__.py
> tst.py
>
>
> content of __init__.py:
> print("importing Tst")
>
>
> content of tst.py:
> class Tst:
> def __init__(self):
> print("init Tst")
>
>
> I run python
Sambit Samal wrote:
> Hi ,
>
> Need help in Python Script using xml.etree.ElementTree to update the
> value of any element in below XML ( e.g SETNPI to be 5 ) based on some
> constraint ( e.g ) .
Something along the lines
from xml.etree import ElementTree as ET
tree =
Christopher Reimer via Python-list wrote:
> Greetings,
>
> I was playing around this piece of example code (written from memory).
>
>
> def filter_text(key, value):
>
> def do_nothing(text): return text
>
> return {'this': call_this,
>
> 'that': call_that,
>
> 'what': do_nothing
>
>
Christopher Reimer via Python-list wrote:
> Greetings,
>
> I was playing around this piece of example code (written from memory).
>
>
> def filter_text(key, value):
>
> def do_nothing(text): return text
>
> return {'this': call_this,
>
> 'that': call_that,
>
> 'what': do_nothing
>
>
Andrej Viktorovich wrote:
> Hello,
>
> Trying to understand command:
> [p for p in sys.path]
>
> It prints array of paths. I suppose p becomes array of strings but what []
> means in this statement?
This is called "list comprehension", and
paths = [p for p in sys.path if "foo" in p]
is
Charles Hixson wrote:
> python3 --version
> Python 3.5.3
>
> Running on Debian stretch
>
> In this code s is a string parameter
>
> while (j < k and \
> (s[j].isalnum()) or \
>(s[j] in seps and s[j+1].isalnum()) ):
> j = j + 1
> print ("i = {0}, j =
Steve D'Aprano wrote:
> On Sat, 2 Sep 2017 03:13 am, Ganesh Pal wrote:
>
>> Example :
>>
>> "a" and "1" => a0001
>>
>> "a" and "aa" => c00aa
>
> Why does the leading 'a' change to a 'c'? Is that a mistake? I'll assume
> its a typo.
>
> You want string slicing.
>
> base = 'a'
Pavol Lisy wrote:
> On 8/31/17, 20/20 Lab wrote:
>>
>>
>> On 08/31/2017 01:53 AM, Pavol Lisy wrote:
> [...]
>> Valid point, fired up a windows 10 machine and worked as well.
>>
>> Python 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:14:34) [MSC v.1900 32 bit
>> (Intel)] on win32
>>
Sean DiZazzo wrote:
> Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 12:39:47)
> [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
import traceback
tb = traceback.format_exc()
type(tb)
>
tb
>
Steven D'Aprano wrote:
> Three times in the last week the devs where I work accidentally
> introduced bugs into our code because of a mistake with case-insensitive
> string comparisons. They managed to demonstrate three different failures:
>
> # 1
> a = something().upper() # normalise string
>
Steven D'Aprano wrote:
> Wait... are you saying that importing test_mymodule monkey-patches the
> current library? And doesn't un-patch it afterwards? That's horrible.
There's something in the library, unittest.mock that makes this relatively
safe -- if not painless
with
Steve D'Aprano wrote:
> On Tue, 29 Aug 2017 07:09 am, Peter Otten wrote:
>
>> The lesson is that if you use a (sub)module you should never rely on an
>> implicit import.
>
> ... unless the module is documented as automatically importing the
> submodule. An e
Chris Angelico wrote:
> On Tue, Aug 29, 2017 at 4:59 AM, Stefan Ram
> wrote:
>> This might be what one calls "heisenbug":
>>
>> No attribute 'abc' is visible. One tries to
>> study it with "help". And next time it's there.
>> "help" /did/ help!
>>
>> Python 3.6.0
Stefan Ram wrote:
> My course participants always are impatient for "useful
> applications". So at a point in my course where no control
> structures (if, for, while, ...) have been introduced yet,
> but function calls, function declarations, assignments,
> lists and dictionaries
Leam Hall wrote:
> Is this a good way to test if random numeric output? It seems to work
> under Python 2.6 and 3.6 but that doesn't make it 'good'.
>
> ### Code
> import random
>
> def my_thing():
>""" Return a random number from 1-6
>>>> 0 < my_thing() <=6
>True
>>>> 6 <
Christopher Reimer via Python-list wrote:
> On 8/27/2017 1:31 PM, Peter Otten wrote:
>
>> Here's a simple example that extracts titles from generated html. It
>> seems to work. Does it resemble what you do?
> Your example is similar to my code when I'm using a list for the
Christopher Reimer via Python-list wrote:
> On 8/27/2017 11:54 AM, Peter Otten wrote:
>
>> The documentation
>>
>> https://www.crummy.com/software/BeautifulSoup/bs4/doc/#making-the-soup
>>
>> says you can make the BeautifulSoup object from a string or file
Christopher Reimer via Python-list wrote:
> Greetings,
>
> I have Python 3.6 script on Windows to scrape comment history from a
> website. It's currently set up this way:
>
> Requestor (threads) -> list -> Parser (threads) -> queue -> CVSWriter
> (single thread)
>
> It takes 15 minutes to
Stefan Ram wrote:
> This is a transcript:
>
from math import floor
floor( "2.3" )
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: must be real number, not str
help(floor)
> Help on built-in function floor in module math:
>
> floor(...)
> floor(x)
Paul Rubin wrote:
> Ben Finney writes:
>> generate_id = functools.partial(next, itertools.count())
>
> Is something wrong with:
>
> >>> g = itertools.count().next
That question seems to be the topic of this subthread.
Other than the principle "never call a
Peter Otten added the comment:
You have probably written your own re.py file which shadows the one in the
standard library. Once you remove or rename your re.py the error should go away.
--
nosy: +peter.otten
___
Python tracker <
Chet Buell wrote:
> Need some help with updating python to call or start a fortran a.out
> executable
>
> The problem I am having is I have an old Fortran based model that I need
> to run, in the past the fortran was triggered through the following
> python code:
>
> #run fortran
> x =
dieter wrote:
> Ho Yeung Lee writes:
>
>> http://treelib.readthedocs.io/en/latest/examples.html
>>
>> tree = Tree()
>> #create root
>> tree.create_node((0,0), "root")
>> result = [aa[0]]
>> previousnode = (0,0)
>>
> #create root
>> ... tree.create_node((0,0), "root")
jf...@ms4.hinet.net wrote:
> I am running a tkinter tutor downloaded from web,
> https://github.com/daleathan/widget-tour-py3. there are two files
> involved:
>
>
> #file button.py
>
> from tkinter import *
> from tkinter.ttk import *
> import infrastructure
> ...
> class
Peter Otten added the comment:
Read the documentation of os.walk() again. It already walks the complete
directory tree starting with src.
When you invoke it again by calling your copy_dir() method recursively you will
of course see once more the files and directories in the respective
Friedrich Rentsch wrote:
> Hi,
>
> I work interactively in an IDLE window most of the time and find
> "help (...)" very useful to summarize things. The display comes up
> directly (doesn't return a text, which I could edit, assign or store). I
> suspect that there are ways to redirect the
Rustom Mody wrote:
> [ My conjecture: The word ‘comprehension’ used this way in English is
> meaningless and is probably an infelicious translation of something which
> makes sense in German]
The meaning of comprehension is probably closer to "comprise" than
"comprehend".
Marko Rauhamaa wrote:
> Peter Otten <__pete...@web.de>:
>
>> Steve D'Aprano wrote:
>>> The C code says:
>>>
>>>>/* bottom 3 or 4 bits are likely to be 0; rotate y by 4 to avoid
>>>>excessive hash collisions for dicts and sets */
Steve D'Aprano wrote:
> The C code says:
>
>>/* bottom 3 or 4 bits are likely to be 0; rotate y by 4 to avoid
>>excessive hash collisions for dicts and sets */
>
> which I think agrees with my comment: using the id() itself would put too
> many objects in the same bucket (i.e. too many
Steven D'Aprano wrote:
> On Wed, 09 Aug 2017 20:07:48 +0300, Marko Rauhamaa wrote:
>
>> Good point! A very good __hash__() implementation is:
>>
>> def __hash__(self):
>> return id(self)
>>
>> In fact, I didn't know Python (kinda) did this by default already. I
>> can't find that
Ian Pilcher wrote:
> I have created a class to provide a "hash consing"[1] set.
>
>class UniqueSet(frozenset):
>
>_registry = dict()
>
>def __new__(cls, *args, **kwargs):
>set = frozenset(*args, **kwargs)
>try:
>return
Ho Yeung Lee wrote:
> def mse(imageA, imageB):
> err = np.sum((imageA.astype("float") - imageB.astype("float")) ** 2)
> err /= float(imageA.shape[0] * imageA.shape[1])
> return err
>
> original = cv2.imread("C:\\Users\\hello\\Documents\\words\\" + xx)
> later =
Peter Otten wrote:
> What we won't do is write a program for you ready to present to your
> teacher.
I should have known better :(
--
https://mail.python.org/mailman/listinfo/python-list
alon.naj...@gmail.com wrote:
> Hi, I'm new to thing forum and to this programming in python!
>
> can someone help me and write me how to write a program that do:
> - search for a string in certain text file and if it founds the string it
> delete the file? and print something?
Programming is
Tim Daneliuk wrote:
> On 08/02/2017 10:05 AM, Daiyue Weng wrote:
>> Hi, I am trying to removing extra quotes from a large set of strings (a
>> list of strings), so for each original string, it looks like,
>>
>> """str_value1"",""str_value2"",""str_value3"",1,""str_value4"""
>>
>>
>> I like to
Daiyue Weng wrote:
> On 2 August 2017 at 19:13, Peter Otten <__pete...@web.de> wrote:
>
>> Daiyue Weng wrote:
>>
>> > Hi, I am trying to removing extra quotes from a large set of strings (a
>> > list of strings), so for each original string, it looks li
Daiyue Weng wrote:
> Hi, I am trying to removing extra quotes from a large set of strings (a
> list of strings), so for each original string, it looks like,
>
> """str_value1"",""str_value2"",""str_value3"",1,""str_value4"""
Where did you get that strange list from in the first place?
If it is
501 - 600 of 5501 matches
Mail list logo