Re: How well do you know Python?

2016-07-05 Thread Carl Meyer
On 07/05/2016 05:50 AM, Chris Angelico wrote: > On Tue, Jul 5, 2016 at 9:33 PM, Peter Otten <__pete...@web.de> wrote: >> Chris Angelico wrote: >> >>> On Tue, Jul 5, 2016 at 6:36 PM, Peter Otten <__pete...@web.de> wrote: What will $ cat foo.py import foo class A: pass p

Re: pytz and Python timezones

2016-06-12 Thread Carl Meyer
Hi Johannes, On 06/11/2016 05:37 AM, Johannes Bauer wrote: > I try to create a localized timestamp > in the easiest possible way. So, intuitively, I did this: > > datetime.datetime(2016,1,1,0,0,0,tzinfo=pytz.timezone("Europe/Berlin")) That is indeed intuitive, but unfortunately (due to a misunde

Re: recursive methods require implementing a stack?

2016-04-06 Thread Carl Meyer
On 04/06/2016 03:08 PM, Random832 wrote: > On Wed, Apr 6, 2016, at 16:21, Charles T. Smith wrote: >> I just tried to write a recursive method in python - am I right that >> local >> variables are only lexically local scoped, so sub-instances have the same >> ones? Is there a way out of that? Do I

Re: Missing something about timezones

2016-03-14 Thread Carl Meyer
Hi Skip, On 03/14/2016 09:32 AM, Skip Montanaro wrote: > On Mon, Mar 14, 2016 at 10:26 AM, Ian Kelly wrote: >> Why should it? You only asked pytz for the Chicago timezone. You >> didn't ask for it relative to any specific time. > > Thanks. I thought using America/Chicago was supposed to automagi

Re: Continuing indentation

2016-03-02 Thread Carl Meyer
On 03/02/2016 04:54 PM, Chris Angelico wrote: > On Thu, Mar 3, 2016 at 10:46 AM, wrote: >> On Wednesday, March 2, 2016 at 3:44:07 PM UTC-5, Skip Montanaro wrote: >>> >>> if (some_condition and >>> some_other_condition and >>> some_final_condition): >>> play_bingo() >>

Re: Importing two modules of same name

2016-02-09 Thread Carl Meyer
Hi Tim, On 02/09/2016 04:23 PM, Tim Johnson wrote: > Before proceding, let me state that this is to satisfy my > curiousity, not to solve any problem I am having. > > Scenario : > Web application developed at /some/dir/sites/flask/ > > If I have a package - let us call it app and in my > /some/d

Re: does the order in which the modules are placed in a file matters ?

2015-12-16 Thread Carl Meyer
Hi Ganesh, On 12/16/2015 09:09 AM, Ganesh Pal wrote: > Iam on python 2.7 and linux .I need to know if we need to place the > modules in a particular or it doesn't matter at all > > order while writing the program As you've probably already noticed, it usually doesn't matter to Python (though it

Re: Python 3 virtualenvs

2015-11-30 Thread Carl Meyer
On 11/30/2015 10:20 AM, Laura Creighton wrote: > In a message of Mon, 30 Nov 2015 09:32:27 -0700, Carl Meyer writes: >>> I think it is only meant to be used by people who want to install >>> packages but not site-wide, but I am not sure about that. >> >> I don&#x

Re: Python 3 virtualenvs

2015-11-30 Thread Carl Meyer
Hi Laura, On 11/29/2015 07:12 AM, Laura Creighton wrote: > pyenv is going away. python -m venv is the preferred way to get a venv > > https://bugs.python.org/issue25154 > > Of course if you try it, you may get: > > Error: Command '['/bin/python3.4', '-Im', 'ensurepip', > '--upgrade', '--def

Re: List comprehension with if-else

2015-10-28 Thread Carl Meyer
Hi Larry, On 10/28/2015 10:25 AM, Larry Martell wrote: > I'm trying to do a list comprehension with an if and that requires an > else, but in the else case I do not want anything added to the list. > > For example, if I do this: > > white_list = [l.control_hub.serial_number if l.wblist == > wbli

Re: Understanding WSGI together with Apache

2015-10-12 Thread Carl Meyer
Hi Johannes, On 10/10/2015 08:24 AM, Johannes Bauer wrote: > I'm running an Apache 2.4 webserver using mod_wsgi 4.3.0. There are two > different applications running in there running on two completely > separate vhosts. > > I'm seeing some weird crosstalk between them which I do not understand. >

Re: True == 1 weirdness

2015-09-16 Thread Carl Meyer
On 09/16/2015 02:29 PM, Mark Lawrence wrote: > On 16/09/2015 18:53, Sven R. Kunze wrote: >> On 16.09.2015 19:39, Steven D'Aprano wrote: >>> node = left <= ptr => right >> >> Wow. I have absolutely no idea what this is supposed to mean. Do you >> care to elaborate? >> >> >> Best, >> Sven > > Simple

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-14 Thread Carl Meyer
Can we please stop cross-posting this thread to python-list and move it to datetime-sig only? I think anyone here on python-list who is sufficiently interested in it can subscribe to datetime-sig. Or the other way around, whatever. I'd just like to stop getting all the messages twice. Carl sig

Re: Are there any "correct" implementations of tzinfo?

2015-09-12 Thread Carl Meyer
On 09/12/2015 12:23 PM, Random832 wrote: > I was trying to find out how arithmetic on aware datetimes is "supposed > to" work, and tested with pytz. When I posted asking why it behaves this > way I was told that pytz doesn't behave correctly according to the way > the API was designed. The tzlocal

Re: Searching for a usable X509 implementation

2015-07-03 Thread Carl Meyer
Hi Dennis, On 07/03/2015 06:11 PM, Dennis Jacobfeuerborn wrote: > Hi, I'm trying to implement certificate functionality in a python app > but after fighting with pyOpenSSL and M2Crypto I'm thinking about > writing wrapper functions for the OpenSSL command line tool instead > or switching the app t

Re: Using a particular python binary with venv

2015-06-01 Thread Carl Meyer
On 06/01/2015 04:07 PM, greenbay.gra...@gmail.com wrote: > On Tuesday, 2 June 2015 09:43:37 UTC+12, Carl Meyer wrote: >> On 06/01/2015 03:33 PM, orotau wrote: >>> According to this >>> https://docs.python.org/3.4/library/venv.html#module-venv 'Each >>&g

Re: Using a particular python binary with venv

2015-06-01 Thread Carl Meyer
On 06/01/2015 03:33 PM, greenbay.gra...@gmail.com wrote: > According to this > https://docs.python.org/3.4/library/venv.html#module-venv 'Each > virtual environment has its own Python binary (allowing creation of > environments with various Python versions)' > > So how would I create a virtual e

Re: mixing set and list operations

2015-04-30 Thread Carl Meyer
Hi Tim, On 04/30/2015 10:07 AM, Tim wrote: > I noticed this today, using Python2.7 or 3.4, and wondered if it is > implementation dependent: > > You can use 'extend' to add set elements to a list and use 'update' to add > list elements to a set. > m = ['one', 'two'] p = set(['three',

Re: Python 3 lack of support for fcgi/wsgi.

2015-03-29 Thread Carl Meyer
On 03/29/2015 09:30 PM, Michael Torrie wrote: > What does this have to do with Python itself? I'm not completely sure, > but maybe it's about the Python community. What's the way forward? I > have no idea. At the very least John is frustrated by the community's > lack of apparent interest in fi

Re: Daylight savings time question

2015-03-25 Thread Carl Meyer
Hi Dan, On 03/24/2015 04:24 PM, Dan Stromberg wrote: > Is there a way of "adding" 4 hours and getting a jump of 5 hours on > March 8th, 2015 (due to Daylight Savings Time), without hardcoding > when to spring forward and when to fall back? I'd love it if there's > some library that'll do this for

Re: Daylight savings time question

2015-03-25 Thread Carl Meyer
On 03/24/2015 04:56 PM, Chris Angelico wrote: > On Wed, Mar 25, 2015 at 9:24 AM, Dan Stromberg wrote: >> Is there a way of "adding" 4 hours and getting a jump of 5 hours on >> March 8th, 2015 (due to Daylight Savings Time), without hardcoding >> when to spring forward and when to fall back? I'd l