How to use a regexp here

2017-12-04 Thread Cecil Westerhof
I have a script that was running perfectly for some time. It uses: array = [elem for elem in output if 'CPU_TEMP' in elem] But because output has changed, I have to check for CPU_TEMP at the beginning of the line. What would be the best way to implement this? -- Cecil Wester

Re: How to use a regexp here

2017-12-04 Thread Cecil Westerhof
Ned Batchelder writes: > On 12/4/17 4:36 AM, Cecil Westerhof wrote: >> I have a script that was running perfectly for some time. It uses: >> array = [elem for elem in output if 'CPU_TEMP' in elem] >> >> But because output has changed, I have to check fo

Re: How to use a regexp here

2017-12-04 Thread Cecil Westerhof
Joel Goldstick writes: > On Mon, Dec 4, 2017 at 5:21 AM, Ned Batchelder > wrote: > >> On 12/4/17 4:36 AM, Cecil Westerhof wrote: >> >>> I have a script that was running perfectly for some time. It uses: >>> array = [elem for elem in output if 'C

Re: How to use a regexp here

2017-12-04 Thread Cecil Westerhof
best choice. Yes, I am sure it is always at the beginning of the line. (It is output from the Linux sensors command.) -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Re: How to use a regexp here

2017-12-04 Thread Cecil Westerhof
Neil Cerutti writes: > On 2017-12-04, Cecil Westerhof wrote: >> Joel Goldstick writes: >> >>> On Mon, Dec 4, 2017 at 5:21 AM, Ned Batchelder >>> wrote: >>> >>>> On 12/4/17 4:36 AM, Cecil Westerhof wrote: >>>> >&

Re: How to use a regexp here

2017-12-08 Thread Cecil Westerhof
Ned Batchelder writes: > On 12/4/17 4:36 AM, Cecil Westerhof wrote: >> I have a script that was running perfectly for some time. It uses: >> array = [elem for elem in output if 'CPU_TEMP' in elem] >> >> But because output has changed, I have to check fo

Re: How to use a regexp here

2017-12-08 Thread Cecil Westerhof
Joel Goldstick writes: > On Mon, Dec 4, 2017 at 5:21 AM, Ned Batchelder > wrote: > >> On 12/4/17 4:36 AM, Cecil Westerhof wrote: >> >>> I have a script that was running perfectly for some time. It uses: >>> array = [elem for elem in output if 'C

Re: How to use a regexp here

2017-12-08 Thread Cecil Westerhof
Neil Cerutti writes: > On 2017-12-04, Cecil Westerhof wrote: >> Joel Goldstick writes: >> >>> On Mon, Dec 4, 2017 at 5:21 AM, Ned Batchelder >>> wrote: >>> >>>> On 12/4/17 4:36 AM, Cecil Westerhof wrote: >>>> >&

Re: How to use a regexp here

2017-12-08 Thread Cecil Westerhof
best choice. Yes, I am sure it is always at the beginning of the line. (It is output from the Linux sensors command.) -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

How to use a regexp here

2017-12-08 Thread Cecil Westerhof
I have a script that was running perfectly for some time. It uses: array = [elem for elem in output if 'CPU_TEMP' in elem] But because output has changed, I have to check for CPU_TEMP at the beginning of the line. What would be the best way to implement this? -- Cecil Wester

From recovery.js to recoveryjsonlz4

2018-02-05 Thread Cecil Westerhof
this file? -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Re: From recovery.js to recoveryjsonlz4

2018-02-06 Thread Cecil Westerhof
[email protected] writes: > On Monday, February 5, 2018 at 1:28:16 PM UTC, Cecil Westerhof wrote: >> I have a script to get the number of windows and tabs that firefox >> uses. It always used a file recovery.js, but it changed to >> recovery.jsonlz4. >> >>

Replying on a tweet with Twython

2018-02-17 Thread Cecil Westerhof
: posted = twitter.update_status(status = follow_up, in_reply_id = posted['id_str']) But that does not work. How could I make it work? -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Re: Replying on a tweet with Twython

2018-02-17 Thread Cecil Westerhof
Cecil Westerhof writes: > I just found Twython. I managed to post a tweet with: > from twython import Twython > twitter = Twython(APP_KEY, APP_SECRET, > OAUTH_TOKEN, OAUTH_TOKEN_SECRET) > posted = twitter.update_status(status = quote) > >

Re: Replying on a tweet with Twython

2018-02-17 Thread Cecil Westerhof
Steven D'Aprano writes: > On Sat, 17 Feb 2018 12:53:08 +0100, Cecil Westerhof wrote: > >> Cecil Westerhof writes: >> >>> I just found Twython. I managed to post a tweet with: >>> from twython import Twython >

Strange problem with pip2

2018-03-01 Thread Cecil Westerhof
ersion-externally-managed --compile" failed with error code 1 in /tmp/pip-build-vY4LXH/pycairo/ What could be happening here? And how do I solve this? -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Is it ‘allowed’ to get parameters like this

2016-08-11 Thread Cecil Westerhof
(period == '--all'): vmstat_params = [all_data, slice_length] else: parameter_error() Is this acceptable, or is it a big no-no? By the way: the reason I fetch today from the database is that I work with UTC dates. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Re: Is it ‘allowed’ to get parameters like this

2016-08-11 Thread Cecil Westerhof
On Thursday 11 Aug 2016 16:29 CEST, Peter Otten wrote: > Cecil Westerhof wrote: > >> It has been a while since I worked with Python. I wanted to get >> some stats about the idle time of my computer, so that was a good >> moment to pick up Python again. ;-) >> >

Re: Is it ‘allowed’ to get parameters like this

2016-08-11 Thread Cecil Westerhof
On Thursday 11 Aug 2016 17:15 CEST, Cecil Westerhof wrote: > On Thursday 11 Aug 2016 16:29 CEST, Peter Otten wrote: > >> Cecil Westerhof wrote: >> >>> It has been a while since I worked with Python. I wanted to get >>> some stats about the idle time of my com

%config PromptManager

2016-09-14 Thread Cecil Westerhof
ager.in_template = r'[{time.strftime("%a, %d %b %T")} \u@\h:\Y1]\nIn [\#]: ' But is there a way to do it both for ipython2 and ipython3? -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

‘pip2 install cryptography’ does not work

2016-09-14 Thread Cecil Westerhof
r(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-LxpwQ4-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-QoMAwn/cr

Re: ‘pip2 install cryptography’ does not work

2016-09-15 Thread Cecil Westerhof
On Thursday 15 Sep 2016 10:19 CEST, [email protected] wrote: > Cecil Westerhof writes: > >> I try to do a: >> pip2 install cryptography >> >> But this give: gcc -pthread -shared >> build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_openssl.o >>

Can json.dumps create multiple lines

2016-12-01 Thread Cecil Westerhof
ould generate: '["An array", "with several strings", "as a demo"]' I would prefer when it would generate: '[ "An array", "with several strings", "as a demo" ]' Is this possible, or do

Re: Can json.dumps create multiple lines

2016-12-01 Thread Cecil Westerhof
On Thursday 1 Dec 2016 17:55 CET, Zachary Ware wrote: > On Thu, Dec 1, 2016 at 10:30 AM, Cecil Westerhof wrote: >> I would prefer when it would generate: >> '[ >> "An array", >> "with several strings", >> "as a demo" >&

Re: Can json.dumps create multiple lines

2016-12-01 Thread Cecil Westerhof
On Thursday 1 Dec 2016 22:52 CET, Cecil Westerhof wrote: > Now I need to convert the database. But that should not be a big > problem. I did the conversion with: cursor.execute('SELECT tipID FROM tips') ids = cursor.fetchall() for id in ids: id = id[0]

Re: Can json.dumps create multiple lines

2016-12-01 Thread Cecil Westerhof
On Thursday 1 Dec 2016 23:58 CET, Peter Otten wrote: > Cecil Westerhof wrote: > >> On Thursday 1 Dec 2016 22:52 CET, Cecil Westerhof wrote: >> >>> Now I need to convert the database. But that should not be a big >>> problem. >> >> I did the conve

ipython2 does not work anymore

2017-01-19 Thread Cecil Westerhof
2 (default, Jul 01 2016, 15:36:53) [GCC] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> Otherwise I would have a problem. Some scripts still use it. I am working with openSUSE 13.2 -- Cecil Westerhof Senio

Using python to start programs after logging in

2017-01-19 Thread Cecil Westerhof
x27;.split())) log_file = open('Logging/firefox_%T.log'.replace('%T', strftime('%F_%R')), 'w') Popen(tuple('firefox'.split()), stdout = log_file, stderr = STDOUT) The first statement is to go to the correct desktop. Is this a good way to do th

Re: Using python to start programs after logging in

2017-01-19 Thread Cecil Westerhof
On Thursday 19 Jan 2017 20:29 CET, John Gordon wrote: > In <[email protected]> Cecil Westerhof > writes: > >> I am writing a python program to start the programs that need to be >> started after logging in. > >> Is this a good way to do thin

Re: ipython2 does not work anymore

2017-01-19 Thread Cecil Westerhof
On Thursday 19 Jan 2017 21:08 CET, MRAB wrote: > On 2017-01-19 15:06, Cecil Westerhof wrote: >> I did not work with ipython2 for a long time. Most of my work is >> done with python3. I just tried to start ipython2 and got: >> Traceback (most recent call last): File "/us

Re: Using python to start programs after logging in

2017-01-19 Thread Cecil Westerhof
On Thursday 19 Jan 2017 21:12 CET, MRAB wrote: > On 2017-01-19 19:08, Cecil Westerhof wrote: >> I am writing a python program to start the programs that need to be >> started after logging in. >> >> I have the following imports: >> from subprocess import check

Re: Using python to start programs after logging in

2017-01-19 Thread Cecil Westerhof
On Thursday 19 Jan 2017 22:21 CET, Cecil Westerhof wrote: > On Thursday 19 Jan 2017 21:12 CET, MRAB wrote: > >> On 2017-01-19 19:08, Cecil Westerhof wrote: >>> I am writing a python program to start the programs that need to >>> be started after logging in. >&g

Re: Using python to start programs after logging in

2017-01-19 Thread Cecil Westerhof
. I am using cwd now. >> Sometimes a command needs to be executed in a different directory, >> that is done like: commands = [ ['lein run', 'NONE', >> 'Clojure/Quotes'], ['xfce4-terminal --maximize --execute screen -S >> Clojure -c ~/.screenrcClojure', 'NONE', ''], >> ] >> do_desktop('6', commands, 30) >> > Why 'NONE'? Why not None? I am using None now. Thanks. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Re: Using python to start programs after logging in

2017-01-19 Thread Cecil Westerhof
On Friday 20 Jan 2017 00:36 CET, Cecil Westerhof wrote: > I wrote a function for switching to the correct virtual desktop and > starting all the commands. I am also using with now: > def do_desktop(desktop, commands, seconds_to_wait = 10): > desktop_command = ('wmctrl -s &

Let ipython3 use the latest python3

2017-01-21 Thread Cecil Westerhof
I built python3.6, but ipython3 is still using the old one (3.4.5). How can I make ipython3 use 3.6? -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Problems with python3.6 on one system, but OK on another

2017-01-21 Thread Cecil Westerhof
, line 7, in import readline ModuleNotFoundError: No module named 'readline' Probably not a big problem because I will mostly work with ipython3 at the moment I get it working with 3.6, but just wondering. By the way all other import (including rlcompleter) do work in 3.6. -- Cecil We

Re: Using python to start programs after logging in

2017-01-23 Thread Cecil Westerhof
On Thursday 19 Jan 2017 20:08 CET, Cecil Westerhof wrote: > I am writing a python program to start the programs that need to be > started after logging in. I published what I have until now at: https://github.com/CecilWesterhof/PythonScripts/blob/master/startPrograms.py I do not min

Re: How coding in Python is bad for you

2017-01-27 Thread Cecil Westerhof
indent rule of Python very much. My only ‘problem’ was that I used to put debug statement at the beginning of a line to see immediately what the debug statements where. But that was a small price to pay. ;-) -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/ce

After update to pip 10 I get: Cache entry deserialization failed, entry ignored

2018-04-18 Thread Cecil Westerhof
After I updated pip2/3 to 10 from 9 I sometimes get: Cache entry deserialization failed, entry ignored For example when I execute: pip3 list --outdated But not always. What could be happening here? And how would I solve this? -- Cecil Westerhof Senior Software Engineer LinkedIn: http

Re: After update to pip 10 I get: Cache entry deserialization failed, entry ignored

2018-04-26 Thread Cecil Westerhof
[email protected] writes: > On Wednesday, April 18, 2018 at 1:59:14 AM UTC-5, Cecil Westerhof wrote: >> After I updated pip2/3 to 10 from 9 I sometimes get: >> Cache entry deserialization failed, entry ignored >> >> For example when I execute: >> pi

ipython does not work with latest version of prompt-toolkit

2018-06-03 Thread Cecil Westerhof
pplication, create_eventloop, create_prompt_layout, create_output ImportError: cannot import name 'create_prompt_application' When I now execute: pip3 list --no-cache-dir --outdated I do not get output. So pip3 thinks everything is OK. How do I fix this? Or is the expected that ipython3

Re: ipython does not work with latest version of prompt-toolkit

2018-06-03 Thread Cecil Westerhof
Chris Warrick writes: > On Sun, 3 Jun 2018 at 10:32, Cecil Westerhof wrote: >> >> When executing: >> pip3 list --no-cache-dir --outdated >> >> I got: >> prompt-toolkit 1.0.152.0.1wheel >> PyGObject 3.28.23.28.3 sdist &

urllib3 1.23 breaks API

2018-06-05 Thread Cecil Westerhof
I had installed urllib3 1.22 for Python3. I upgraded it to 1.23. This broke the requirements for requests 2.18.4: requests 2.18.4 has requirement urllib3<1.23,>=1.21.1, but you'll have urllib3 1.23 which is incompatible I downgraded to 1.22, but this should not happen I think.

How to get the versions of dependecies

2018-06-16 Thread Cecil Westerhof
thonconsole = IPython.lib.lexers:IPythonConsoleLexer -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Getting installed version

2018-07-19 Thread Cecil Westerhof
I can get the installed version of a package with: pip2 show cryptography | awk '/^Version: / { print $2 }' But I was wondering if there is a better way. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.o

ipython and prompt-toolkit

2018-09-27 Thread Cecil Westerhof
For a long time I cannot update prompt-toolkit, because ipython requires a version lower as 2. That is why I still use 1.0.15 instead of 2.0.4. Any chance that ipython will be updated concerning this dependency? -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in

Twython has a problem with latest urllib3

2018-10-18 Thread Cecil Westerhof
tch a supported version! RequestsDependencyWarning) Should I rollback urllib3, or hope that Twython is updated soon? It looks like that the functionality is not broken. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/ma

Re: Twython has a problem with latest urllib3

2018-10-19 Thread Cecil Westerhof
Cecil Westerhof writes: > I use Twython to post on Twitter. Yesterday I upgraded urllib3 from > 1.23 to 1.24. Since then when I do: > from twython import Twython > > I get: > /usr/local/lib/python3.5/dist-packages/requests/__init__.py:91: > RequestsDependencyWarni

Re: Instalação

2016-03-30 Thread Cecil Westerhof
eginner should definitely start with > Python 3 and only use 2 if there's a library they need which hasn't > yet been ported, something which is becoming increasingly rare. I agree, with one exception: if they want to run there code also in the JVM. As far as I know jython is only for P

Handling an connection error with Twython

2019-05-23 Thread Cecil Westerhof
= True) What would be the best way to catch a connection error and try it (for example) again maximum three times with a delay of one minute? -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Re: Handling an connection error with Twython

2019-05-23 Thread Cecil Westerhof
Cecil Westerhof writes: > I am using Twython to post updates on Twitter. Lately there is now and > then a problem with my internet connection. I am using: > posted = twitter.update_status(status = message, >in_reply_to_status_id

Re: Handling an connection error with Twython

2019-05-23 Thread Cecil Westerhof
MRAB writes: > On 2019-05-23 22:55, Cecil Westerhof wrote: >> Cecil Westerhof writes: >> >>> I am using Twython to post updates on Twitter. Lately there is now and >>> then a problem with my internet connection. I am using: >>> poste

Re: Handling an connection error with Twython

2019-05-24 Thread Cecil Westerhof
Dennis Lee Bieber writes: > On Fri, 24 May 2019 07:49:23 +0200, Cecil Westerhof > declaimed the following: > >> >>I did not do that consciously, because I have to try until it is >>successful an I return, or I reached the max tries and re-raise the >>exception.

Re: Handling an connection error with Twython

2019-05-25 Thread Cecil Westerhof
MRAB writes: > On 2019-05-24 09:25, Cecil Westerhof wrote: >> Dennis Lee Bieber writes: >> >>> On Fri, 24 May 2019 07:49:23 +0200, Cecil Westerhof >>> declaimed the following: >>> >>>> >>>>I did not do that consciously, because

Re: Handling an connection error with Twython

2019-06-01 Thread Cecil Westerhof
"Peter J. Holzer" writes: > On 2019-05-25 13:46:40 +0200, Cecil Westerhof wrote: >> Just changing the while loop to a for loop did not make sense to me, >> but this does. I now have: >> max_tries = 5 >> for current_try in range(1, max_tries):

Copying a row from a range of Excel files to another

2019-06-26 Thread Cecil Westerhof
on line 1, 4, 5, 7, 8, 9 and 10. Should I catch every exception alone, or all together, or something in between? -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Creating a Windows executable on a Linux system

2019-06-26 Thread Cecil Westerhof
executable on a Linux system? Any pointers about best practice creating a standalone executable are welcome. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Make sure the window title is visible in tkinter

2019-06-26 Thread Cecil Westerhof
Button (window, text = 'Short text').pack() window.mainloop() I see only a part of the 'A', but I would like to see the complete: 'A long window title' -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https:/

What type of error is it

2019-06-26 Thread Cecil Westerhof
was. That works, because tkinter takes over again. This works for me when I run it from the command-line, but it has to become a stand-alone executable. Is there a way to find out what the cause of the exception was, so I can put it in the error message? -- Cecil Westerhof Senior Software Enginee

Re: What type of error is it

2019-06-26 Thread Cecil Westerhof
Cecil Westerhof writes: > I am writing a GUI program with tkinter. One function I have is: > def select_dir(): > try: > directory = filedialog.askdirectory() > if directory == '': > messagebox.showinfo(info_str, canceled_

Re: Copying a row from a range of Excel files to another

2019-06-26 Thread Cecil Westerhof
Cecil Westerhof writes: > I was asked to copy a certain line from about 300 Excel lines to a new > Excel file. That is not something I would like to do by hand and I > immediately thought: that should be possible with Python. > > And it is. I was surprised how fast I could

Re: Creating a Windows executable on a Linux system

2019-06-26 Thread Cecil Westerhof
"Peter Heitzer" writes: > Cecil Westerhof wrote: >>I need to write a Python desktop program. I create it on a Linux >>system, but it has to run on a Windows system. When looking at how to >>create an executable it seems that you need to be on a Windows system &

Re: Copying a row from a range of Excel files to another

2019-06-26 Thread Cecil Westerhof
Cecil Westerhof writes: > Is it necessary to close the workbooks to circumvent a resource > leak? Still like to know. When not necessary it is better not to cloes them I think. > Is it a problem when a workbook is closed two times? If so I need to > make sure that this is not pos

Re: Make sure the window title is visible in tkinter

2019-06-26 Thread Cecil Westerhof
Wildman writes: > On Wed, 26 Jun 2019 13:25:15 +0200, Cecil Westerhof wrote: > >> I need to write a desktop program. I choose to use tkinter. How can I >> make sure the window title is visible? For example when I have the >> following code: >> from tkinter

Hiding a progressbar in tkinter

2019-06-26 Thread Cecil Westerhof
ot hide the progressbar. What am I doing wrong? I could use pack_forget, but that will change the dimensions of the window. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Re: Copying a row from a range of Excel files to another

2019-06-26 Thread Cecil Westerhof
with load_workbook(filepath) as wb_in: > for cell in wb_in.active[src_row]: > current_row.append(cell.value) > > wb_out.active.append(current_row) > > wb_out.save(report_start + datetime.now().strftime('%Y-%m-%d'

Re: Make sure the window title is visible in tkinter

2019-06-28 Thread Cecil Westerhof
Cecil Westerhof writes: > Wildman writes: > >> On Wed, 26 Jun 2019 13:25:15 +0200, Cecil Westerhof wrote: >> >>> I need to write a desktop program. I choose to use tkinter. How can I >>> make sure the window title is visible? For example when I have the >

Re: Creating a Windows executable on a Linux system

2019-06-28 Thread Cecil Westerhof
Cecil Westerhof writes: > I need to write a Python desktop program. I create it on a Linux > system, but it has to run on a Windows system. When looking at how to > create an executable it seems that you need to be on a Windows system > to create a Windows executable. Is this tr

Re: Copying a row from a range of Excel files to another

2019-06-28 Thread Cecil Westerhof
MRAB writes: > On 2019-06-26 22:14, Cecil Westerhof wrote: >> MRAB writes: >> >>> Does Workbook support the 'with' statement? >>> >>> If it does, then that's the best way of doing it. >>> >>> (Untested) >

Re: Creating a Windows executable on a Linux system

2019-06-28 Thread Cecil Westerhof
Cecil Westerhof writes: > Cecil Westerhof writes: > >> I need to write a Python desktop program. I create it on a Linux >> system, but it has to run on a Windows system. When looking at how to >> create an executable it seems that you need to be on a Windows syste

Only a message at the highest exception

2019-06-28 Thread Cecil Westerhof
an acceptable way, or should I do it differently? -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Re: Hiding a progressbar in tkinter

2019-06-28 Thread Cecil Westerhof
MRAB writes: > On 2019-06-26 16:47, Cecil Westerhof wrote: >> I just started with GUI stuff in tkinter. I have a progressbar, but I >> want it to be only visible when it is used. So I tried the following: >> window = Tk() >> window.title(window_str) &g

Re: Only a message at the highest exception

2019-06-28 Thread Cecil Westerhof
Chris Angelico writes: > On Fri, Jun 28, 2019 at 7:33 PM Cecil Westerhof wrote: >> >> I have a tkinter program where I have a function generate_report which >> in a try block calls the function append_row. This function has also a >> try block. When they get an excep

Re: Only a message at the highest exception

2019-06-28 Thread Cecil Westerhof
Cameron Simpson writes: > On 28Jun2019 12:17, Cecil Westerhof wrote: >>Chris Angelico writes: >>> On Fri, Jun 28, 2019 at 7:33 PM Cecil Westerhof wrote: >>>> I have a tkinter program where I have a function generate_report >>>> which >>>&

Use global, or not

2019-06-28 Thread Cecil Westerhof
ow': window, } And in the program do things like: global_dict['progress']['value'] += 1 global_dict['window'].update_idletasks() global_dict['window'].update_idletasks() and: messagebox.showwarning(global_dict['titles']['warning'], global_dict['messages']['nofiles']) Is that an acceptable way to do this? -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Re: Use global, or not

2019-06-29 Thread Cecil Westerhof
DL Neil writes: > On 29/06/19 1:44 AM, Cecil Westerhof wrote: >> I have written a GUI program where I have quit a few global variables. >> I did not like this, so I now use one global dict. Something like: >> global global_dict > ... > >> Is that an accep

Re: What about idea of making a "Pythonic Lisp"...i.e. a Lisp that more closely resembles the syntax of Python?

2019-09-19 Thread Cecil Westerhof
== sum(b) > True > >>> sum(b) == sum(a) > False Why does this happen? By the way, when you change the last statement to: sum(a) == sum(b) you also get False. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Why does super(bool) give None

2020-04-23 Thread Cecil Westerhof
issubclass(bool, int) gives True but super(bool) gives Do I not understand the meaning of super, or is this inconsistent? (Until now I have not down much work with classes in Python.) -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https

Re: Why does super(bool) give None

2020-04-24 Thread Cecil Westerhof
Chris Angelico writes: > On Fri, Apr 24, 2020 at 4:16 PM Cecil Westerhof wrote: >> >> issubclass(bool, int) gives True >> but >> super(bool) gives >> >> Do I not understand the meaning of super, or is this inconsistent? >> >> (Until n

Re: Why does super(bool) give None

2020-04-24 Thread Cecil Westerhof
Cecil Westerhof writes: >> I've never actually looked at the repr of a super object - I've always >> just called a method on it immediately after constructing it. Never >> seen a need to hang onto one :) > > Well, maybe I will never need it, but I am just cu

Help needed with compiling python

2015-11-25 Thread Cecil Westerhof
7, in import readline ImportError: No module named readline What do I need to do to get it working? -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Re: Help needed with compiling python

2015-11-25 Thread Cecil Westerhof
On Wednesday 25 Nov 2015 21:49 CET, Zachary Ware wrote: > On Wed, Nov 25, 2015 at 2:23 PM, Cecil Westerhof wrote: >> I wanted to install python myself. I started with 2.7.10. If that >> works I also will install 3.5.0. >> >> I did: >> ./configure --prefix=/usr &

Re: Help needed with compiling python

2015-11-25 Thread Cecil Westerhof
On Wednesday 25 Nov 2015 23:39 CET, Zachary Ware wrote: > On Wed, Nov 25, 2015 at 3:52 PM, Cecil Westerhof wrote: >> My system python was all-ready damaged: that is why I wanted to >> build myself. > > Then you should try to repair the system Python install via the > syst

Re: Help needed with compiling python

2015-11-25 Thread Cecil Westerhof
On Wednesday 25 Nov 2015 23:58 CET, Laura Creighton wrote: > In a message of Wed, 25 Nov 2015 22:52:23 +0100, Cecil Westerhof > writes: >> >> My system python was all-ready damaged: that is why I wanted to >> build myself. > > Your Suse system probably wants to use

Re: Help needed with compiling python

2015-11-26 Thread Cecil Westerhof
On Thursday 26 Nov 2015 09:29 CET, Steven D'Aprano wrote: > On Thursday 26 November 2015 18:00, Cecil Westerhof wrote: > >> On Wednesday 25 Nov 2015 23:58 CET, Laura Creighton wrote: >> >>> In a message of Wed, 25 Nov 2015 22:52:23 +0100, Cecil Westerhof >>&g

Re: Help needed with compiling python

2015-11-26 Thread Cecil Westerhof
On Thursday 26 Nov 2015 12:07 CET, Dave Farrance wrote: > Cecil Westerhof wrote: > >> On Wednesday 25 Nov 2015 23:58 CET, Laura Creighton wrote: >>> >>> Your Suse system probably wants to use python for something. If >>> your system python is damaged, yo

Getting rid of

2015-04-12 Thread Cecil Westerhof
s strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Re: Getting rid of

2015-04-12 Thread Cecil Westerhof
Op Sunday 12 Apr 2015 20:54 CEST schreef Denis McMahon: > On Sun, 12 Apr 2015 19:48:53 +0200, Cecil Westerhof wrote: > >> What should I do to get rid of the warnings: >> /usr/lib/python2.7/site-packages/requests-2.6.0-py2.7.egg/requests/ > packages/urllib3/

Python as shell

2015-04-22 Thread Cecil Westerhof
I am working again with Python and I am impressed again. ;-) I thought there was a Python shell that could be used instead of Bash (or whichever shell you are using), but I can not find anything about it. Am I wrong, or are my search engine skills so bad? -- Cecil Westerhof Senior Software

Best GUI for Python

2015-04-26 Thread Cecil Westerhof
I want to use a GUI for Python. When searching I found (beside some others) Tkinter and wxPython. From what I found it looks like Tkinter is slightly better. What would be the pros/cons of these two? Would there be a compelling reason to use another GUI? -- Cecil Westerhof Senior Software

Re: Best GUI for Python

2015-04-26 Thread Cecil Westerhof
Op Sunday 26 Apr 2015 15:02 CEST schreef Cecil Westerhof: > I want to use a GUI for Python. When searching I found (beside some > others) Tkinter and wxPython. From what I found it looks like > Tkinter is slightly better. What would be the pros/cons of these > two? Would there be

Re: Best GUI for Python

2015-04-26 Thread Cecil Westerhof
Op Sunday 26 Apr 2015 17:09 CEST schreef Steven D'Aprano: > On Sun, 26 Apr 2015 11:02 pm, Cecil Westerhof wrote: > >> I want to use a GUI for Python. When searching I found (beside some >> others) Tkinter and wxPython. From what I found it looks like >> Tkinter is s

Re: Best GUI for Python

2015-04-26 Thread Cecil Westerhof
Op Sunday 26 Apr 2015 19:12 CEST schreef Gary Herron: > On 04/26/2015 09:32 AM, Cecil Westerhof wrote: >> Op Sunday 26 Apr 2015 17:09 CEST schreef Steven D'Aprano: >> >>> On Sun, 26 Apr 2015 11:02 pm, Cecil Westerhof wrote: >>> >>>> I want to us

Wrote a memoize function: I do not mind feedback

2015-04-27 Thread Cecil Westerhof
other functionalities are welcome also. Übung macht den Meister. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Not possible to hide local variables

2015-04-28 Thread Cecil Westerhof
s instance. What is the best way to handle this? -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Re: Wrote a memoize function: I do not mind feedback

2015-04-28 Thread Cecil Westerhof
Op Monday 27 Apr 2015 22:35 CEST schreef Albert-Jan Roskam: > - Original Message - >> From: Peter Otten <[email protected]> >> To: [email protected] >> Cc: >> Sent: Monday, April 27, 2015 4:28 PM >> Subject: Re: Wrote a memoize function: I do

Re: Not possible to hide local variables

2015-04-28 Thread Cecil Westerhof
Op Tuesday 28 Apr 2015 09:56 CEST schreef Ethan Furman: > On 04/28, Cecil Westerhof wrote: >> If I remember correctly you can not hide variables of a class or >> make them read-only? >> >> I want to rewrite my moving average to python. The init is: >> def __init__

Re: Not possible to hide local variables

2015-04-28 Thread Cecil Westerhof
Op Tuesday 28 Apr 2015 09:33 CEST schreef Cecil Westerhof: > If I remember correctly you can not hide variables of a class or > make them read-only? > > I want to rewrite my moving average to python. The init is: > def __init__(self, length): > if type(length) != int: >

Re: Not possible to hide local variables

2015-04-28 Thread Cecil Westerhof
ter or equal two. A moving average of length one is not very useful. I am of the school that it is good to check as much as possible. (Without going over the top.) -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list

Re: Not possible to hide local variables

2015-04-29 Thread Cecil Westerhof
Op Tuesday 28 Apr 2015 10:37 CEST schreef Steven D'Aprano: > On Tuesday 28 April 2015 17:33, Cecil Westerhof wrote: > >> If I remember correctly you can not hide variables of a class or >> make them read-only? > > In Python circles, the preferred terminology for cl

  1   2   3   4   5   >