Re: [Tutor] Union

2019-08-12 Thread Jim
On 8/12/19 4:12 PM, Mats Wichmann wrote: On 8/12/19 2:50 PM, Jim wrote: I was reading the docs for PySimpbleGUI here: https://pysimplegui.readthedocs.io/en/latest/#building-custom-windows In the table of parameters for the Window() function for example the icon parameter the meaning is  Union

[Tutor] Union

2019-08-12 Thread Jim
of "Union". I don't recall seeing anything like it before. Thanks, Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Impersonation

2019-07-16 Thread Jim
On 7/15/19 9:36 PM, Jim wrote: Mats, Hopefully you recognize my email address as someone you have given advice concerning Python. Over the last month or so I have received at least 3 emails supposedly coming from you that I am sure you did not send. The from line is:  Mats Wichmann The

[Tutor] Impersonation

2019-07-15 Thread Jim
, 2019 10:36 AM, Mats Wichmann wrote: Hope you are well. Just wanted to share something with you http://www.bt6q.lnhaxf.info/ I just wanted you to know that it seems someone is trying to impersonate you. Regards, Jim ___ Tutor maillist - Tutor

[Tutor] Consequences of removing python3-venv

2019-05-09 Thread Jim
on3.5-config 0 lrwxrwxrwx 1 root root 10 Jan 9 2017 /usr/bin/python3m -> python3.5m 0 lrwxrwxrwx 1 root root 17 Mar 23 2016 /usr/bin/python3m-config -> python3.5m-config So will allowing the update harm my virtual environments? I really don'

Re: [Tutor] Python 3.6 update?

2018-10-27 Thread Jim
On 10/25/18 5:30 PM, Mats Wichmann wrote: On 10/25/2018 03:07 PM, Jim wrote: Mint 18.1 Default python3 = 3.5 Python 3.6 installed for use by a virtual environment. Update manager just informed me of an update for python 3.6 to 3.6.7-1. When I started to install it, I got a dialog saying

[Tutor] Python 3.6 update?

2018-10-25 Thread Jim
removed python3-dev & python3-venv. I am wondering what will happen to the virtual environment I have installed that uses python 3.6. Will the 2 packages be replaced and the virtual environment continue to work or is there some other steps I will need to take. Regards,

Re: [Tutor] No module named uno in virtual environment

2018-09-09 Thread Jim
On 09/09/2018 01:29 PM, Mats Wichmann wrote: On 09/09/2018 10:49 AM, Jim wrote: ok, awkward naming issue. try openoffice-python instead? Unfortunately it produces the same result, no module uno found. I think all of the packages on pipy need the uno module to be installed to function. When

Re: [Tutor] No module named uno in virtual environment

2018-09-09 Thread Jim
On 09/08/2018 08:35 PM, Mats Wichmann wrote: On September 8, 2018 5:46:46 PM MDT, Jim wrote: On 09/08/2018 05:26 PM, Mats Wichmann wrote: On 09/07/2018 03:10 PM, Jim wrote: Mint 18.1 System python3 3.5.2 Python3-uno is available to the system python3. How can I make it available to python

Re: [Tutor] No module named uno in virtual environment

2018-09-08 Thread Jim
On 09/08/2018 05:26 PM, Mats Wichmann wrote: On 09/07/2018 03:10 PM, Jim wrote: Mint 18.1 System python3 3.5.2 Python3-uno is available to the system python3. How can I make it available to python 3.6.5 in a virtual environment I installed using venv? with your virtualenv activated, just

[Tutor] No module named uno in virtual environment

2018-09-07 Thread Jim
8, in import uno, re, zipfile, types, inspect, tempfile, shutil, subprocess ModuleNotFoundError: No module named 'uno' Thanks, Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How can I find a group of characters in a list of strings?

2018-07-25 Thread Jim
over each item using a bunch of if statements exiting the inner loop as soon as I find a letter is not in the string, but there must be a better way. I'd appreciate hearing about a better way to attack this. thanks, Jim If I only had to do this once, over only a million items (given today&#

Re: [Tutor] How can I find a group of characters in a list of strings?

2018-07-25 Thread Jim
On 07/25/2018 07:43 PM, Steven D'Aprano wrote: On Wed, Jul 25, 2018 at 06:50:56PM -0500, Jim wrote: [...] I need to check and see if the letters 'OFHCMLIP' are one of the items in the list but there is no way to tell in what order the letters will appear. So I can't just s

[Tutor] How can I find a group of characters in a list of strings?

2018-07-25 Thread Jim
g a bunch of if statements exiting the inner loop as soon as I find a letter is not in the string, but there must be a better way. I'd appreciate hearing about a better way to attack this. thanks, Jim ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] Wish to upgrade Python 3.6.5 to Python 3.6.6 for Linux Mint 19

2018-07-14 Thread Jim
raries. If you use a virtual environment you don't have to worry about breaking your system python. regards, Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Need help combining elements of a list of lists

2018-07-11 Thread Jim
On 07/10/2018 11:03 PM, Mats Wichmann wrote: On 07/10/2018 09:09 PM, Steven D'Aprano wrote: On Tue, Jul 10, 2018 at 09:46:57PM -0500, Jim wrote: Say I have a list like ltrs and I want to print out all the possible 3 letter combinations. I want to combine letters from each inner list bu

Re: [Tutor] Need help combining elements of a list of lists

2018-07-11 Thread Jim
On 07/10/2018 10:09 PM, David Rock wrote: On Jul 10, 2018, at 22:04, David Rock wrote: On Jul 10, 2018, at 21:46, Jim wrote: ltrs = [['A', 'B'], ['C', 'D', 'E'], ['F', 'G', 'H', 'I']] A fai

[Tutor] Need help combining elements of a list of lists

2018-07-10 Thread Jim
) #ADG print(ltrs[0][0]+ltrs[1][2]+ltrs[2][1]) #AEG . . . print(ltrs[0][1]+ltrs[1][2]+ltrs[2][3]) #BEI thanks, Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Using pip

2018-07-05 Thread Jim
minal (which ever your OS provides). Also depending on which version of python you are using (2 or 3) you may have to type pip3 instead of just pip. regards, Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options

Re: [Tutor] Virtual environment can't find uno

2018-06-14 Thread Jim
On 06/14/2018 10:51 AM, Mats Wichmann wrote: On 06/13/2018 06:55 PM, Jim wrote: Running Linux Mint 18. I have python 3.6 running in a virtual environment. I want to use a package called oosheet to work with libreoffice calc. When I try to import it I get the following error: import oosheet

[Tutor] Virtual environment can't find uno

2018-06-13 Thread Jim
runs with no errors. python3-uno was installed using apt-get. How do I get python 3.6 in the virtual environment to find uno? Thanks, Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Need help with a virtual environment mess

2018-05-07 Thread Jim
On 05/07/2018 12:02 PM, Mats Wichmann wrote: On 05/07/2018 10:16 AM, Jim wrote: My understanding of VE's, based on some feedback from here, is you install install the python you want on the system then use it to install your VE. Then you install what ever you need to the VE. In my case I

Re: [Tutor] Need help with a virtual environment mess

2018-05-07 Thread Jim
On 05/06/2018 05:16 PM, boB Stepp wrote: On Sun, May 6, 2018 at 11:05 AM, Jim wrote: In a prior thread you guys helped me fix a problem with pip after I upgraded an installed version of python 3.6 on my Mint 18 system. Pip would not run in my python 3.6 virtual environment. The fix was to use

[Tutor] Need help with a virtual environment mess

2018-05-06 Thread Jim
tkinter', please install the python3-tk package >>> If I go to synaptic and install the python3-tk it installs version 3.6.5 of the package and I can still not import tkinter in env with python 3.5.2, but I can in env36 with python 3.6.5.

Re: [Tutor] pip stopped working gives error

2018-05-04 Thread Jim
On 05/03/2018 03:48 PM, Mats Wichmann wrote: On 05/03/2018 02:27 PM, Jim wrote: I heard distutils may have been split out... see if you have a package python3-distutils and if not installed, can you install it? I have: //usr/lib/python3.5/distutils and //usr/lib/python3.6/distutils, but no

Re: [Tutor] pip stopped working gives error

2018-05-04 Thread Jim
On 05/03/2018 03:40 PM, Zachary Ware wrote: On Thu, May 3, 2018 at 2:10 PM, Jim wrote: I have python 3.6 installed in a virtual environment on Mint 18. Today I wanted to use pip and got this error when I tried to use it. (env36) jfb@jims-mint18 ~ $ pip help Traceback (most recent call last

Re: [Tutor] pip stopped working gives error

2018-05-03 Thread Jim
On 05/03/2018 02:42 PM, Mats Wichmann wrote: On 05/03/2018 01:10 PM, Jim wrote: I have python 3.6 installed in a virtual environment on Mint 18. Today I wanted to use pip and got this error when I tried to use it.  (env36) jfb@jims-mint18 ~ $ pip help Traceback (most recent call last

[Tutor] pip stopped working gives error

2018-05-03 Thread Jim
tual environment I have setup. It has worked in the past as I have installed pylint and pykeyboard with it. As I type this I just remembered Mint updated python 3.6 earlier today. So now I suspect the update is involved. Has anyone else exper

Re: [Tutor] Need help with FileNotFoundError

2018-04-26 Thread Jim
On 04/26/2018 03:27 PM, Danny Yoo wrote: copy('~/Documents/Courses/ModernBootcamp/story.txt', '~/Documents/Courses/ModernBootcamp/story_copy.txt') Hi Jim, You may need to use os.path.expanduser, as "tilde expansion" isn't something that's done automa

[Tutor] Need help with FileNotFoundError

2018-04-26 Thread Jim
py list_comps.py __pycache__ unlucky_numbers.py dictionarys.py FirstProgram guessing_game.py list_methods.py smiley_faces.py while_loop.py I must be doing something wrong path-wise, but I can't seem to figure it out. Any help appreciated. Regards, Jim _

Re: [Tutor] Virtual environment question

2018-03-13 Thread Jim
On 03/12/2018 08:44 PM, eryk sun wrote: On Tue, Mar 13, 2018 at 1:31 AM, Jim wrote: On 03/12/2018 04:04 AM, eryk sun wrote: On Mon, Mar 12, 2018 at 12:44 AM, Jim wrote: home = /usr/bin include-system-site-packages = false [...] resp = opener.open(request, timeout=self._timeout

Re: [Tutor] Virtual environment question

2018-03-12 Thread Jim
On 03/12/2018 04:04 AM, eryk sun wrote: On Mon, Mar 12, 2018 at 12:44 AM, Jim wrote: home = /usr/bin include-system-site-packages = false [...] resp = opener.open(request, timeout=self._timeout) File "/usr/lib/python3.5/urllib/request.py", line 466, in open This is norma

Re: [Tutor] Virtual environment question

2018-03-11 Thread Jim
On 03/11/2018 05:54 PM, Cameron Simpson wrote: Note: This message came straight to me and I haven't seen it on the list yet. Hopefully this reply will make it to the list. On 11Mar2018 15:52, jim wrote: It was my understanding that using a virtual environment kept everything isolat

[Tutor] Virtual environment question

2018-03-11 Thread Jim
I started from a virtual environment. Regards, Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] When to use classes

2017-08-20 Thread Jim
e ability to create powerful, full featured GUIs has trumped the easy to use, but ultimately limited, scope of Hypercard. In one sense Hypercard is still alive. Check out Livecode at livecode.com Regards, Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Using venv

2017-05-29 Thread Jim
On 05/29/2017 08:09 PM, Ben Finney wrote: You should probably disregard this message as I have since solved the problem I was asking about. I originally wrote this message on 01/27/17, how it make it back to the list I don't know. Regards, Jim Jim writes: It has been suggested

Re: [Tutor] No file or directory error using subprocess and Popen

2017-05-15 Thread Jim
On 05/15/2017 08:33 PM, Jim wrote: On 05/15/2017 02:48 AM, Steven D'Aprano wrote: On Sun, May 14, 2017 at 10:57:57PM -0500, Jim wrote: I am running this on Mint 18. This is the third script I have written to open and position windows in workspaces. The first two work, but trying to open

Re: [Tutor] No file or directory error using subprocess and Popen

2017-05-15 Thread Jim
On 05/15/2017 07:03 AM, Peter Otten wrote: Jim wrote: I am running this on Mint 18. This is the third script I have written to open and position windows in workspaces. The first two work, but trying to open ebook-viewe r (calibre) with a specific book produces the following error. If I run the

Re: [Tutor] No file or directory error using subprocess and Popen

2017-05-15 Thread Jim
On 05/14/2017 11:19 PM, boB Stepp wrote: On Sun, May 14, 2017 at 10:57 PM, Jim wrote: I am running this on Mint 18. This is the third script I have written to open and position windows in workspaces. The first two work, but trying to open ebook-viewe r (calibre) with a specific book produces

Re: [Tutor] No file or directory error using subprocess and Popen

2017-05-15 Thread Jim
On 05/15/2017 02:48 AM, Steven D'Aprano wrote: On Sun, May 14, 2017 at 10:57:57PM -0500, Jim wrote: I am running this on Mint 18. This is the third script I have written to open and position windows in workspaces. The first two work, but trying to open ebook-viewe r (calibre) with a spe

[Tutor] No file or directory error using subprocess and Popen

2017-05-14 Thread Jim
d()) wid = wid[len(wid) - 11 : len(wid) - 3] x = '2540' #'1924' y = '537' print('***calibre***') subprocess.call(['xdotool', 'windowmove', str(wid), x, y]) I did some googling and it seems that subprocess does not have a length limit in linux. Could someone tell me how to correct the above error. Thanks, Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] General question rgrd. usage of libraries

2017-05-05 Thread Jim
There is a Python API to google sheets but when I had a look, it seemed fairly complex. I haven't tried it yet but depending on what you need to do this library may be what you need: https://pypi.python.org/pypi/gspread. Regards, Jim _

Re: [Tutor] Can a virtual environment be renamed?

2017-04-17 Thread Jim
On 04/16/2017 11:24 AM, Chris Warrick wrote: On 16 April 2017 at 18:16, Jim wrote: On 04/16/2017 10:10 AM, Chris Warrick wrote: On 16 April 2017 at 16:45, Jim wrote: My system python is 2.7.12 so I created a virtual environment using venu to run 3.5.2. I put it in /home/jfb/EVs/env. Now I

Re: [Tutor] Can a virtual environment be renamed?

2017-04-17 Thread Jim
On 04/16/2017 02:18 PM, Mats Wichmann wrote: On 04/16/2017 10:16 AM, Jim wrote: On 04/16/2017 10:10 AM, Chris Warrick wrote: On 16 April 2017 at 16:45, Jim wrote: My system python is 2.7.12 so I created a virtual environment using venu to run 3.5.2. I put it in /home/jfb/EVs/env. Now I would

Re: [Tutor] Can a virtual environment be renamed?

2017-04-16 Thread Jim
On 04/16/2017 10:10 AM, Chris Warrick wrote: On 16 April 2017 at 16:45, Jim wrote: My system python is 2.7.12 so I created a virtual environment using venu to run 3.5.2. I put it in /home/jfb/EVs/env. Now I would like to try 3.6 and put it in env36. Is it possible to change env to env35 for

[Tutor] Can a virtual environment be renamed?

2017-04-16 Thread Jim
My system python is 2.7.12 so I created a virtual environment using venu to run 3.5.2. I put it in /home/jfb/EVs/env. Now I would like to try 3.6 and put it in env36. Is it possible to change env to env35 for 3.5.2 without breaking things? Thanks, Jim

Re: [Tutor] Please explain part of this code

2017-02-15 Thread Jim
On 02/15/2017 04:56 PM, Alan Gauld via Tutor wrote: On 15/02/17 22:37, Jim wrote: self.choices = { "1": self.show_notes, "2": self.search_notes, "3": self.add_note, "4"

[Tutor] Please explain part of this code

2017-02-15 Thread Jim
ods require parameters) to the variable. I sort of understand what is going on with "action". All of the choices to the right of the :'s are methods defined elsewhere in the code. So I guess that will call whatever method is associated with a choice. I don't recall

Re: [Tutor] How to interact with the result of subprocess.call()

2017-02-01 Thread Jim
On 12/26/2016 04:48 AM, Peter Otten wrote: Jim Byrnes wrote: Is there a way to terminate subprocess and still keep LO open so pykeyboard can send it keystrokes from the script? In theory you can open Libre Office from another thread, wait a moment and then send it keystrokes from the main

Re: [Tutor] Using venv

2017-01-28 Thread Jim
On 01/27/2017 04:49 PM, Cameron Simpson wrote: On 27Jan2017 15:47, jim wrote: It has been suggested to me that I should use a virtual environment and venv would be a good choice. I've read through PEP405 and this link [1]. Though some of it seems a little confusing to me, I'm sure I

[Tutor] Using venv

2017-01-27 Thread Jim
ffice calc macros and evaluating pyspread for it's macro capability. Would modules installed in my venv be available to the spreadsheet programs? Thanks, Jim [1] https://realpython.com/blog/python/python-virtual-environments-a-primer/ ___

Re: [Tutor] How to interact with the result of subprocess.call()

2016-12-25 Thread Jim Byrnes
On 12/24/2016 07:43 PM, Alan Gauld via Tutor wrote: On 25/12/16 01:21, Jim Byrnes wrote: I am not trying to automate libreoffice using subprocess. No, but you are trying to automate LO from within Python by sending it keystrokes and that's not easy. That's why I previously asked w

Re: [Tutor] How to interact with the result of subprocess.call()

2016-12-24 Thread Jim Byrnes
On 12/24/2016 05:10 PM, Danny Yoo wrote: On Sat, Dec 24, 2016 at 2:40 PM, Jim Byrnes wrote: subprocess.call(['libreoffice', '/home/jfb/test.ods']) k.tap_key(k.enter_key) k.tap_key(k.enter_key) If I run the above code, libreoffice opens the test.ods spreadsheet then jus

[Tutor] How to interact with the result of subprocess.call()

2016-12-24 Thread Jim Byrnes
riginated the script. How can I continue to send keystrokes to libreoffice from the script once it has been opened by subprocess.call()? Thanks, Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mai

Re: [Tutor] Open a libreoffice calc file in Python

2016-12-22 Thread Jim Byrnes
On 12/22/2016 03:54 AM, Alan Gauld via Tutor wrote: On 22/12/16 03:37, Jim Byrnes wrote: Python 3.4 on Ubuntu If I was going to open a libreoffice calc file from the terminal I would go: libreoffice --calc /home/path/to/myfile.ods. How would I do this from Python? Others have advised how to

[Tutor] Open a libreoffice calc file in Python

2016-12-21 Thread Jim Byrnes
Python 3.4 on Ubuntu If I was going to open a libreoffice calc file from the terminal I would go: libreoffice --calc /home/path/to/myfile.ods. How would I do this from Python? Thanks, Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] comp.lang.python on gmane

2016-10-28 Thread Jim Byrnes
On 10/27/2016 09:54 PM, Random832 wrote: On Thu, Oct 27, 2016, at 20:40, Jim Byrnes wrote: Is comp.lang.python available on gmane? I've googled and found references to it being on gmane but I can't find it there. I'd like to use gmane because Comcast doesn't do usenet any

Re: [Tutor] comp.lang.python on gmane

2016-10-27 Thread Jim Byrnes
On 10/27/2016 08:09 PM, Danny Yoo wrote: On Thu, Oct 27, 2016 at 5:40 PM, Jim Byrnes wrote: Is comp.lang.python available on gmane? I've googled and found references to it being on gmane but I can't find it there. I'd like to use gmane because Comcast doesn't do usenet an

[Tutor] comp.lang.python on gmane

2016-10-27 Thread Jim Byrnes
Is comp.lang.python available on gmane? I've googled and found references to it being on gmane but I can't find it there. I'd like to use gmane because Comcast doesn't do usenet anymore. Thanks, Jim ___ Tutor maillist -

[Tutor] Accessing Yahoo with Python?

2016-10-08 Thread Jim Byrnes
ram 10 times, 9 of them will return the above error before I get the data I want. The part of my program that retrieves the data from Yahoo has not changed in quite a while. Is it possible that I have exceeded a Yahoo limit on requests from one IP address? Test data I am using gets the histori

Re: [Tutor] pip says no downloads for PyMedia

2016-09-13 Thread Jim Byrnes
On 09/13/2016 04:01 PM, boB Stepp wrote: On Tue, Sep 13, 2016 at 2:17 PM, Jim Byrnes wrote: On 09/12/2016 07:59 PM, Jim Byrnes wrote: On 09/12/2016 06:06 PM, boB Stepp wrote: On Sep 10, 2016 7:20 PM, "Jim Byrnes" wrote: I am using python3 could that be the problem? I

Re: [Tutor] pip says no downloads for PyMedia

2016-09-13 Thread Jim Byrnes
On 09/12/2016 07:59 PM, Jim Byrnes wrote: On 09/12/2016 06:06 PM, boB Stepp wrote: On Sep 10, 2016 7:20 PM, "Jim Byrnes" wrote: I am using python3 could that be the problem? I looked but couldn't find any info on what version of python is needed. I went to pymedia.org.

Re: [Tutor] pip says no downloads for PyMedia

2016-09-12 Thread Jim Byrnes
On 09/12/2016 06:06 PM, boB Stepp wrote: On Sep 10, 2016 7:20 PM, "Jim Byrnes" wrote: I am using python3 could that be the problem? I looked but couldn't find any info on what version of python is needed. I went to pymedia.org. The copyright at the bottom of the pa

[Tutor] pip says no downloads for PyMedia

2016-09-10 Thread Jim Byrnes
line 277, in find_requirement raise DistributionNotFound('No distributions at all found for %s' % req) pip.exceptions.DistributionNotFound: No distributions at all found for PyMedia I am using python3 could that be the problem? I looked but couldn't find any i

Re: [Tutor] tkinter/sqlite3?

2016-08-26 Thread Jim Byrnes
On 08/26/2016 04:22 AM, Alan Gauld via Tutor wrote: On 26/08/16 02:34, Jim Byrnes wrote: Exception in Tkinter callback Traceback (most recent call last): ... File "tk_pwds.py", line 56, in fill_accounts_lb cur.execute('''SELECT Account FROM pwds WHERE Ca

Re: [Tutor] tkinter/sqlite3?

2016-08-26 Thread Jim Byrnes
On 08/26/2016 02:03 AM, Peter Otten wrote: Jim Byrnes wrote: I am working with Python 3.4.3 on Ubuntu 14.04. I am learning tkinter so I decided to rewrite a program I had written in pythoncard in tkinter. I found that a sqlite3 SELECT statement that works in pythoncard throws an error in

[Tutor] tkinter/sqlite3?

2016-08-25 Thread Jim Byrnes
o tkinter and am curious why it works in the pythoncard version and not the tkinter version. I'm not sure where it is coming up with the 8 bindings it said are supplied? Thanks, Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Regex/Raw String confusion

2016-08-04 Thread Jim Byrnes
On 08/04/2016 03:27 AM, Alan Gauld via Tutor wrote: On 04/08/16 02:54, Jim Byrnes wrote: Is the second example a special case? phoneNumRegex = re.compile(r'(\(\d\d\d\)) (\d\d\d-\d\d\d\d)') I ask because it produces the same results with or without the ' r '. That's

Re: [Tutor] Regex/Raw String confusion

2016-08-03 Thread Jim Byrnes
On 08/03/2016 06:21 PM, Alan Gauld via Tutor wrote: On 03/08/16 20:49, Jim Byrnes wrote: Regular Expressions he talks about the python escape character being a '\' and regex using alot of backslashes. In effect there are two levels of escape character, python and the regex

[Tutor] Regex/Raw String confusion

2016-08-03 Thread Jim Byrnes
import re phoneNumRegex = re.compile(r'(\(\d\d\d\)) (\d\d\d-\d\d\d\d)') mo = phoneNumRegex.search('My phone number is: (415) 555-4242.') print(mo.group(1)) print() print(mo.group(2)) Both examples work, but one place he says you can't escape raw strings and t

Re: [Tutor] OOP help needed

2016-07-27 Thread Jim Byrnes
On 07/27/2016 04:04 AM, Alan Gauld via Tutor wrote: On 27/07/16 04:44, Jim Byrnes wrote: OOP has always driven me crazy. I read the material and follow the examples until I feel I understand them, but when I try to implement it I end up with an error filled mess. That suggests that its not

Re: [Tutor] OOP help needed

2016-07-27 Thread Jim Byrnes
On 07/27/2016 03:12 AM, Peter Otten wrote: Jim Byrnes wrote: OOP has always driven me crazy. I read the material and follow the examples until I feel I understand them, but when I try to implement it I end up with an error filled mess. So I decided to give it another try. When I got to the

Re: [Tutor] OOP help needed

2016-07-27 Thread Jim Byrnes
On 07/26/2016 11:38 PM, Ben Finney wrote: Jim Byrnes writes: So I decided to give it another try. When I got to the chapter on tkinter I decided to solve all the exercises using OOP even though the book solutions did not use OOP. Hmm, that sounds ill advised. OOP is one tool among many

[Tutor] OOP help needed

2016-07-26 Thread Jim Byrnes
tuations look the same to me but they must be different somehow and I just don't see the difference. Thanks, Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Variable in tkinter?

2016-07-24 Thread Jim Byrnes
On 07/24/2016 02:08 PM, Alan Gauld via Tutor wrote: On 23/07/16 16:38, Jim Byrnes wrote: # the views frame = tkinter.Frame(window) frame.pack() button = tkinter.Button(frame, text='Up', command=click_up) button.pack() button = tkinter.Button(frame, text='Down', command=cli

[Tutor] Variable in tkinter?

2016-07-23 Thread Jim Byrnes
is wrong because the program does work. Could someone explain to me why it works? Regards, Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Using python 3 on Ubuntu 14.04

2015-12-24 Thread Jim Byrnes
On 12/24/2015 04:03 PM, Ben Finney wrote: Jim Byrnes writes: Thanks for all the info guys. I got myself confused because I thought that python 3 was the default for Ubuntu 14.04, but it is just installed by default. Even if that were true, the ‘python’ command will likely still invoke a

Re: [Tutor] Using python 3 on Ubuntu 14.04

2015-12-24 Thread Jim Byrnes
roper environment. I know Pythoncard is not maintained any more. I have one program I wrote using it that I use often so I wanted to see it worked on 14.04. It will be a good learning experience to rewrite it for python 3 using something else. Regards,

Re: [Tutor] OT: How to automate user interactions with GUI elements of closed-source programs?

2015-12-24 Thread Jim Byrnes
sure about Chrome. Both also have user forums. Regards, Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Using python 3 on Ubuntu 14.04

2015-12-23 Thread Jim Byrnes
o run programs with it? Thanks, Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Calculation error with a simple program

2015-12-12 Thread Jim Gallaher
Hi Alan, I'm 100 percent sure I'm wrong. :-) I verified it when I fixed the mistake. The problem was it was adding in the basePrice and the fixed rates/percentages each time. So I figured it out when Ian said something about that. Thanks for everyone's help! :-)

[Tutor] Calculation error with a simple program

2015-12-12 Thread Jim Gallaher
a couple fees. For example, if I put in a value of 1, it will output 752.12 as the sub total and 753.12 as the grand total. It's off by 1 on sub total and 2 on grand total. Thanks in advance! Jim Gallaher # Car Salesman Calculator # User enters the base price of the car and the progra

[Tutor] method conflict?

2015-07-02 Thread Jim Mooney Py3.4.3winXP
def getdata(self): print(self.data) >>> MyClass.setdata >>> id(MyClass.setdata) 40676568 >>> f = MyClass() >>> g = MyClass() >>> id(f.setdata) 43576616 >>> id(g.setdata) 43576616

[Tutor] Are the methods in a class copied or just linked to?

2015-07-02 Thread Jim Mooney Py3.4.3winXP
When an instance uses a class method, does it actually use the method that is in the class object's memory space, or is the method copied to the instance? -- Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription op

[Tutor] Is there a way to use "with" across suite boundaries?

2015-05-22 Thread Jim Mooney Py3.4.3winXP
=ht) ht.close() def fprint(linelist, ht): # size formatting irrelevant for HTML formatted_string = "{}{}{}{}{}{}".format(*linelist) print(formatted_string, file=ht) print('', file=ht) if __name__ == "__main__": make_lines() -- Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Getting import to use a variable name

2015-05-21 Thread Jim Mooney Py3.4.3winXP
with > > print(attribute_name, attribute.__doc__) > Thanks. That will save a lot of scrolling - and saving scrolling and typing is half the battle ;') -- Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription option

Re: [Tutor] Getting import to use a variable name

2015-05-19 Thread Jim Mooney Py3.4.3winXP
On 19 May 2015 at 17:25, Jim Mooney Py3.4.3winXP wrote: > > If I can get dir to accept x I can parse the output to get rid of the > __xxx stuff and print it out. > By that I mean dir will give me a list of strings I can then use __doc__ on to get all useful help items. -- Ji

Re: [Tutor] Getting import to use a variable name

2015-05-19 Thread Jim Mooney Py3.4.3winXP
> x = 'shutil' >>> import importlib >>> importlib.__import__(x) >>> If I can get dir to accept x I can parse the output to get rid of the __xxx stuff and print it out. -- Jim After not doing dishes for a week and washing spoon after spoon, fork after fork, kni

[Tutor] Getting import to use a variable name

2015-05-19 Thread Jim Mooney Py3.4.3winXP
helps.append(helper) for helper in useful_helps: print(helper.upper() + ':', helper.__doc__, '\n') -- Jim After not doing dishes for a week and washing spoon after spoon, fork after fork, knife after knife - I suddenly understand the mathematical concept of in

Re: [Tutor] Terminology question

2015-05-16 Thread Jim Mooney Py3.4.3winXP
raise ZeroDivisionError('Here I am') def call_error(): try: make_error() except: print("How do I get the 'Here I am' message to print in the calling routine?") >>> call_error() How do I get the 'Here I am' message t

Re: [Tutor] Terminology question

2015-05-15 Thread Jim Mooney Py3.4.3winXP
but it didn't work. Could you provide a simple example? Sometimes the docs are heavy slogging if you don't already know what's what ;') -- Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https:

[Tutor] Terminology question

2015-05-14 Thread Jim Mooney Py3.4.3winXP
t;, err) return None vals = get_input() if vals: minimum, maximum, rows, columns = vals try: make_table(minimum, maximum, rows, columns) except ValueError as err: # CATCH FUNCTION ERROR HERE INSTEAD OF IN FUNCTION print("Enter min before max.") else:

Re: [Tutor] pointer puzzlement

2015-05-08 Thread Jim Mooney Py3.4.3winXP
On 7 May 2015 at 18:42, Dave Angel wrote: > Python doesn't have pointers So what is the difference between a python name and a pointer? I'm a bit fuzzy on that. -- Jim "What a rotten, failed experiment. I'll start over. Maybe dogs instead of mo

Re: [Tutor] pointer puzzlement

2015-05-07 Thread Jim Mooney Py3.4.3winXP
18263656, {'bonk': 'bonkitem'}) >>> testid('clonk') ('the ID is', 18263656, {'bonk': 'bonkitem', 'clonk': 'clonkitem'}) >>> testid('spam') ('th

[Tutor] pointer puzzlement

2015-05-07 Thread Jim Mooney Py3.4.3winXP
me? def testid(K=10): K += 10 return 'the ID is', id(K), K *** Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32. *** >>> testid() ('the ID is', 505991936, 20) >>> testid() ('the ID is', 5

Re: [Tutor] key detection

2015-05-06 Thread Jim Mooney Py3.4.3winXP
g for special keys, some were printed as hex codes but some as letters. i.e. F11 was b'\x85', but F9 and F10 were b'C' and b'D', so I assume the second byte of some function keys just happens to map to utf-8 letters. Sure enough, when I put in decoding again, F9 and F10

Re: [Tutor] key detection

2015-05-06 Thread Jim Mooney Py3.4.3winXP
On 6 May 2015 at 10:41, Jim Mooney Py3.4.3winXP wrote: > I went a further step from the recipes linked to above and got here >> https://pypi.python.org/pypi/readchar > > > I think that's the one that failed for me > Addendum. That only failed in python 3.4. It worked

Re: [Tutor] key detection

2015-05-06 Thread Jim Mooney Py3.4.3winXP
On 5 May 2015 at 21:51, Mark Lawrence wrote: > On 06/05/2015 05:30, Jim Mooney Py3.4.3winXP wrote: > >> On 5 May 2015 at 18:32, Steven D'Aprano wrote: >> >> https://code.activestate.com/recipes/577977-get-single-keypress/ >>> >> >> >> Th

Re: [Tutor] key detection

2015-05-05 Thread Jim Mooney Py3.4.3winXP
-reading-from-stdin/ Anyway, I set up msvcrt for now until I install linux - I'm not interested in the program I mentioned, per se, just the error message - mainly to know, generally, what sort of thing it's choking on. Errors are useful

Re: [Tutor] key detection

2015-05-05 Thread Jim Mooney Py3.4.3winXP
turn fd.read() File "c:\python34\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 2468: character maps to -- Jim "What a rot

  1   2   3   4   5   6   >