Re: New Python curses book

2021-03-30 Thread Brian Oney via Python-list
Congratulations! Indeed, I was wondering for a moment if this was a guide to al dente spaghetti code. With each curse being a funny way to mess with the colleagues performing the code review ;) Or a list of funny Monty Python curses? Or a set of programming problems that are cursed? On Marc

Re: Python Pandas split Date in day month year and hour

2020-08-19 Thread Brian Oney via Python-list
On August 19, 2020 7:32:45 PM GMT+02:00, J Conrado wrote: > > >Hi, > > >I'm satarting using Pandas to read excel. I have a meteorological >synoptic data and I have for date: > > >0   2017-11-01 00:00:00 >1   2017-11-01 03:00:00 >2   2017-11-01 06:00:00 >3   2017-11-01 09:00:00 >4   2017-11-01

Re: 3rd party mail package

2019-12-13 Thread Brian Oney via Python-list
How about a 1st party package in the stdlib? >From the hip: Take an example or two from the 'python 2 or 3 standard library >by example' book by a guy named Doug. Hth (really) -- https://mail.python.org/mailman/listinfo/python-list

Re: a regex question

2019-10-25 Thread Brian Oney via Python-list
On October 25, 2019 12:22:44 PM GMT+02:00, Maggie Q Roth wrote: >Hello > >There are two primary types of lines in the log: > >60.191.38.xx/ >42.120.161.xx /archives/1005 > >I know how to write regex to match each line, but don't get the good >result >with one regex to match both

Re: python is bugging

2019-09-21 Thread Brian Oney via Python-list
On Sat, 2019-09-21 at 08:57 -0700, Dave Martin wrote: > On Saturday, September 21, 2019 at 11:55:29 AM UTC-4, Dave Martin > wrote: > > what does expected an indented block > > *what does an indented block mean? It means that the line of code belongs to a certain body as defined above its position

Re: Web framework for static pages

2019-08-13 Thread Brian Oney via Python-list
On August 13, 2019 4:00:30 PM GMT+02:00, "Morten W. Petersen" wrote: >Ok. Isn't it a bit splitting of hairs to talk about static site >generators >and their templates? > >Wouldn't a static site generator that can create a good, usable website >with little input be desirable? > >I could pick an

Re: Web framework for static pages

2019-08-12 Thread Brian Oney via Python-list
On August 12, 2019 9:14:55 AM GMT+02:00, morphex wrote: >Hi. > >What frameworks are there for generating static web pages in Python? I have used: https://github.com/Frozen-Flask/Frozen-Flask It's pretty simple. Develop with flask and then "freeze" it. I am looking forward to further answers

Re: Please help me

2019-08-06 Thread Brian Oney via Python-list
On Mon, 2019-08-05 at 21:10 +0430, arash kohansal wrote: > Hello ive just installed python on my pc and ive already check the > path > choice part but microsoft visual code can not find it and it does not > have > the reload item Check out: https://code.visualstudio.com/docs/languages/python or

Re: Proper shebang for python3

2019-07-21 Thread Brian Oney via Python-list
On July 21, 2019 10:04:47 AM GMT+02:00, Manfred Lotz wrote: >On Sun, 21 Jul 2019 10:21:55 +1000 >Cameron Simpson wrote: > >> On 21Jul2019 09:31, Chris Angelico wrote: >> >On Sun, Jul 21, 2019 at 9:15 AM Cameron Simpson >> >wrote: So you mean that a tool that depends on running on a >> >c

Re: Proper shebang for python3

2019-07-20 Thread Brian Oney via Python-list
On Sat, 2019-07-20 at 15:26 -0500, Tim Daneliuk wrote: > On 7/20/19 2:56 PM, Peter J. Holzer wrote: > > On 2019-07-20 14:11:44 -0500, Tim Daneliuk wrote: > > > So, no, do NOT encode the hard location - ever. Always use env to > > > discover the one that the user has specified. The only exception

Re: CAD Application

2019-05-06 Thread Brian Oney via Python-list
FreeCAD is written in Python. It has a python interpreter. -- https://mail.python.org/mailman/listinfo/python-list

Re: PYTHON equivalents of BITAND and BITSHIFT of MATLAB

2019-05-01 Thread Brian Oney via Python-list
On Wed, 2019-05-01 at 10:35 -0700, blmadha...@gmail.com wrote: > Hi, > > I have the following line from a MATLAB program with FCF (format: UInt_16) as > input: > > ftype = bitand(FCF, 7) > typeBits = bitshift(FCF, -9) > subtype = bitand(typeBits, 7) > > I wrote the following in Python for the a

Re: How to find files with a string

2019-01-09 Thread Brian Oney via Python-list
On Wed, 2019-01-09 at 08:29 -0800, anton.gridus...@gmail.com wrote: > Hello everyone! > > I need to find a file, that contains a string TeNum > > I try to > > import os > import sys > def find_value(fname): > value = 0 > with open(fname, encoding='cp866') as fn: > try: >

Re: mouse click automation

2019-01-01 Thread Brian Oney via Python-list
I am unfamiliar with pynput. I have had good experience with pyautogui. As your script isn't yet advanced, you may consider it. https://pyautogui.readthedocs.io/en/latest/introduction.html -- https://mail.python.org/mailman/listinfo/python-list

Re: What Python books to you recommend to beginners?

2018-11-28 Thread Brian Oney via Python-list
On Wed, 2018-11-28 at 08:44 -0600, Skip Montanaro wrote: > What do people recommend? The target is Python 3.6 and 3.7. The > audience at work is a mostly financial/statistical crowd, so exposure > to things like Pandas would be nice, though I'm sure there are > dedicated books for just that. Given

Re: Error Python version 3.6 does not support this syntax.

2018-11-27 Thread Brian Oney via Python-list
On Tue, 2018-11-27 at 13:50 +0100, srinivasan wrote: > > *except BluetoothctlError, e:* > I don't have python3.6 available, but I believe the proper syntax is: except BluetoothctlError as e: print(e) See: https://docs.python.org/3/tutorial/errors.html?highlight=exception HTW -- h

Re: how to match list members in py3.x

2018-11-25 Thread Brian Oney via Python-list
On Sun, 2018-11-25 at 07:43 -0800, Muhammad Rizwan wrote: > for each word in each line how can we check to see if a word is already > present in a list and if it is not how to append that word to a new list For your problem consider a set. https://en.wikipedia.org/wiki/Set_theory For the python

Re: All of a sudden code started throwing errors

2018-11-14 Thread Brian Oney via Python-list
On Wed, 2018-11-14 at 09:47 +0100, srinivasan wrote: > -68 >= -60 It's a problem with your test of wifi strength. Good job of making informative output and running tests! -- https://mail.python.org/mailman/listinfo/python-list

Re: IDLE Default Working Directory

2018-11-14 Thread Brian Oney via Python-list
On Tue, 2018-11-13 at 10:33 -0600, Bev in TX wrote: > > On Nov 12, 2018, at 10:07 AM, Brian Oney > > wrote: > > On Mon, 2018-11-12 at 09:35 -0600, Bev in TX wrote: > > > I am not the OP and I’m on macOS — no shortcuts. How would one do the > > > same thing on other platforms? > > > Bev in TX >

Re: IDLE Default Working Directory

2018-11-12 Thread Brian Oney via Python-list
On Mon, 2018-11-12 at 09:35 -0600, Bev in TX wrote: > On Nov 12, 2018, at 9:16 AM, eryk sun wrote: > > On 11/12/18, Christman, Roger Graydon mailto:d...@psu.edu>> > > wrote: > > > I looked in IDLE's own configuration menu, and didn't see anything there > > > -- > > > and I fear that I might have

Re: Issue in parsing the strings in python code

2018-11-12 Thread Brian Oney via Python-list
On Mon, 2018-11-12 at 14:17 +, Rhodri James wrote: > On 12/11/2018 09:37, srinivasan wrote: > > Because the problem is every time when ever I see the output using the > > "nmcli c show", the below output is the weird output, so instead of > > connecting to SSID "NIFunkloch" it randomly connect

[ANN] maildog, Re: email automation

2018-10-30 Thread Brian Oney via Python-list
On Tue, 2018-10-23 at 13:58 +0200, Brian J. Oney wrote: > On Tue, 2018-10-23 at 10:31 +0100, Ali Rıza KELEŞ wrote: > > On Tue, 23 Oct 2018 at 09:07, Thomas Jollans wrote: > Now that it seems that I will be writing this. So I have gotten so far as to have a little package called 'maildog' working

Re: regular expression problem

2018-10-28 Thread Brian Oney via Python-list
On Sun, 2018-10-28 at 22:04 +0100, Karsten Hilbert wrote: > [^<:] Would a simple regex work? I mean: ~$ python Python 2.7.13 (default, Sep 26 2018, 18:42:22)  [GCC 6.3.0 20170516] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import re >>> t = '$$' >>> re.f

Re: Accessing clipboard through software built on Python

2018-10-28 Thread Brian Oney via Python-list
You don't have to start from scratch. You don't to do anything other than learn to use anamnesis. I use anamnesis as my clipboard manager. I you can easily tell to get which ever one you want (i.e. the thousandth item). # Inform yourself https://sourceforge.net/projects/anamnesis/ # Install it

email automation

2018-10-22 Thread Brian Oney via Python-list
Dear List, I would like to send out custom automated replies to email. In the future, I would like to be able to integrate nltk and fuzzy matching if necessary. After some basic research I have a few options: 1. Grapple with OpenEMM (interesting software, has python library, still alive an

Re: ESR "Waning of Python" post

2018-10-16 Thread Brian Oney via Python-list
On October 17, 2018 7:56:51 AM GMT+02:00, Marko Rauhamaa wrote: >I can't be positive about swapping. I don't remember hearing thrashing. >However, I do admit running emacs for months on end and occasionally >with huge buffers so the resident size can be a couple of gigabytes. > That's a pretty

Re: JPEGImage() hangs

2018-09-27 Thread Brian Oney via Python-list
Could you please try another tool like `convert'? E.g. $ convert 102_PANA/P1020466.JPG test.png What does that say? -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT] master/slave debate in Python

2018-09-26 Thread Brian Oney via Python-list
> PS: I'm not a great fan of it, but I think we all know that off-topic is > in a way what this list excels at. +1 An open source community thrives on being open. It also welcomes those who like to pick a fight for various, usually personal reasons. Has any heard of that Python language? I hear

Re: 2 Bugs: in Python 3 tutorial, and in bugs.python.org tracker registration system

2018-09-22 Thread Brian Oney via Python-list
That's one thing that confused me. Generators are supposed to be one-off iterators. Iterators, *I understood* as reusable iterables. -- https://mail.python.org/mailman/listinfo/python-list

Re: What is not working with my "map" usage?

2018-09-21 Thread Brian Oney via Python-list
Hi Viet, map applies the function to each of the elements of the list you provide. It would be roughly equivalent to: [add_all_elements(x) for x in alist] It may help you to consider the term and function "map" from the view of linear algebra. Apparently it's a common term: https://en.wikiped

Re: Fumbling with emacs + elpy + flake8

2018-09-13 Thread Brian Oney via Python-list
Hi Martin, I have messed around alot with the myriad emacs configurations out there. I found spacemacs and threw out my crappy but beloved .emacs config. I have looked back, but will stay put. http://spacemacs.org/ Fumbling is a nice word. Spacemacs caters to lots of programmers. I can honestl

Re: I need help to put the output from terminal in a csv file

2018-09-07 Thread Brian Oney via Python-list
Please study the following to get you started. It looks like JSON output that you are dealing, which is good. I added a ", to the "body"-line, because I assume that you botched that when giving an example. ```python #!/usr/bin/env python import json output = ''' {    "error" : {   "body"

Re: >< swap operator

2018-08-14 Thread Brian Oney via Python-list
On Tue, 2018-08-14 at 10:55 -0400, Dennis Lee Bieber wrote: > On Tue, 14 Aug 2018 06:18:41 -0700 (PDT), skybuck2...@hotmail.com declaimed > the following: > > > On Monday, August 13, 2018 at 10:01:37 PM UTC+2, Léo El Amri wrote: > > > On 13/08/2018 21:54, skybuck2...@hotmail.com wrote: > > > > I j

Re: Want to be a rockstar programmer?

2018-07-23 Thread Brian Oney via Python-list
meh, I'm more into 90s and 00s metal rock and punk rock. Oh well, I knew it wasn't meant to be. ;) -- https://mail.python.org/mailman/listinfo/python-list

Re: For next loops

2018-07-23 Thread Brian Oney via Python-list
What if ply != com in the first (0th) iteration?  It's better to have an 'else:'-statement in your case, I suppose. -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT] Bit twiddling homework

2018-07-20 Thread Brian Oney via Python-list
On Fri, 2018-07-20 at 10:38 -0400, Dennis Lee Bieber wrote: > On Fri, 20 Jul 2018 11:00:09 +0200, Brian Oney via Python-list > declaimed the following: > > > Are 16|1 and 16+1 internally the same operation (for integers)? > > For those integers the EFFECT/RESULT

Re: [OT] Bit twiddling homework

2018-07-20 Thread Brian Oney via Python-list
On Fri, 2018-07-20 at 18:07 +0900, xffox wrote: > On Fri, Jul 20, 2018 at 08:25:04AM +0200, Brian Oney via Python-list wrote: > > Therefore, what book or learning course do you recommend? I imagine > > something that tours or skims > > the fundamentals of Boolean algebra a

Re: [OT] Bit twiddling homework

2018-07-20 Thread Brian Oney via Python-list
On Fri, 2018-07-20 at 06:37 +, Steven D'Aprano wrote: > On Fri, 20 Jul 2018 08:25:04 +0200, Brian Oney via Python-list wrote: > > > PS: Can I twiddle bits in Python? > > Yes. > > These operators work on ints: > > bitwise AND: & > bitwise OR:

[OT] Bit twiddling homework

2018-07-19 Thread Brian Oney via Python-list
Dear Python-List, an old dog wants to learn some new tricks. Due to my contact with microcontrollers, I am learning C/C++. I am aware that this is the endearing, helpful, yet chatty python-list. Many of you are competent C-programmers. The allure of C is that I can play directly with memory.

Re: command line utility for cups

2018-06-20 Thread Brian Oney via Python-list
On Wed, 2018-06-20 at 12:36 +0200, George Fischhof wrote: > Hi, > You can also try click library from pypi, that is a very good command line > stuff. > > George Thank you for the tip. I am away of click and it's awesomeness, but am hesitant because it's not apart of stdlib. I have gotten bitten

Re: command line utility for cups

2018-06-20 Thread Brian Oney via Python-list
Thanks Peter! That's pretty slick. I will get it working for sure now. Regards, Brian -- https://mail.python.org/mailman/listinfo/python-list

command line utility for cups

2018-06-20 Thread Brian Oney via Python-list
Dear all, I am having trouble with argparse. I am trying to translate the following line to a sleek python script: lpr -o media=legal -o sides=two-sided-long-edge filename Now where I am. import argparse parser = argparse.ArgumentParser(description='Print stuff with cups') parser.add_argument(

Re: text mining

2018-06-16 Thread Brian Oney via Python-list
На 15 юни 2018 г. 14:57:46 GMT+02:00, Steven D'Aprano написа: >Seriously, you are asking strangers to help you out of the goodness of >their heart. If your intention was to send the message that you're >lazy, >drunk, or just don't give a damn about the question, you were >successful. Answers

Re: stock quotes off the web, py style

2018-05-16 Thread Brian Oney via Python-list
thank you for that tip. I missed that somehow... На 16 май 2018 г. 16:31:37 GMT+02:00, Peter Otten <__pete...@web.de> написа: >Friedrich Rentsch wrote: > >> >>> ibm = urllib2.urlopen >> ("https://api.iextrading.com/1.0/stock/IBM/quote";).read() >> >>> ibm = eval (ibm) > >Dont do this. You are al

Re: Python gotcha of the day

2018-03-14 Thread Brian Oney via Python-list
explicit is better than implicit. That gives me an idea for a module with the following debugging command line functionality. import sass >>> "" ":p" Traceback: Are you telling me that ' ' is supposed to an operator? (Rock thrown) On March 14, 2018 10:40:38 AM GMT+01:00, Thomas Jollans wr

Re: Python Templating Language

2017-12-18 Thread Brian Oney via Python-list
you may consider checking out a more general approach. Noweb was the first to my knowledge and lead the way for Sweave (R or S), and pyweave, as mentioned. https://en.wikipedia.org/wiki/Noweb Cheers -- https://mail.python.org/mailman/listinfo/python-list