pip does not work anymore

2015-11-23 Thread Cecil Westerhof
When I try to install something with pip2 I get: Traceback (most recent call last): File "/usr/bin/pip2", line 9, in load_entry_point('pip==7.1.2', 'console_scripts', 'pip2')() File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 558, in load_entry_point

Re: pip does not work anymore

2015-11-23 Thread Laura Creighton
In a message of Mon, 23 Nov 2015 08:48:54 +0100, Cecil Westerhof writes: >When I try to install something with pip2 I get: >Traceback (most recent call last): > File "/usr/bin/pip2", line 9, in >load_entry_point('pip==7.1.2', 'console_scripts', 'pip2')() > File "/usr/lib/pyth

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-23 Thread Chris Angelico
On Fri, Nov 20, 2015 at 6:46 AM, Chris Angelico wrote: > The expressions would be evaluated as closures, using the same scope > that the function's own definition used. (This won't keep things alive > unnecessarily, as the function's body will be nested within that same > scope anyway.) Bikeshed t

Re: Is there an meaning of '[[]]' in a list?

2015-11-23 Thread Peter Otten
Quivis wrote: > On Thu, 19 Nov 2015 12:40:17 +0100, Peter Otten wrote: > >> those questions that are a little harder > > And just how is he going to determine what is hard? Note that I said "a little harder", not "hard". Write down your next ten or so questions, then work through the tutorial

Re: pip does not work anymore

2015-11-23 Thread Cecil Westerhof
On Monday 23 Nov 2015 09:11 CET, Laura Creighton wrote: > In a message of Mon, 23 Nov 2015 08:48:54 +0100, Cecil Westerhof > writes: >> When I try to install something with pip2 I get: Traceback (most >> recent call last): File "/usr/bin/pip2", line 9, in >> load_entry_point('pip==7.1.2', 'consol

Creating a Dynamic Website Using Python

2015-11-23 Thread Cai Gengyang
Ok, So I have gone through the CodeAcademy Python modules and decided to jump straight into a project. I want to create a dynamic web-based site like this --- https://www.wedpics.com using Python How / where do I start ? Thanks a lot ! Gengyang -- https://mail.python.org/mailman/listinf

Re: What is a function parameter =[] for?

2015-11-23 Thread BartC
On 23/11/2015 07:47, Steven D'Aprano wrote: I think it would be cleaner and better if Python had dedicated syntax for declaring static local variables: Interesting. So why is it that when /I/ said: > On Mon, 23 Nov 2015 12:21 am, BartC wrote: > >> But if it's used for static storage, then why

Re: Creating a Dynamic Website Using Python

2015-11-23 Thread Mark Lawrence
On 23/11/2015 09:55, Cai Gengyang wrote: Ok, So I have gone through the CodeAcademy Python modules and decided to jump straight into a project. I want to create a dynamic web-based site like this --- https://www.wedpics.com using Python How / where do I start ? With a search engine, or do

Re: What is a function parameter =[] for?

2015-11-23 Thread Mark Lawrence
On 23/11/2015 00:37, BartC wrote: On 23/11/2015 00:04, Mark Lawrence wrote: On 22/11/2015 23:44, Steven D'Aprano wrote: On Mon, 23 Nov 2015 12:21 am, BartC wrote: But if it's used for static storage, then why not just use static storage? That's a simpler and more general concept than memoisat

Re: pip does not work anymore

2015-11-23 Thread Cecil Westerhof
On Monday 23 Nov 2015 08:48 CET, Cecil Westerhof wrote: > When I try to install something with pip2 I get: Traceback (most > recent call last): File "/usr/bin/pip2", line 9, in > load_entry_point('pip==7.1.2', 'console_scripts', 'pip2')() File > "/usr/lib/python2.7/site-packages/pkg_resources/__i

Let urllib3 use ssl3 instead of ssl2

2015-11-23 Thread Cecil Westerhof
For a program I need to import urllib3, but this gives: ImportError: /usr/lib64/python2.7/lib-dynload/_ssl.so: undefined symbol: SSLv2_method This probably has to do with that openSUSE removed ssl2 because it is not secure. Is there a way to let urllib3 use ssl3 instead of ssl2? -- Cecil We

Re: What is a function parameter =[] for?

2015-11-23 Thread Ned Batchelder
On Monday, November 23, 2015 at 6:35:35 AM UTC-5, Mark Lawrence wrote: > On 23/11/2015 00:37, BartC wrote: > > On 23/11/2015 00:04, Mark Lawrence wrote: > >> What happened to "Please do not feed the trolls"? > > > > You mean, people with different opinions? > > > > I think I'm done here. > > > > W

Re: Creating a Dynamic Website Using Python

2015-11-23 Thread Chris Angelico
On Mon, Nov 23, 2015 at 8:55 PM, Cai Gengyang wrote: > So I have gone through the CodeAcademy Python modules and decided to jump > straight into a project. > > I want to create a dynamic web-based site like this --- > https://www.wedpics.com using Python > > How / where do I start ? While it's

Re: What is a function parameter =[] for?

2015-11-23 Thread Marko Rauhamaa
BartC : > I think I'm done here. Bart, this is the internet. Just skip the articles you don't find uplifting. Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: pip does not work anymore

2015-11-23 Thread Steven D'Aprano
On Mon, 23 Nov 2015 06:48 pm, Cecil Westerhof wrote: > When I try to install something with pip2 I get: > Traceback (most recent call last): [...] > from urllib2 import (Request, urlopen, URLError, HTTPError, > ImportError: cannot import name HTTPSHandler Before blaming SUSE for b

Re: Creating a Dynamic Website Using Python

2015-11-23 Thread Cai Gengyang
Ok, I will look through the Flask tutorials then ... On Monday, November 23, 2015 at 8:21:28 PM UTC+8, Chris Angelico wrote: > On Mon, Nov 23, 2015 at 8:55 PM, Cai Gengyang wrote: > > So I have gone through the CodeAcademy Python modules and decided to jump > > straight into a project. > > > >

How to remember last position and size (geometry) of PyQt application?

2015-11-23 Thread Santosh Kumar
Hello all fellow Python programmers! I am using PyQt5 (5.5.1) with Python 3.4.0 (64-bit) on Windows 8.1 64-bit. I don't think this much data was needed. :P I am having trouble restoring the position and size (geometry) of my very simple PyQt app. What I read online is that this is the default be

Re: What is a function parameter =[] for?

2015-11-23 Thread Steven D'Aprano
On Mon, 23 Nov 2015 09:40 pm, BartC wrote: > On 23/11/2015 07:47, Steven D'Aprano wrote: > >> I think it would be cleaner and better if Python had dedicated syntax for >> declaring static local variables: > > Interesting. So why is it that when /I/ said: > > > On Mon, 23 Nov 2015 12:21 am, Bar

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-23 Thread Ian Kelly
On Mon, Nov 23, 2015 at 1:23 AM, Chris Angelico wrote: > def latearg(f): > tot_args = f.__code__.co_argcount > min_args = tot_args - len(f.__defaults__) > defs = f.__defaults__ > # With compiler help, we could get the original text as well as something > # executable that works

Re: non-blocking getkey?

2015-11-23 Thread Ulli Horlacher
eryksun wrote: > On Thu, Nov 19, 2015 at 10:31 AM, Michael Torrie wrote: > > One windows it might be possible to use the win32 api to enumerate the > > windows, find your console window and switch to it. > > You can call GetConsoleWindow [1] and then SetForegroundWindow [2]. (...) Sorry, for th

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-23 Thread Chris Angelico
On Tue, Nov 24, 2015 at 3:40 AM, Ian Kelly wrote: > On Mon, Nov 23, 2015 at 1:23 AM, Chris Angelico wrote: >> def latearg(f): >> tot_args = f.__code__.co_argcount >> min_args = tot_args - len(f.__defaults__) >> defs = f.__defaults__ >> # With compiler help, we could get the origin

Designing DBI compliant SQL parameters for module

2015-11-23 Thread Israel Brewster
My company uses a database (4th dimension) for which there was no python DBI compliant driver available (I had to use ODBC, which I felt was cludgy). However, I did discover that the company had a C driver available, so I went ahead and used CFFI to wrap this driver into a DBI compliant python m

Re: pip does not work anymore

2015-11-23 Thread Cecil Westerhof
On Monday 23 Nov 2015 14:08 CET, Steven D'Aprano wrote: > On Mon, 23 Nov 2015 06:48 pm, Cecil Westerhof wrote: > >> When I try to install something with pip2 I get: >> Traceback (most recent call last): > [...] >> from urllib2 import (Request, urlopen, URLError, HTTPError, >> ImportError: cannot i

Bi-directional sub-process communication

2015-11-23 Thread Israel Brewster
I have a multi-threaded python app (CherryPy WebApp to be exact) that launches a child process that it then needs to communicate with bi-driectionally. To implement this, I have used a pair of Queues: a child_queue which I use for master->child communication, and a master_queue which is used for

Re: Bi-directional sub-process communication

2015-11-23 Thread Ian Kelly
On Mon, Nov 23, 2015 at 10:54 AM, Israel Brewster wrote: > Concern: Since the master process is multi-threaded, it seems likely enough > that multiple threads on the master side would make requests at the same > time. I understand that the Queue class has locks that make this fine (one > thread

Re: Bi-directional sub-process communication

2015-11-23 Thread Ian Kelly
On Mon, Nov 23, 2015 at 12:55 PM, Ian Kelly wrote: > On Mon, Nov 23, 2015 at 10:54 AM, Israel Brewster > wrote: >> Concern: Since the master process is multi-threaded, it seems likely enough >> that multiple threads on the master side would make requests at the same >> time. I understand that

Re: Problem to read from array

2015-11-23 Thread Crane Ugly
Thank you all. Here is the last piece of code that caused me so much troubles but now working the way I wanted it: fRawData = [] with open(fStagingFile2) as fStagingFile2FH: fRawData = [line.strip() for line in fStagingFile2FH.readlines()] # This is

Re: Bi-directional sub-process communication

2015-11-23 Thread Israel Brewster
On Nov 23, 2015, at 11:51 AM, Ian Kelly wrote: > > On Mon, Nov 23, 2015 at 12:55 PM, Ian Kelly wrote: >> On Mon, Nov 23, 2015 at 10:54 AM, Israel Brewster >> wrote: >>> Concern: Since the master process is multi-threaded, it seems likely enough >>> that multiple threads on the master side wou

Re: Bi-directional sub-process communication

2015-11-23 Thread Cameron Simpson
On 23Nov2015 12:22, Israel Brewster wrote: On Nov 23, 2015, at 11:51 AM, Ian Kelly wrote: Concurrency, ugh. I'm a big concurrency fan myself. It's probably better just to have a Condition/Event per thread and have the response thread identify the correct one to notify, rather than just not

Re: Bi-directional sub-process communication

2015-11-23 Thread Israel Brewster
On Nov 23, 2015, at 12:45 PM, Cameron Simpson wrote: > > On 23Nov2015 12:22, Israel Brewster wrote: >> On Nov 23, 2015, at 11:51 AM, Ian Kelly wrote: >>> Concurrency, ugh. > > I'm a big concurrency fan myself. > >>> It's probably better just to have a Condition/Event per thread and >>> have t

Re: Bi-directional sub-process communication

2015-11-23 Thread Chris Kaynor
On Mon, Nov 23, 2015 at 2:18 PM, Israel Brewster wrote: > Of course, that last step could be interesting - implementing the block in > such a way as to not tie up the processor, while still getting the data "as > soon" as it is available. Unless there is some sort of built-in > notification syste

Re: Bi-directional sub-process communication

2015-11-23 Thread Israel Brewster
On Nov 23, 2015, at 1:43 PM, Chris Kaynor wrote: > > On Mon, Nov 23, 2015 at 2:18 PM, Israel Brewster > wrote: > >> Of course, that last step could be interesting - implementing the block in >> such a way as to not tie up the processor, while still getting the data "as >> soon" as it is availab

Re: Bi-directional sub-process communication

2015-11-23 Thread Israel Brewster
On Nov 23, 2015, at 3:05 PM, Dennis Lee Bieber wrote: > > On Mon, 23 Nov 2015 08:54:38 -0900, Israel Brewster > declaimed the following: > >> Concern: Since the master process is multi-threaded, it seems likely enough >> that multiple threads on the master side would make requests at the same

Re: Problem to read from array

2015-11-23 Thread sohcahtoa82
On Monday, November 23, 2015 at 12:58:49 PM UTC-8, Crane Ugly wrote: > Thank you all. > Here is the last piece of code that caused me so much troubles but now > working the way I wanted it: > > fRawData = [] > with open(fStagingFile2) as fStagingFile2FH: > fRawData = [l

Re: pip does not work anymore

2015-11-23 Thread sohcahtoa82
On Sunday, November 22, 2015 at 11:59:13 PM UTC-8, Cecil Westerhof wrote: > When I try to install something with pip2 I get: > Traceback (most recent call last): > File "/usr/bin/pip2", line 9, in > load_entry_point('pip==7.1.2', 'console_scripts', 'pip2')() > File "/usr/li

tuples in conditional assignment

2015-11-23 Thread George Trojan
The following code has bitten me recently: >>> t=(0,1) >>> x,y=t if t else 8, 9 >>> print(x, y) (0, 1) 9 I was assuming that a comma has the highest order of evaluation, that is the expression 8, 9 should make a tuple. Why this is not the case? George -- https://mail.python.org/mailman/list

Re: tuples in conditional assignment

2015-11-23 Thread Ben Finney
George Trojan writes: > The following code has bitten me recently: > > >>> t=(0,1) > >>> x,y=t if t else 8, 9 > >>> print(x, y) > (0, 1) 9 You can simplify this by taking assignment out of the picture:: >>> t = (0, 1) >>> t if t else 8, 9 ((0, 1), 9) So that's an “expression list”

Re: Bi-directional sub-process communication

2015-11-23 Thread Cameron Simpson
On 24Nov2015 16:25, Cameron Simpson wrote: Completely untested example code: class ReturnEvent: def __init__(self): self.event = Event() With, of course: def wait(self): return self.event.wait() Cheers, Cameron Simpson Maintainer's Motto: If we can't fix it, it ain't broke.

Re: Bi-directional sub-process communication

2015-11-23 Thread Cameron Simpson
On 23Nov2015 14:14, Israel Brewster wrote: On Nov 23, 2015, at 1:43 PM, Chris Kaynor wrote: On Mon, Nov 23, 2015 at 2:18 PM, Israel Brewster wrote: 3. Have an event per thread. This will use less CPU than the second option, however does require more memory and OS resources, and so will no

3.5 64b windows

2015-11-23 Thread Bernard Baillargeon
I'd just installed py3.5 most recent (downloaded, installed 11/23/15) and when starting via the windows start (win 8.1pro) shortcut, I always get this error. I'd navigated to the program directory (it installed in C:\Users\my-ID\AppData\Local\Programs\Python\Python35) and started the python.exe an

[argparse] optional parameter without --switch

2015-11-23 Thread c.buhtz
I want to call (on bash) a Python script in this two ways without any error. ./arg.py ./arg.py TEST It means that the parameter (here with the value `TEST`) should be optional. With argparse I only know a way to create optional paramters when they have a switch (like `--name`). Is there

[no subject]

2015-11-23 Thread sridhar gunasekaran
Hai I have installed python 3.5 in my pc I could not see any application icon or application shortcut on my pc Sent from Mail for Windows 10 -- https://mail.python.org/mailman/listinfo/python-list

Re: How to remember last position and size (geometry) of PyQt application?

2015-11-23 Thread Santosh Kumar
This question was reasked and answered on StackOverflow: http://stackoverflow.com/q/33869721/939986 -- https://mail.python.org/mailman/listinfo/python-list

[no subject]

2015-11-23 Thread Alexandre Barreto
I install python 3.5.0 and run eazy to install and my antivírus detect and trogen can you explay cus im new to this language. -- https://mail.python.org/mailman/listinfo/python-list

Re: 3.5 64b windows

2015-11-23 Thread Chris Angelico
On Tue, Nov 24, 2015 at 11:58 AM, Bernard Baillargeon wrote: > I'd just installed py3.5 most recent (downloaded, installed 11/23/15) and > when starting via the windows start (win 8.1pro) shortcut, I always get this > error. If you attached something, it didn't arrive. Can you type in the text of