Re: [Tutor] simple question about scope SOLVED

2019-05-18 Thread marcus lütolf
Nachricht- Von: Tutor [mailto:tutor-bounces+marcus.luetolf=bluewin...@python.org] Im Auftrag von Alan Gauld via Tutor Gesendet: Samstag, 18. Mai 2019 12:34 An: tutor@python.org Betreff: Re: [Tutor] simple question about scope On 18/05/2019 09:20, marcus lütolf wrote: > in learning the princip

[Tutor] simple question about scope

2019-05-18 Thread marcus lütolf
Dear experts in learning the principles of Python I came across scope in the control structure's section. There I read the notion that variables createted inside a control structute can't be seen or accessed from outside that structure, Python would raise a Name Error. However in for loops - al

[Tutor] installation of Python 2.7 an 3.6, feedback

2017-12-24 Thread marcus lütolf
dear experts, while working through Alan C. Gould‘s excellent update on‘ Learning to Program‘ I copied the file echoinput.py from the ‚Conversing with the user‘ section: import sys inp = sys.stdin.readline() while inp.strip != '': print(inp) inp = sys.stdin.readline()

Re: [Tutor] failed installation of Python 2.7

2017-11-27 Thread marcus lütolf
many thanks, Peter I could install the newest version of python 3.6 without any problems but I need python 2.7 for tutorial purposes. Marcus. -Ursprüngliche Nachricht- Von: peter [mailto:peterrisle...@gmail.com] Gesendet: Montag, 27. November 2017 20:20 An: marcus lütolf Betreff: Re

[Tutor] failed installation of Python 2.7

2017-11-26 Thread marcus lütolf
dear experts, cleaning up my computer I removed all my different Python versions, saving all .py and .txt files. I could reinstall Python 3.6 but not Python 2.7, getting an error mesage: ‚a program required for this insatll could not be found‘. Searching different websites I could not solve t

[Tutor] principal question

2017-07-08 Thread marcus lütolf
dear experts, before I start digging into writing code I'd like your opinion: Is it possible to have python compare 2 subsequent *.jpg images in subtracting the pixel values of the second from the first image. If the images and are identical the result should be 0 and the first image could b

Re: [Tutor] counting function calls

2017-04-13 Thread marcus lütolf
ept KeyboardInterrupt: > print('PIR deaktiviert') Marcus. -Ursprüngliche Nachricht- Von: Mats Wichmann [mailto:m...@wichmann.us] Gesendet: Montag, 10. April 2017 15:15 An: marcus lütolf ; tutor@python.org Betreff: Re: [T

[Tutor] counting function calls

2017-04-10 Thread marcus lütolf
Dear experts, I have written the following code for motion detection with a PIR sensor with a function and I need to count how many times the funtion is called, but I get a traceback: #!/usr/bin/python3 import sys, time import RPi.GPIO as gpio gpio.setmode(gpio.BOARD) gpio.setup(23, gpio.IN) coun

[Tutor] installing openpyxl, problem still n o t solved

2016-07-25 Thread marcus lütolf
Dear Experts, I was too optimistic. Module ‚jdcal‘ ist indeed installed. However, I get another trace back concerning ‚et_xmlfile‘ even after I downloaded and saved it the same way as I did with ‚jdcal‘. Since I haven’t got any responses to my previous calls for help – my problem might be too un

[Tutor] installing openpyxl, problem solved

2016-07-24 Thread marcus lütolf
Dear Experts, problem solved, don’t bother, Marcus. …. Dear Experts, following instructions in a youtube video I thought I finally succeded to install openpyxl. However I got the traceback below: >>> import openpyxl Traceback (most recent call last): File

[Tutor] installing openpyxl

2016-07-24 Thread marcus lütolf
Dear Experts, following instructions in a youtube video I thought I finally succeded to install openpyxl. However I got the traceback below: >>> import openpyxl Traceback (most recent call last): File "", line 1, in import openpyxl File "C:\Users\marcus\AppData\Local\Programs\Python\

[Tutor] installing openpyxl

2016-07-17 Thread marcus lütolf
dear Experts, could someone please tell me what exactly I have to type in my a) Python 35 – command line or b) desktopcomputer ( W10, 64bit)-command line in ordert to install openpyxl which I downloaded in C:\Users\marcus\Downloads on my computer. I have used all kinds of commands with ‚pip i

[Tutor] installing openpyxl

2016-06-26 Thread marcus lütolf
dear Experts, first question : could someone please tell me what exactly I have to type in my a) Python 35 – command line or b) desktopcomputer ( W10, 64bit)-command line in ordert to install openpyxl which I downloaded in C:\Users\marcus\Downloads on my computer. I have used all kinds of comm

[Tutor] operations on lists

2016-04-16 Thread marcus lütolf
Hello experts I'am working exercise 5. of 'Practical Programming 2nd edition, .using Python 3' (operations on lists). The following code get's me wrong results: >>> metals = [['beryllium', 4],['magnesium', 12], ['calcium', 20], >>> ['strontium', 38], ['barium', 56], ['radium', 88]] >>> max

Re: [Tutor] trouble with beautiful soup

2016-01-02 Thread marcus lütolf
-Ursprüngliche Nachricht- Von: Danny Yoo [mailto:d...@hashcollision.org] Gesendet: Freitag, 1. Januar 2016 19:17 An: Alan Gauld Cc: marcus lütolf ; Python Tutor Mailing List Betreff: Re: [Tutor] trouble with beautiful soup According to the documentation for Beautiful Soup 3

Re: [Tutor] trouble with beautiful soup

2016-01-01 Thread marcus lütolf
Thanks, I reinstalled the 64bit version but get the same traceback in Python Shell, also usin ..from bs4. Regards, Marcus -Ursprüngliche Nachricht- Von: Alan Gauld [mailto:alan.ga...@btinternet.com] Gesendet: Freitag, 1. Januar 2016 12:25 An: marcus lütolf ; tutor@python.org Betreff: Re

Re: [Tutor] trouble with beautiful soup

2016-01-01 Thread marcus lütolf
-- -Ursprüngliche Nachricht- Von: Tutor [mailto:tutor-bounces+marcus.luetolf=bluewin...@python.org] Im Auftrag von Alan Gauld Gesendet: Donnerstag, 31. Dezember 2015 18:54 An: tutor@python.org Betreff: Re: [Tutor] trouble with beautiful

Re: [Tutor] trouble with beautiful soup

2015-12-31 Thread marcus lütolf
tor [mailto:tutor-bounces+marcus.luetolf=bluewin...@python.org] Im Auftrag von Mark Lawrence Gesendet: Montag, 28. Dezember 2015 20:23 An: tutor@python.org Betreff: Re: [Tutor] trouble with beautiful soup On 28/12/2015 17:24, marcus lütolf wrote: > Dear Pythonistas > Hi Danny, > > I

Re: [Tutor] trouble with beautiful soup

2015-12-30 Thread marcus lütolf
in...@python.org] Im Auftrag von Mark Lawrence Gesendet: Montag, 28. Dezember 2015 20:23 An: tutor@python.org Betreff: Re: [Tutor] trouble with beautiful soup On 28/12/2015 17:24, marcus lütolf wrote: > Dear Pythonistas > Hi Danny, > > I am grateful for your precise instruchtions. &g

Re: [Tutor] trouble with beautiful soup

2015-12-28 Thread marcus lütolf
rs. Regards, Marcus. -- -Ursprüngliche Nachricht- Von: Danny Yoo [mailto:d...@hashcollision.org] Gesendet: Samstag, 26. Dezember 2015 22:00 An: marcus lütolf Cc: python mail list Betreff: Re: [Tutor] trouble with beautif

Re: [Tutor] trouble with beautiful soup

2015-12-26 Thread marcus lütolf
my trouble ? By the way, I am using W10 64 bit as OS. Regards, Marcus. Von: Walter Prins [mailto:wpr...@gmail.com] Gesendet: Samstag, 26. Dezember 2015 03:13 An: marcus lütolf Cc: python mail list Betreff: Re: [Tutor] trouble with beautiful soup Hi, On 25 December 2015 at 20:28

Re: [Tutor] trouble with beautiful soup

2015-12-25 Thread marcus lütolf
s mail. Bless you, Marcus. -Ursprüngliche Nachricht- Von: Jos Kerc [mailto:josk...@gmail.com] Gesendet: Donnerstag, 24. Dezember 2015 19:50 An: marcus lütolf Cc: tutor@python.org Betreff: Re: [Tutor] trouble with beautiful soup Hi, see below. On Thu, Dec 24, 2015 at 6:21 PM, marcus l

Re: [Tutor] trouble with beautiful soup

2015-12-24 Thread marcus lütolf
de by relieved the trace back mentioned in my previous mail. Bless you, Marcus. -Ursprüngliche Nachricht- Von: Jos Kerc [mailto:josk...@gmail.com] Gesendet: Donnerstag, 24. Dezember 2015 19:50 An: marcus lütolf Cc: tutor@python.org Betreff: Re: [Tutor] trouble with beautiful sou

[Tutor] trouble with beautiful soup

2015-12-24 Thread marcus lütolf
dear pythonistas, for hours I'am traying to use Beautiful Soup for scraping some websites as an exercise. But each time I run the code below: >>> import urllib >>> from BeautifulSpoup import * >>> url = raw_input( 'Enter -') >>> html = urllib.urlopen(url).read() >>> soup = B

[Tutor] how to invert tuples, one problem more

2015-11-27 Thread marcus lütolf
dear pythonistas, thanks for your very valuable help. I am struggling with a simple piece of code: >>> x = Marcus >>> print '{0} {1} x'.format('a', '=') which gives me >>> a = x instead of >>> a = Marcus What's wrong ? Marcus. --- Diese E-Mail wurde von Avast Antivirus-Software auf Viren g

[Tutor] how to invert tuples, 2nd question solved

2015-11-23 Thread marcus lütolf
dear pythonistas, i solved my 2. question in my mail of Sunday 22.11.2015 21:59, sorry for bothering you, Marcus. --- Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft. https://www.avast.com/antivirus ___ Tutor maillist - Tutor@pyt

[Tutor] how to invert tuples

2015-11-22 Thread marcus lütolf
dear pythonistas i have written the code below for identifying tuples occurring twice or more times in the list of tuples called "flights". 1. Question: How can i modify this code so it does not matter which string is first and which is second or (h,i) == (i,h) respectively ? 2. Question: On my

Re: [Tutor] Creating lists with 3 (later4) items occuring only once

2015-09-27 Thread marcus lütolf
rcus. -------- -Ursprüngliche Nachricht- Von: Martin A. Brown [mailto:mar...@linux-ip.net] Gesendet: Samstag, 26. September 2015 19:38 An:

Re: [Tutor] Creating lists with 3 (later4) items occuring only once

2015-09-27 Thread marcus lütolf
itertools. I hope I can be successfull with your code below although it will me take time to comprehend it. Sorry for this long text, regards, Marcus. -Ursprüngliche Nachricht- Von: Martin A. Brown [mailto:mar...@linux-ip.net] Gesendet: Dienstag, 22. September 2015 03:10 An: marcus lütolf Cc

Re: [Tutor] Creating lists with 3 (later4) items occuring only once

2015-09-21 Thread marcus lütolf
on: Tutor [mailto:tutor-bounces+marcus.luetolf=bluewin...@python.org] Im Auftrag von Alan Gauld Gesendet: Freitag, 18. September 2015 18:58 An: tutor@python.org Betreff: Re: [Tutor] Creating lists with 3 (later4) items occuring only once On 18/09/15 16:41, marcus lütolf wrote: >>>> s

[Tutor] Creating lists with 3 (later4) items occuring only once

2015-09-18 Thread marcus lütolf
dear pythonistas in the code below >>> import string, itertools >>> s = ['ab','ac','bc','ad','ae','de'] >>> count = 0 >>> for startlist in itertools.combinations(s, 3): >>> count = count + 1 >>> stl = list(startlist) >>> print count, stl >>> for pair in s: >>> x = stl

[Tutor] Creating lists with definite (n) items without repetitions

2015-09-18 Thread marcus lütolf
dear pythonistas, in the code below: how can I solve my task wit n items ? Thank you for help, Marcus. --- Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft. https://www.avast.com/antivirus ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] Creating lists with definite (n) items without repetitions

2015-09-04 Thread marcus lütolf
Hello Peter, hello Martin, many thanks for your very quick response !!! As for Peter's advice: > At first I thought you might want itertools.combinations() > import string, itertools for t in itertools.combinations(string.ascii_lowercase, 3): > ... print t # list(t) if you actually

[Tutor] Creating lists with definite (n) items without repetitions

2015-09-03 Thread Marcus Lütolf
dear pythonistats as a newcomber I want to create a set of lists containing n items, for example n = 3: (['a','b','c'], ['a','d','e']...). The sequence of items in each list should be different. If the letters 'a''z' are used and n = 3 there is a maximum of 301 lists. The following

[Tutor] Loops

2015-04-05 Thread Marcus Lütolf
Why do I get this traceback with the infinite loop below but not with the definitw loop (bottom of mail)? Thanks for help, Marcus. count = 0 total = 0 while True: x = raw_input('Enter a number') count = count + 1 total = total + x print count, total, (total/count) T