Hi all
Some of you may have been following my attempts to modify my asyncio app so
that it does not block when accessing the database. Here is an update.
I came up with what felt like a good idea. Run the database handler in a
separate thread, pass requests to it using a queue.Queue, and get
On 08/02/16 17:12, Ian Kelly wrote:
dict does already expose set-like views. How about:
{k: d[k] for k in d.keys() & s} # d & s
{k: d[k] for k in d.keys() - s} # d - s
Interesting. But seemingly only applies to Python 3.
--
https://mail.python.org/mailman/listinfo/python-list
Chris Angelico wrote:
hash_to_filename = defaultdict(list)
for fn in files:
# Step 1: Hash every file.
hash = calculate_hash(fn)
# Step 2: Locate all pairs of files with identical hashes
hash_to_filename[hash].append(fn)
I think you can avoid hashing the files altogether.
Firs
On Tue, Feb 9, 2016 at 3:13 PM, Steven D'Aprano
wrote:
> On Tuesday 09 February 2016 02:11, Chris Angelico wrote:
>
>> That's fine for comparing one file against one other. He started out
>> by saying he already had a way to compare files for equality. What he
>> wants is a way to capitalize on th
On Feb 8, 2016, at 10:12 PM, srinivas devaki wrote:
>
> On Feb 8, 2016 5:17 PM, "Cem Karan" wrote:
> >
> > On Feb 7, 2016, at 10:15 PM, srinivas devaki
> > wrote:
> > > On Feb 8, 2016 7:07 AM, "Cem Karan" wrote:
> > > > I know that there are methods of handling this from the client-side
>
I have Python 3.4.4 installed on Windows 7, also IPython, scipy, numpy,
statsmodels, and a lot of other modules, and am working through this
tutorial
http://www.analyticsvidhya.com/blog/2016/02/time-series-forecasting-codes-python/
In Ipython notebook I run this code
from statsmodels.tsa.statt
On Tuesday 09 February 2016 02:11, Chris Angelico wrote:
> That's fine for comparing one file against one other. He started out
> by saying he already had a way to compare files for equality. What he
> wants is a way to capitalize on that to find all the identical files
> in a group. A naive appro
On Feb 8, 2016 5:17 PM, "Cem Karan" wrote:
>
> On Feb 7, 2016, at 10:15 PM, srinivas devaki
wrote:
> > On Feb 8, 2016 7:07 AM, "Cem Karan" wrote:
> > > I know that there are methods of handling this from the client-side
(tuples with unique counters come to mind), but if your library can handle
i
On Tue, Feb 9, 2016 at 7:59 AM, Brendan Simon (eTRIX)
wrote:
> My application mainloop (not the threads) needs to be high priority and
> always process as soon as it gets an interrupt. Is using select a good
> way of doing this? How can I ensure that no other threads are utilizing
> the CPU, etc
On Tue, Feb 9, 2016 at 8:45 AM, MrPink wrote:
> I load the lottery drawings into memory for searching with the following code
> although, it is incomplete. I am stuck and need some guidance.
>
> The set datatype seems to be the best for searching, but how best can I
> implement it?
>
> And I wa
On 7 Feb 2016 09:50, "donald alsept via Python-list"
wrote:
>
> Hello,
> I'm trying to install the 3.5.1 of Python and am running windows 7. I
keep getting an error about api-ms-win-crt-runtime-|1-1-0.dll not being
installed. Any advice on what is wrong?
Hi Donald, you're seeing this problem beca
Marco Kaulea writes:
> In one talk (I think it was [1]) it was described that sets are basically
> dicts without the values.
It seems an unhelpful thing to say about ‘set’, I disagree with that
characterisation.
> Therefor it should be easy to apply set operations on dicts
Yes, that's one reas
As I stated in an earlier post, a normal subroutine may turn out to be
blocking. To make it well-behaved under asyncio, you then dutifully tag
the subroutine with "async" and adorn the blocking statement with
"await". Consequently, you put "await" in front of all calls to the
subroutine and cascad
On Mon, Feb 8, 2016 at 2:17 AM, Veek. M wrote:
>
> Exceptions can be raised inside a coroutine using the throw(
>
> Exceptions raised in this manner will originate at the currently
> executing yield state-ment in the coroutine.A coroutine can elect to
> catch exception
This is a continuation of my pursuit to learn Python. I have been tinkering
with this for a number of years and I am back at it again. I am stuck and need
some guidance.
This is related to other posts that I have made in the past.
For example: Searching for Lottery drawing list of ticket matc
"Brendan Simon (eTRIX)" :
> Is using `select` here redundant?
Yes, if you go the thread way, select() is usually redundant and just
gets in the way.
> Does readline block until it sees an end-of-line char? i.e. does it
> only wake up the thread when it has a _complete string_ or a timeout
> of 0
Hi. Need some urgent help.
I have a python app that uses `select` to wait for data from an arm
embedded linux kernel interrupt (every second). The mainloop of the app
then grabs data from some memory mapped area, processes it and then does
a http post to a server.
The problem is the http post c
Hi everyone,
With my talk "Exploring our Python Interpreter", I think this VIM plugin
can be useful for the community. It's a syntax highlighter for the C API
of CPython 3.5 and 3.6. I used Clang for the parsing and automatically
generated the keywords for VIM.
PyObject and the others typede
On 8 February 2016 at 16:53, Random832 wrote:
> On Mon, Feb 8, 2016, at 10:46, Chris Angelico wrote:
>> > I still think we should just retroactively declare 3.5 to be python 5,
>> > and then keep going with python 6, 7, etc...
>>
>> http://dirtsimple.org/2004/12/python-is-not-java.html
>
> Java's
Ian Kelly wrote:
> On Mon, Feb 8, 2016 at 8:36 AM, wrote:
> > I'm playing around with some existing code that uses wxpython. I've
> > been trying to understand a basic bit about the import statement and
> > so went to the beginning of the wxPython on line documents.
> >
> > Going from the top t
On Mon, Feb 8, 2016 at 8:36 AM, wrote:
> I'm playing around with some existing code that uses wxpython. I've
> been trying to understand a basic bit about the import statement and
> so went to the beginning of the wxPython on line documents.
>
> Going from the top to the "Hello World Example" (c
On Mon, Feb 8, 2016 at 8:44 AM, wrote:
> I'm playing with some code that uses the wxpython grid. *Every*
> example I have seen starts with the imports:-
>
> import wx
> import wx.grid as Gridlib
>
> As Gridlib is exactly the same number of characters as wx.grid I
> really don't see the p
On Mon, Feb 8, 2016 at 5:47 AM, Grobu wrote:
> You can use dictionary comprehension :
>
> Say :
> dict1 = {'a': 123, 'b': 456}
> set1 = {'a'}
>
> intersection :
{ key:dict1[key] for key in dict1 if key in set1 }
> {'a': 123}
>
> difference :
{ key:dict1[key] for key in dict1 if not key i
On Mon, Feb 8, 2016, at 10:46, Chris Angelico wrote:
> > I still think we should just retroactively declare 3.5 to be python 5,
> > and then keep going with python 6, 7, etc...
>
> http://dirtsimple.org/2004/12/python-is-not-java.html
Java's hardly the only, or even the first, project to drop a v
I'm playing with some code that uses the wxpython grid. *Every*
example I have seen starts with the imports:-
import wx
import wx.grid as Gridlib
As Gridlib is exactly the same number of characters as wx.grid I
really don't see the point. Am I missing something?
--
Chris Green
·
--
h
I'm playing around with some existing code that uses wxpython. I've
been trying to understand a basic bit about the import statement and
so went to the beginning of the wxPython on line documents.
Going from the top to the "Hello World Example" (can't give URL as the
URL is the same for all the d
On Tue, Feb 9, 2016 at 2:44 AM, Random832 wrote:
> On Mon, Feb 8, 2016, at 10:40, Ian Kelly wrote:
>> Besides, you're forgetting that the whole point of having so many
>> backwards incompatible changes in Python 3 in the first place was to
>> get them out of the way and not have to do them further
On Mon, Feb 8, 2016, at 10:40, Ian Kelly wrote:
> Besides, you're forgetting that the whole point of having so many
> backwards incompatible changes in Python 3 in the first place was to
> get them out of the way and not have to do them further into the
> future. Python 4.0 has never been planned t
On Sat, Feb 6, 2016 at 1:54 PM, Rick Johnson
wrote:
> On Wednesday, February 3, 2016 at 12:02:35 AM UTC-6, John Ladasky wrote:
>
>> Rick, you don't like Python?
>
> If i didn't like Python, then i would happily let it self-
> destruct, yes? The problem is, i *DO* like Python. Python2
> was a great
Am 08.02.16 um 15:34 schrieb jenswaelk...@gmail.com:
Op maandag 8 februari 2016 13:26:56 UTC+1 schreef Peter Otten:
jenswaelk...@gmail.com wrote:
I'm trying to set the geometry of my top window, but the size is
unaffected.
This is the code:
top.geometry('900x460')
thanks a lot for helpi
On Sun, Feb 7, 2016 at 2:58 AM, Chris Angelico wrote:
>
> Would writing a script to figure out whether there are more
> statisticians or programmers be a statistician's job or a
> programmer's?
>
Yes.
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, Feb 9, 2016 at 1:49 AM, Random832 wrote:
> On Sun, Feb 7, 2016, at 20:07, Cem Karan wrote:
>> a) Use Chris Angelico's suggestion and hash each of the files (use the
>> standard library's 'hashlib' for this). Identical files will always have
>> identical hashes, but there may be fa
Random832 writes:
> On Mon, Feb 8, 2016, at 08:32, Matt Wheeler wrote:
>> On 8 February 2016 at 12:17, Jussi Piitulainen wrote:
>> > Also, what would be the nicest current way to express a priority union
>> > of dicts?
>> >
>> > { k:(d if k in d else e)[k] for k in d.keys() | e.keys() }
>>
>> Sin
2016-02-08 11:42 GMT+01:00 :
> Vlastimil Brom wrote:
>>
>> Hi,
>> your code in
>> http://www.salstat.com/news/linking-wxgrid-to-sqlite-database-in-python-an-example
>>
>> seems to work for me after small changes with both python 2.7 and 3.4
>> (using wx Phoenix)
>
> Where are you getting phoenix
On Mon, Feb 8, 2016, at 08:32, Matt Wheeler wrote:
> On 8 February 2016 at 12:17, Jussi Piitulainen
> wrote:
> > Also, what would be the nicest current way to express a priority union
> > of dicts?
> >
> > { k:(d if k in d else e)[k] for k in d.keys() | e.keys() }
>
> Since Python 3.5: {**e, **d}
On Sun, Feb 7, 2016, at 20:07, Cem Karan wrote:
> a) Use Chris Angelico's suggestion and hash each of the files (use the
> standard library's 'hashlib' for this). Identical files will always have
> identical hashes, but there may be false positives, so you'll need to verify
> that files t
Op maandag 8 februari 2016 13:26:56 UTC+1 schreef Peter Otten:
> jenswaelk...@gmail.com wrote:
>
> > I'm trying to set the geometry of my top window, but the size is
> > unaffected.
> > This is the code:
> >
> > #!/usr/bin/env python
> > import Tkinter
> > top=Tkinter.Tk()
> > top.geometry=('900x
Matt Wheeler writes:
> On 8 February 2016 at 12:17, Jussi Piitulainen wrote:
>> Also, what would be the nicest current way to express a priority union
>> of dicts?
>>
>> { k:(d if k in d else e)[k] for k in d.keys() | e.keys() }
>
> Since Python 3.5: {**e, **d}
Thanks. I have considered this news
On 8 February 2016 at 12:17, Jussi Piitulainen
wrote:
> Also, what would be the nicest current way to express a priority union
> of dicts?
>
> { k:(d if k in d else e)[k] for k in d.keys() | e.keys() }
Since Python 3.5: {**e, **d}
--
Matt Wheeler
http://funkyh.at
--
https://mail.python.org/ma
You can use dictionary comprehension :
Say :
dict1 = {'a': 123, 'b': 456}
set1 = {'a'}
intersection :
>>> { key:dict1[key] for key in dict1 if key in set1 }
{'a': 123}
difference :
>>> { key:dict1[key] for key in dict1 if not key in set1 }
{'b': 456}
--
https://mail.python.org/mailman/listinfo
On Mon, Feb 8, 2016 at 1:17 PM, Jussi Piitulainen <
jussi.piitulai...@helsinki.fi> wrote:
> I think nobody was quite willing to lay down the law on which dictionary
> would take precedence when they have keys in common but different values
> on those keys. Both ways make sense, and sometimes you w
jenswaelk...@gmail.com wrote:
> I'm trying to set the geometry of my top window, but the size is
> unaffected.
> This is the code:
>
> #!/usr/bin/env python
> import Tkinter
> top=Tkinter.Tk()
> top.geometry=('900x460')
That's an assignment, but geometry() is a method that you have to invoke:
t
Marco Kaulea writes:
> In one talk (I think it was [1]) it was described that sets are
> basically dicts without the values. Therefor it should be easy to
> apply set operations on dicts, for example:
>
> {'a': 123, 'b': 456} & {'a'} => {'a': 123}
> {'a': 123, 'b': 456} - {'a'} => {'b': 456}
>
>
I'm trying to set the geometry of my top window, but the size is
unaffected.
This is the code:
#!/usr/bin/env python
import Tkinter
top=Tkinter.Tk()
top.geometry=('900x460')
top.update_idletasks()
print (top.winfo_width())
print (top.winfo_height())
print (top.winfo_geometry())
top.mainloop()
and
Hello everyone,
I would like to announce a new mailing list for the Belgian Python
Users.
This main goal of this mailing list is mainly for the Python Community
of Belgium, Dutch, French and German.
The main language is English, I don’t want to discuss about the
languages, maybe in the futur
egarr...@gmail.com wrote:
> I am using the "logging" module for my own package, but changing the level
> from "INFO" to "DEBUG" enables debugging statements from third-party
> libraries as well. How can I avoid them? Here is the code I am using:
>
> import logging
>
> logger = logging.
On 02/08/2016 12:29 PM, egarr...@gmail.com wrote:
I am using the "logging" module for my own package, but changing the level from "INFO" to
"DEBUG" enables debugging statements from third-party libraries as well. How can I avoid them?
Here is the code I am using:
import logging
lo
On Feb 7, 2016, at 10:15 PM, srinivas devaki wrote:
> On Feb 8, 2016 7:07 AM, "Cem Karan" wrote:
> > I know that there are methods of handling this from the client-side (tuples
> > with unique counters come to mind), but if your library can handle it
> > directly, then that could be useful to o
I am using the "logging" module for my own package, but changing the level from
"INFO" to "DEBUG" enables debugging statements from third-party libraries as
well. How can I avoid them? Here is the code I am using:
import logging
logger = logging.getLogger(__name__)
log_file = logg
On Monday, February 8, 2016 at 10:50:19 AM UTC, Mark Summerfield wrote:
> If you need 32-bit Python on Windows my advice is to install 3.4. If you need
> 32-bit and 64-bit Python on Windows, then I think it will only work with 3.4
> (or older), but not with 3.5's new installer.
>
> I have tried
On Mon, Feb 8, 2016 at 9:22 PM, wrote:
>> Once you switch to Python 3 and Phoenix you have to modify this
>> slightly, e.g. by adding this to the top of your code:
>>
>> try:
>> basestring
>> except:
>> basestring = (bytes,str)
>>
> Everything else is 3 compatible so moving should be fair
On Mon, Feb 8, 2016 at 9:42 PM, wrote:
> Vlastimil Brom wrote:
>>
>> Hi,
>> your code in
>> http://www.salstat.com/news/linking-wxgrid-to-sqlite-database-in-python-an-example
>>
>> seems to work for me after small changes with both python 2.7 and 3.4
>> (using wx Phoenix)
>
> Where are you getti
If you need 32-bit Python on Windows my advice is to install 3.4. If you need
32-bit and 64-bit Python on Windows, then I think it will only work with 3.4
(or older), but not with 3.5's new installer.
I have tried installing 3.5.0 and 3.5.1 on several machines both 32- and 64-bit
Windows. The 3
Vlastimil Brom wrote:
>
> Hi,
> your code in
> http://www.salstat.com/news/linking-wxgrid-to-sqlite-database-in-python-an-example
>
> seems to work for me after small changes with both python 2.7 and 3.4
> (using wx Phoenix)
Where are you getting phoenix from? It's not in the Ubuntu
repositori
Dietmar Schwertberger wrote:
> On 07.02.2016 12:19, c...@isbd.net wrote:
> > However my database has quite a lot of Unicode data as there are
> > French (and other) names with accents etc. What's the right way to
> > handle this reasonably neatly? At the moment it traps an error at
> > line 37:-
Hi,
In one talk (I think it was [1]) it was described that sets are basically
dicts without the values.
Therefor it should be easy to apply set operations on dicts, for example:
{'a': 123, 'b': 456} & {'a'} => {'a': 123}
{'a': 123, 'b': 456} - {'a'} => {'b': 456}
This if currently not implemented
Veek. M wrote:
>
> Exceptions can be raised inside a coroutine using the throw(
>
> Exceptions raised in this manner will originate at the currently
> executing yield state-ment in the coroutine.A coroutine can elect to
> catch exceptions and handle them as appropriat
Exceptions can be raised inside a coroutine using the throw(
Exceptions raised in this manner will originate at the currently
executing yield state-ment in the coroutine.A coroutine can elect to
catch exceptions and handle them as appropriate. It is not safe to use
On 2/4/2016 4:39 AM, Prince Thomas wrote:
Hi
I am an computer science engineer. I downloaded the python version 3.5.1.amd64
and just python 3.5.1.
The problem is when I install the program setup is failed and showing
0*80070570-The file or directory is
corrupted and unreadable. I install the n
On 2/3/2016 1:55 PM, Barrie Taylor wrote:
Hi,
I am attempting to install and run Python3.5.1 on my Windows machine.
After installation on launching I am presented the attached error message.
It reads:
'The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing
from your compu
On Sunday, February 7, 2016 at 1:23:32 AM UTC-7, dieter wrote:
> Shaunak Bangale writes:
> > ...
> > while (count > 0):
> > try :
> > # read line from file:
> > print(file.readline())
> > # parse
> > parse_json(file.readline())
> > count = count - 1
> >
61 matches
Mail list logo