Re: [Tutor] python question

2019-08-18 Thread Steven D'Aprano
On Sun, Aug 18, 2019 at 12:35:52PM +0800, Thejal Ramesh wrote: > Hi, i have a question regarding this question. I'm not quite sure what the > question is asking. Ask your tutor. We can help you with learning Python the programming language, not graph theory.

Re: [Tutor] python question

2019-08-18 Thread Alan Gauld via Tutor
On 18/08/2019 05:35, Thejal Ramesh wrote: > Hi, i have a question regarding this question. I'm not quite sure what the > question is asking. > Part A: Popular (1.5 Marks) > Write a function popular(graph list, n) that returns a list of people who > have at least n friends. Each person is

[Tutor] python question

2019-08-18 Thread Thejal Ramesh
Hi, i have a question regarding this question. I'm not quite sure what the question is asking. Part A: Popular (1.5 Marks) Write a function popular(graph list, n) that returns a list of people who have at least n friends. Each person is identified by the number of their vertex. Input: a nested

Re: [Tutor] Python code

2019-08-01 Thread David Rock
maybe a copy/paste of your terminal session so we can see the text of the steps you are actually performing will give use some clues. — David > On Aug 1, 2019, at 18:22, David L Neil wrote: > > On 2/08/19 3:23 AM, Spencer Wannemacher wrote: >> I'm new to python and I was trying to perform a

Re: [Tutor] Python code

2019-08-01 Thread David L Neil
On 2/08/19 3:23 AM, Spencer Wannemacher wrote: I'm new to python and I was trying to perform a simple one code. All that is included in the code is print(61). I save it as 61.py and change the directory before typing in python 61.py and I don't get an output. There is no error and the output

Re: [Tutor] Python code

2019-08-01 Thread Cameron Simpson
On 01Aug2019 15:23, Spencer Wannemacher wrote: I'm new to python and I was trying to perform a simple one code. All that is included in the code is print(61). I save it as 61.py and change the directory before typing in python 61.py and I don't get an output. There is no error and the output

[Tutor] Python code

2019-08-01 Thread Spencer Wannemacher
I'm new to python and I was trying to perform a simple one code. All that is included in the code is print(61). I save it as 61.py and change the directory before typing in python 61.py and I don't get an output. There is no error and the output is blank. Please let me know what I'm doing

[Tutor] Python and Django dev available

2019-08-01 Thread Sithembewena L. Dube
Hi everyone, I'm a developer with just over 10 years' experience under my belt. I've worked with many languages and frameworks, including the popular Django web framework. I'm currently in the market for remote opportunities. Please reply if looking for a resource. Serious enquiries only please.

Re: [Tutor] python idle file couldn't start

2019-07-24 Thread Flynn, Stephen (Life & Pensions)
What (precisely) did you type to "start python through idle"? Don't guess - cut and pasted EXACTLY what you type and what you see on screen. S. -Original Message- From: Tutor On Behalf Of siva Sent: 24 July 2019 08:57 To: tutor@python.org Subject: [Tutor] python idle fil

[Tutor] python idle file couldn't start

2019-07-24 Thread siva
I have tried to start python through idle .but the software didn’t start.it displays “subprocess error”.tell me some solution. Thank you. Sent from Mail for Windows 10 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] Python Generator expressions

2019-07-23 Thread Steven D'Aprano
On Wed, Jul 24, 2019 at 11:26:26AM +1200, David L Neil wrote: > Clarifying the difference/similarity in appearance between a generator > expression and a tuple, it might help to think that it is the comma(s) > which make it a tuple! David makes an excellent point here. Except for the special

Re: [Tutor] Python Generator expressions

2019-07-23 Thread Steven D'Aprano
On Tue, Jul 23, 2019 at 10:36:01PM +0530, Animesh Bhadra wrote: > Hi All, > > Need one help in understanding generator expression/comprehensions. > > This is my sample code. Lots of missing spaces in your code! Don't forget to hit the space bar between words :-) Also missing indentation,

Re: [Tutor] Python Generator expressions

2019-07-23 Thread Mats Wichmann
On 7/23/19 11:06 AM, Animesh Bhadra wrote: > Hi All, > > Need one help in understanding generator expression/comprehensions. > > This is my sample code. > > # This code creates a generator and not a tuple comprehensions. > my_square =(num *num fornum inrange(11)) > print(my_square) # at

Re: [Tutor] Python Generator expressions

2019-07-23 Thread David L Neil
Hi Animesh, Unfortunately the list server/email has removed the formatting from your sample, but no matter... On 24/07/19 5:06 AM, Animesh Bhadra wrote: # This code creates a generator and not a tuple comprehensions. my_square =(num *num fornum inrange(11)) print(my_square) # at

[Tutor] Python Generator expressions

2019-07-23 Thread Animesh Bhadra
Hi All, Need one help in understanding generator expression/comprehensions. This is my sample code. # This code creates a generator and not a tuple comprehensions. my_square =(num *num fornum inrange(11)) print(my_square) # at 0x7f3c838c0ca8> # We can iterate over the square generator like

Re: [Tutor] Python Imported Code

2019-07-20 Thread Albert-Jan Roskam
On 25 Jun 2019 15:50, stephen.m.sm...@comcast.net wrote: Introduction: I have written a 'program' that does some reasonable screen scraping off of a specific website. The program has gotten too large so I have tried to segment it into logical pieces (tkinter logic as a start) but I am having

Re: [Tutor] Python 3.7 Grids

2019-06-29 Thread boB Stepp
On Sat, Jun 29, 2019 at 2:02 AM David Merrick wrote: > > Hi Looking for a way to use the determine the position of a card in a grid > using the mouse click event in Python. Code is attached. There are no > viruses. > > Unfortunately using Tinkter grids / frames can't determine between the two >

Re: [Tutor] [Python-Help] Writing hello world

2019-06-29 Thread Bob Gailer
On Jun 28, 2019 9:26 AM, "Erastus muriithi" wrote: > > Iam a student..iam interested in learning python,,I don't know how to study this python.kindly help me how to go about it..Thankyou First make sure you have python installed on your computer. If you need help with that let us know what kind

Re: [Tutor] Python 3.7 Grids

2019-06-29 Thread Bob Gailer
On Jun 29, 2019 3:01 AM, "David Merrick" wrote: > > Hi Looking for a way to use the determine the position of a card in a grid > using the mouse click event in Python. Code is attached. Unfortunately this list does not forward attachments. Either give us a link to the code or even better if it's

[Tutor] Python 3.7 Grids

2019-06-29 Thread David Merrick
Hi Looking for a way to use the determine the position of a card in a grid using the mouse click event in Python. Code is attached. There are no viruses. Unfortunately using Tinkter grids / frames can't determine between the two demo cards. Any suggestions are welcome -- Dave Merrick

[Tutor] Python 3.7 Grids

2019-06-29 Thread David Merrick
Hi Looking for a way to use the determine the position of a card in a grid using the mouse click event in Python. Code is attached. Unfortunately using Tinkter grids / frames can't determine between the two demo cards. The Relevant code is below def showCardInitial(cardList): cardsToPlay =

Re: [Tutor] Python and DB

2019-06-27 Thread Alan Gauld via Tutor
On 27/06/2019 22:20, Brave Heart via Tutor wrote: > I would like python to write to DB so I can from DB write on a webpage with > PHP... Yes, that's easy enough. Python supports access to many databases, do you have one in mind? If not the SQLite module that comes in the standard library is

Re: [Tutor] Python and DB

2019-06-27 Thread Cameron Simpson
On 27Jun2019 23:20, Brave Heart wrote: I have a little RSS program , I current the out are basically outputted on my screen, but I would like python to write to DB so I can from DB write on a webpage with PHP... Kinda like I want to run a news website .. See the "sqlite3" module with ships

Re: [Tutor] Python and DB

2019-06-27 Thread Mats Wichmann
On 6/27/19 3:20 PM, Brave Heart via Tutor wrote: > I have a little RSS program , I current the out are basically outputted on my > screen, but I would like python to write to DB so I can from DB write on a > webpage with PHP... > > Kinda like I want to run a news website .. There doesn't seem

[Tutor] Python and DB

2019-06-27 Thread Brave Heart via Tutor
I have a little RSS program , I current the out are basically outputted on my screen, but I would like python to write to DB so I can from DB write on a webpage with PHP... Kinda like I want to run a news website .. Sent from Mail for Windows 10

Re: [Tutor] Python Imported Code

2019-06-25 Thread Alan Gauld via Tutor
On 25/06/2019 14:50, stephen.m.sm...@comcast.net wrote: > using global, but that fails. I also can't seem to use arguments because the > module that tkinter fires up with this command: > > self.process_button = tk.Button(master, text='Process Request', \ >

[Tutor] Python Imported Code

2019-06-25 Thread stephen.m.smith
Introduction: I have written a 'program' that does some reasonable screen scraping off of a specific website. The program has gotten too large so I have tried to segment it into logical pieces (tkinter logic as a start) but I am having problems. Specifically I need to pass several dictionaries to

Re: [Tutor] python

2019-06-25 Thread Bob Gailer
On Jun 25, 2019 8:52 AM, "Shaon Debnath" wrote: > > I just wanted to know all about map() function in python. See https://www.geeksforgeeks.org/python-map-function/. If after reading that you still have questions please come back and ask them. Bob Gailer

[Tutor] python

2019-06-25 Thread Shaon Debnath
I just wanted to know all about map() function in python. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python type annotation question

2019-06-24 Thread Mats Wichmann
On 6/24/19 12:48 PM, Arup Rakshit wrote: > I am little experimenting with Python type annotation today. I wrote a simple > class as below: > from datetime import date class Person: > ... dob: date > ... def __init__(self, dob): > ... self.dob = dob > ...

[Tutor] Python type annotation question

2019-06-24 Thread Arup Rakshit
I am little experimenting with Python type annotation today. I wrote a simple class as below: >>> from datetime import date >>> class Person: ... dob: date ... def __init__(self, dob): ... self.dob = dob ... >>> Person(11) <__main__.Person object at 0x10e078128> >>> p =

Re: [Tutor] Python printing parentheses and quotes

2019-06-11 Thread Sai Allu
: Cameron Simpson Sent: Monday, June 10, 2019 5:34 PM To: Sai Allu Cc: Mats Wichmann; tutor@python.org; Deepak Dixit Subject: Re: [Tutor] Python printing parentheses and quotes On 10Jun2019 19:04, Sai Allu wrote: >Actually I'm pretty sure what happened was that the "#! usr/bin/python" was

Re: [Tutor] Python printing parentheses and quotes

2019-06-10 Thread Cameron Simpson
On 10Jun2019 19:04, Sai Allu wrote: Actually I'm pretty sure what happened was that the "#! usr/bin/python" was in a module that was being imported. So the Python interpreter cached it or somehow crashed randomly, which meant that the print was working as a keyword instead of a function. But

Re: [Tutor] Python printing parentheses and quotes

2019-06-10 Thread Sai Allu
quot;#! usr/bin/python" line and then rewrote the print statements, it went back to working normally. Thank you for the help though! Sai Allu From: Sai Allu Sent: Monday, June 10, 2019 11:53 AM To: Mats Wichmann; tutor@python.org; Deepak Dixit Subject: Re: [Tu

Re: [Tutor] Python printing parentheses and quotes

2019-06-10 Thread Sai Allu
Allu; tutor@python.org Subject: Re: [Tutor] Python printing parentheses and quotes On 6/10/19 10:50 AM, Sai Allu wrote: > Hello! > > I was just wondering if anybody encountered an issue where the Python > interpreter was changing how it interprets print statements. So I'm using >

Re: [Tutor] Python printing parentheses and quotes

2019-06-10 Thread Alan Gauld via Tutor
On 10/06/2019 17:50, Sai Allu wrote: > Basically what happened was that I had a few lines in the script like this > ip = "10.41.17.237" > print(" Welcome to Squid Monitoring for ", ip) > print("") > > and the output was like this > > (" Welcome to Squid Monitoring for

Re: [Tutor] Python printing parentheses and quotes

2019-06-10 Thread Mats Wichmann
On 6/10/19 10:50 AM, Sai Allu wrote: > Hello! > > I was just wondering if anybody encountered an issue where the Python > interpreter was changing how it interprets print statements. So I'm using > default Python on Mac OSX (2.7.10 I'm pretty sure) and running with the > "python script.py"

[Tutor] Python printing parentheses and quotes

2019-06-10 Thread Sai Allu
Hello! I was just wondering if anybody encountered an issue where the Python interpreter was changing how it interprets print statements. So I'm using default Python on Mac OSX (2.7.10 I'm pretty sure) and running with the "python script.py" command. Basically what happened was that I had a

Re: [Tutor] Python Django Query

2019-04-02 Thread nitin chandra
Thanks Cameron, Just got lucky yesterday and found a resource at my end to help me out. Thank you On Tue, 2 Apr 2019 at 04:31, Cameron Simpson wrote: > > On 29Mar2019 21:18, nitin chandra wrote: > >Hi Everyone, > >I need some guidance / corrections to my code. > >I hosted a demo site on

Re: [Tutor] Python Django Query

2019-04-01 Thread Cameron Simpson
On 29Mar2019 21:18, nitin chandra wrote: Hi Everyone, I need some guidance / corrections to my code. I hosted a demo site on pythonanywhere.com and to test the initial pages I wrote some test code. [...] Hi Nitin, I looks like nobody has replied; this probably means that nobody has the

[Tutor] Python Django Query

2019-03-29 Thread nitin chandra
Hi Everyone, I need some guidance / corrections to my code. I hosted a demo site on pythonanywhere.com and to test the initial pages I wrote some test code. Good news, put in 10 hrs, tried so many suggestion given on the net, yet non worked. So finally mailing the list. Objective : display

Re: [Tutor] Python Regular Expressions (Re.sub) Function

2019-03-04 Thread Alan Gauld via Tutor
On 04/03/2019 08:04, Edward Kanja wrote: > ... Unfortunately after i extract the data > my output has too much of square brackets and by so doing the output cant > be well exported in a csv file. I can't see the data so can't be definitive but the number of square brackets shouldn't affect a CSV

Re: [Tutor] Python Regular Expressions (Re.sub) Function

2019-03-04 Thread Steven D'Aprano
Hi Edward, and welcome. Please remember that we're volunteers, doing this for free. Unless your problem is really interesting, you're not likely to get people volunteering to spend a long time slogging through multiple attachments, screenshots, at least five seperate attempts, etc. By the

[Tutor] Python Regular Expressions (Re.sub) Function

2019-03-04 Thread Edward Kanja
Hi there, Hope this finds you well, I'm working on a simple project to analyse data using regular expressions. I have successfully worked on a regular expression pattern that extracts data from my txt file. Unfortunately after i extract the data my output has too much of square brackets and by so

Re: [Tutor] Python Websocket Server

2019-02-14 Thread Mats Wichmann
On 2/14/19 9:44 AM, Simon Connah wrote: > Hi, > > I was wondering what the best practice for writing web socket servers in > Python was in 2019? I found an old example on the web which used the > tornado library but that was talking about Chrome 22 as the client which > is ancient now so I'm not

Re: [Tutor] Python Websocket Server

2019-02-14 Thread Alan Gauld via Tutor
On 14/02/2019 16:44, Simon Connah wrote: > I was wondering what the best practice for writing web socket servers in > Python was in 2019? I can't answer that directly since I've never used web sockets in Python (and only played with them in Java). But... > I found an old example on the web

[Tutor] Python Websocket Server

2019-02-14 Thread Simon Connah
Hi, I was wondering what the best practice for writing web socket servers in Python was in 2019? I found an old example on the web which used the tornado library but that was talking about Chrome 22 as the client which is ancient now so I'm not sure if things have changed? Any suggestions

Re: [Tutor] python-files

2019-01-27 Thread Alan Gauld via Tutor
On 27/01/2019 14:57, Asad wrote: > print("first:", args.first) > print("second:", args.second) > > When I execute the script it gives error : > > python python_json_20001_oratest_v1.py "file1" > ('first:', 'file1') > ('second:', None) Note that the second file is None. > Traceback (most

Re: [Tutor] python-files

2019-01-27 Thread Peter Otten
Asad wrote: > Hi All , > > I tried the following code : > > parser = argparse.ArgumentParser() > parser.add_argument("first") > parser.add_argument("second", nargs="?") > args = parser.parse_args() > print("first:", args.first) > > print("second:", args.second) > > When I execute

Re: [Tutor] python-files

2019-01-27 Thread Asad
.@web.de> > To: tutor@python.org > Cc: > Bcc: > Date: Sun, 27 Jan 2019 10:30:12 +0100 > Subject: Re: [Tutor] python - files > Cameron Simpson wrote: > > > Mats has mentioned the modules getopt and argparse etc. These are > > primarily aimed at option parsing

Re: [Tutor] python - files

2019-01-27 Thread Cameron Simpson
On 27Jan2019 10:30, Peter Otten <__pete...@web.de> wrote: Cameron Simpson wrote: Mats has mentioned the modules getopt and argparse etc. These are primarily aimed at option parsing ("-v", "-o foo"). Your situation occurs _after_ the option parsing (in your case, there are no options). Not

Re: [Tutor] python - files

2019-01-27 Thread Peter Otten
Cameron Simpson wrote: > Mats has mentioned the modules getopt and argparse etc. These are > primarily aimed at option parsing ("-v", "-o foo"). Your situation > occurs _after_ the option parsing (in your case, there are no options). Not argparse. The main advantage over optparse is its handling

Re: [Tutor] python - files

2019-01-26 Thread Cameron Simpson
Mats has mentioned the modules getopt and argparse etc. These are primarily aimed at option parsing ("-v", "-o foo"). Your situation occurs _after_ the option parsing (in your case, there are no options). Alan has talked about explicitly checking the length of sys.argv, much as you are doing,

Re: [Tutor] python - files

2019-01-26 Thread Mats Wichmann
On 1/26/19 1:20 AM, Asad wrote: > Hi All , > >I would like to know how do I make and option file as an argument on > command propmnt in python I don't know your context for asking this question. Alan has already explained what you need to do for your issue, and whatever your needs it is

Re: [Tutor] python - files

2019-01-26 Thread Alan Gauld via Tutor
On 26/01/2019 08:20, Asad wrote: >At present I using : > > if len(sys.argv) == 3: > first = sys.argv[1] > second = sys.argv[2] > else: > print "enter the second argument" > It works well for the following command : > python test.py file1 file2 Correct because it tests if

[Tutor] python - files

2019-01-26 Thread Asad
Hi All , I would like to know how do I make and option file as an argument on command propmnt in python . At present I using : if len(sys.argv) == 3: first = sys.argv[1] second = sys.argv[2] else: print "enter the second argument" It works well for the following

Re: [Tutor] Python installtion

2019-01-13 Thread Stephen Nelson-Smith
Hi, On Mon, Jan 7, 2019 at 11:11 AM mousumi sahu wrote: > > Dear Sir, > I am trying to install python 2.7.10 on HPC. Python 2.6 has already been > install on root. I do not have root authority. Please suggest me how can I > do this. Sorry - I replied to you directly, by accident. Take 2, with

Re: [Tutor] Python installtion

2019-01-07 Thread Oscar Benjamin
On Mon, 7 Jan 2019 at 11:10, mousumi sahu wrote: > > Dear Sir, > I am trying to install python 2.7.10 on HPC. Python 2.6 has already been > install on root. I do not have root authority. Please suggest me how can I > do this. Does HPC stand for High-Performance Computing? Are you trying to set

Re: [Tutor] Python installtion

2019-01-07 Thread Steven D'Aprano
On Mon, Jan 07, 2019 at 03:36:01PM +0530, mousumi sahu wrote: > Dear Sir, > I am trying to install python 2.7.10 on HPC. Python 2.6 has already been > install on root. I do not have root authority. Please suggest me how can I > do this. What's HPC? If you don't have root permission, do you have

[Tutor] Python installtion

2019-01-07 Thread mousumi sahu
Dear Sir, I am trying to install python 2.7.10 on HPC. Python 2.6 has already been install on root. I do not have root authority. Please suggest me how can I do this. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] Python

2018-12-20 Thread Steven D'Aprano
On Thu, Dec 20, 2018 at 10:49:25AM -0500, Mary Sauerland wrote: > I want to get rid of words that are less than three characters > f1_name = "/Users/marysauerland/Documents/file1.txt" > #the opinions > f2_name = "/Users/marysauerland/Documents/file2.txt" > #the constitution Better than

Re: [Tutor] Python

2018-12-20 Thread Avi Gross
December 20, 2018 10:49 AM To: tutor@python.org Subject: [Tutor] Python Hi, I want to get rid of words that are less than three characters but I keep getting errors. I tried multiple ways but keep getting errors. Here is my code: f1_name = "/Users/marysauerland/Documents/file1.txt"

Re: [Tutor] Python

2018-12-20 Thread Mats Wichmann
On 12/20/18 8:49 AM, Mary Sauerland wrote: > Hi, > > I want to get rid of words that are less than three characters but I keep > getting errors. I tried multiple ways but keep getting errors. Just a quick note or two: > > Here is my code: > > f1_name =

Re: [Tutor] Python

2018-12-20 Thread Bob Gailer
On Dec 20, 2018 12:17 PM, "Mary Sauerland" wrote: > > Hi, > > I want to get rid of words that are less than three characters but I keep getting errors. I tried multiple ways but keep getting errors. Hi Mary welcome to the tutor list. We love to help. We are a few volunteers. It is very difficult

[Tutor] Python

2018-12-20 Thread Mary Sauerland
Hi, I want to get rid of words that are less than three characters but I keep getting errors. I tried multiple ways but keep getting errors. Here is my code: f1_name = "/Users/marysauerland/Documents/file1.txt" #the opinions f2_name = "/Users/marysauerland/Documents/file2.txt" #the

Re: [Tutor] Python function

2018-12-14 Thread Avi Gross
@python.org Subject: Re: [Tutor] Python function On 13/12/2018 17:21, Sammy Lee wrote: > How do I create a python function that opens a CSV file and determines > how many columns of data are in the file? The CSV files have been > randomly generated from https://www.mockaroo.com/

Re: [Tutor] Python function

2018-12-13 Thread Alan Gauld via Tutor
On 13/12/2018 17:21, Sammy Lee wrote: > How do I create a python function that opens a CSV file and determines how > many columns > of data are in the file? The CSV files have been randomly generated from > https://www.mockaroo.com/ > > def csv_column_count(openfile): You will find a bunch of

Re: [Tutor] Python function

2018-12-13 Thread Bob Gailer
On Dec 13, 2018 1:55 PM, "Sammy Lee" wrote: > > How do I create a python function that opens a CSV file and determines how many columns > of data are in the file? The CSV files have been randomly generated from https://www.mockaroo.com/ > > def csv_column_count(openfile): Same comments as I made

[Tutor] Python function

2018-12-13 Thread Sammy Lee
How do I create a python function that opens a CSV file and determines how many columns of data are in the file? The CSV files have been randomly generated from https://www.mockaroo.com/ def csv_column_count(openfile): ___ Tutor maillist -

Re: [Tutor] Python script errors

2018-12-12 Thread Steven D'Aprano
On Wed, Dec 12, 2018 at 06:57:09AM -0600, Ravi Kumar wrote: > I know this occurs when the api response is nulls but how do I handle this? if response is None: handle None case else: handle non-None case -- Steve ___ Tutor maillist -

Re: [Tutor] Python script errors

2018-12-12 Thread Peter Otten
Ravi Kumar wrote: > Hi, > > I have developed a python script to get api calls for meraki > clientlogevents Thanks for all the help previously I am facing few errors > such as > > Json_string=r.json() > > raw_decode > raise JSONDecodeError("Expecting value", s, err.value) from None >

Re: [Tutor] Python script errors

2018-12-12 Thread Alan Gauld via Tutor
On 12/12/2018 12:57, Ravi Kumar wrote: > '{0:20} {1:30} {2:16} {3:18} {4:10} {5:11} '.format( > deviceserial, type, macaddress,occurredAt, details)) > TypeError: unsupported format string passed to NoneType.__format__ You have 6 format holders in your string but you only pass 5

[Tutor] Python script errors

2018-12-12 Thread Ravi Kumar
Hi, I have developed a python script to get api calls for meraki clientlogevents Thanks for all the help previously I am facing few errors such as Json_string=r.json() raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value:

Re: [Tutor] [Python 3] Threads status, join() and Semaphore queue

2018-11-24 Thread Cameron Simpson
On 24Nov2018 16:08, Dimitar Ivanov wrote: Your explanation definitely clears up quite a bit of my misunderstanding, thank you for that! There was a reason why I shy away from using Queue, but for the life of me I can't remember right now what that reason was. I will have to modify my code

Re: [Tutor] [Python 3] Threads status, join() and Semaphore queue

2018-11-24 Thread Dimitar Ivanov
Hi Cameron, Massive apologies for the delayed answer! Your explanation definitely clears up quite a bit of my misunderstanding, thank you for that! There was a reason why I shy away from using Queue, but for the life of me I can't remember right now what that reason was. I will have to modify

Re: [Tutor] [Python 3] Threads status, join() and Semaphore queue

2018-11-19 Thread Cameron Simpson
On 19Nov2018 23:52, Dimitar Ivanov wrote: I'm having a hard time getting my head around threads so I was hoping someone who has better understanding of their underlying functionality could lend me a helping hand, in particular how threads work with each other when using thread.join() and

[Tutor] [Python 3] Threads status, join() and Semaphore queue

2018-11-19 Thread Dimitar Ivanov
Hello everyone, I'm having a hard time getting my head around threads so I was hoping someone who has better understanding of their underlying functionality could lend me a helping hand, in particular how threads work with each other when using thread.join() and Semaphore set with maximum value.

[Tutor] python commandos

2018-11-15 Thread Avi Gross
Dev, There are many ways to learn a programming language but a list of all commands is not necessarily a good way. I suspect your real question is how do you learn Python as either a beginner at this language or with little knowledge of computers in general. There are tons of books and classes

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:

Re: [Tutor] Python Help

2018-10-26 Thread Alan Gauld via Tutor
On 26/10/2018 18:20, Adam Eyring wrote: > beef = (beefmeals * 15.95) Note that the parens here are completely redundant. They don't break anything but neither do they contribute anything. WE already have LISP(*) for those who love parens, no need for (so many of) them in Python (*)Lots of

Re: [Tutor] Python Help

2018-10-26 Thread Adam Eyring
On Fri, Oct 26, 2018 at 3:03 PM Bob Gailer wrote: > On Oct 26, 2018 1:20 PM, "Adam Eyring" wrote: > > > > Try this cleaned up version with colons in the right places, dollar > signs removed, and other corrections: > > Does it do what you want? > > > beefmeals=int(input("Enter number of beef

Re: [Tutor] Python Help

2018-10-26 Thread Adam Eyring
Try this cleaned up version with colons in the right places, dollar signs removed, and other corrections: beefmeals=int(input("Enter number of beef meals: ")) shitmeals=int(input("Enter number of vegan meals: ")) party = beefmeals + shitmeals print("Total meals", party) a = 0 b = 0 c = 0 if party

Re: [Tutor] Python Help

2018-10-26 Thread Bob Gailer
On Oct 26, 2018 1:20 PM, "Adam Eyring" wrote: > > Try this cleaned up version with colons in the right places, dollar signs removed, and other corrections: Does it do what you want? > beefmeals=int(input("Enter number of beef meals: ")) > shitmeals=int(input("Enter number of vegan meals: ")) >

Re: [Tutor] Python Help

2018-10-26 Thread Bob Gailer
On Oct 26, 2018 6:11 AM, "Ben Placella" wrote: > > I need to write code that runs a cost calculating program with many > different variables and I honestly don't understand it Could you be more specific? What exactly don't you understand, or even better what do you understand? my code is: How

Re: [Tutor] Python Help

2018-10-26 Thread Alan Gauld via Tutor
On 25/10/2018 23:14, Ben Placella wrote: Please always post code in plain text not HTML or Rich text. Otherwise we lose all the formatting which is important in Python. > beefmeals=int(input("Enter number of beef meals: ")) > shitmeals=int(input("Enter number of vegan meals: ")) >

Re: [Tutor] Python Help (shits killing me)

2018-10-26 Thread Steven D'Aprano
On Thu, Oct 25, 2018 at 06:13:31PM -0400, Ben Placella wrote: > So I have to make a fibonacci sequence, and I'm not sure what is wrong with > my code [...] > attached is a photo of what the output SHOULD look like No it isn't. For security (anti-spam, anti-virus) reasons, this mailing list

Re: [Tutor] Python Help

2018-10-26 Thread Steven D'Aprano
On Thu, Oct 25, 2018 at 06:14:41PM -0400, Ben Placella wrote: > I need to write code that runs a cost calculating program with many > different variables and I honestly don't understand it, my code is: > beefmeals=int(input("Enter number of beef meals: ")) > shitmeals=int(input("Enter number of

Re: [Tutor] Python Help (shits killing me)

2018-10-26 Thread Alan Gauld via Tutor
Plain text is preferred for code since otherwise the mail system removes all indentation making the code hard to understand. On 25/10/2018 23:13, Ben Placella wrote: > So I have to make a fibonacci sequence, and I'm not sure what is wrong with > my code > #This program illustrates the fibonacci

Re: [Tutor] Python Help (shits killing me)

2018-10-26 Thread Andrew Van Valkenburg
nth = n1 + n I don't see where n is defined anywhere. Should be n2? On Fri, Oct 26, 2018 at 6:09 AM Ben Placella wrote: > So I have to make a fibonacci sequence, and I'm not sure what is wrong with > my code > #This program illustrates the fibonacci sequence > nterms=int(input("Please enter

[Tutor] Python Help

2018-10-26 Thread Ben Placella
I need to write code that runs a cost calculating program with many different variables and I honestly don't understand it, my code is: beefmeals=int(input("Enter number of beef meals: ")) shitmeals=int(input("Enter number of vegan meals: ")) party=beefmeals+shitmeals print(party) if party<=50

[Tutor] Python Help (shits killing me)

2018-10-26 Thread Ben Placella
So I have to make a fibonacci sequence, and I'm not sure what is wrong with my code #This program illustrates the fibonacci sequence nterms=int(input("Please enter how many terms you would like to know: ")) n1 = 1 n2 = 1 count = 0 if nterms <= 0: print("Please enter a positive integer") elif

Re: [Tutor] Python 3.6 update?

2018-10-25 Thread Mats Wichmann
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: > > this upgrade will trigger

[Tutor] Python 3.6 update?

2018-10-25 Thread Jim
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: this upgrade will trigger additional changes. The following 2 packages will be

Re: [Tutor] python game error

2018-10-15 Thread Peter Otten
Alan Gauld via Tutor wrote: > On 15/10/18 08:57, Peter Otten wrote: > >> By the way, you do not need a map (dict) at all to implement a game like >> this, you may return the next scene directly. A sketch: >> >> class Bridge: >> def enter(self): >> ... >> action = ... >>

Re: [Tutor] python game error

2018-10-15 Thread Alan Gauld via Tutor
On 15/10/18 08:57, Peter Otten wrote: > By the way, you do not need a map (dict) at all to implement a game like > this, you may return the next scene directly. A sketch: > > class Bridge: > def enter(self): > ... > action = ... > if action == "jump off the bridge":

Re: [Tutor] python game error

2018-10-15 Thread Peter Otten
bob gailer wrote: > Python coding "trick"1 > when I build a map I omit the () after the class e.g. 'death' = Death, > ... and apply them to the item retrieved from the map. > > use a decorator to build the map dictionary: > > # the decorator function: > def

Re: [Tutor] python game error

2018-10-14 Thread bob gailer
More comments on code: guess = raw_input("[pod #]> ")     if int(guess) != good_pod: If user enters something that will not convert to integer an exception will be raised. For example >>> int('a') Traceback (most recent call last):   File "", line 1, in ValueError: invalid literal

Re: [Tutor] python game error

2018-10-14 Thread bob gailer
On 10/14/2018 1:42 PM, Mats Wichmann wrote: Hint here: don't use 'map' as your own variable name, since it's a built-in function. Absolutely, I am always warning others about this gotcha. In this case map is local to add_to_map so it does not affect then global namespace. The reason I used it

Re: [Tutor] python game error

2018-10-14 Thread Mats Wichmann
On 10/14/2018 10:08 AM, bob gailer wrote: > Python coding "trick"1  > when I build a map I omit the () after the class e.g. 'death' = Death, > ... and apply them to the item retrieved from the map. > > use a decorator to build the map dictionary: > > # the decorator

Re: [Tutor] python game error

2018-10-14 Thread bob gailer
More comments: User Friendly? I hope this game is not intended for actual use. No one will be able to guess the correct actions in a reasonable time. or 3 digit random code given 10 tries for any one code. I for one would give up pretty quickly. The original

  1   2   3   4   5   6   7   8   9   10   >