Re: Getting Directory of Command Line Entry Point For Packages

2021-11-12 Thread dn via Python-list
On 13/11/2021 10.51, Abdur-Rahmaan Janhangeer wrote: > Greetings list, > > Let's say i created a package named miaw > > miaw also has a cli command called miaw > > miaw prints files and folders in the directory it is called in > > except that when miaw is used, it prints the files and folders i

OT: Alternatives to Jupyter Notebook

2021-11-15 Thread dn via Python-list
On 15/11/2021 12.24, Paige Bailey wrote: > If you're experiencing issues with Jupyter, perhaps try JupyterLab: > JupyterLab Documentation — JupyterLab 3.2.3 documentation > > > Or VS Code, which is also open-source and has support for Jupyter notebook

Re: Advantages of Default Factory in Dataclasses

2021-11-16 Thread dn via Python-list
On 17/11/2021 02.04, Abdur-Rahmaan Janhangeer wrote: > A simple question: why do we need field(default_factory ) in dataclasses? > > Why not make that field as an attribute return a function? > > Useful implementation examples / use cases appreciated. It's an interesting question: We could defi

Re: import question

2021-11-19 Thread dn via Python-list
On 20/11/2021 03.38, lucas wrote: > ok. all good advice. thank you for that. and with all that I've decided > what to do. > > I'm going to close off any server-side python access so that I don't expose > my server or the file system to vulnerabilities and/or wonton attacks. I am > building

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-19 Thread dn via Python-list
On 20/11/2021 09.17, Chris Angelico wrote: > On Sat, Nov 20, 2021 at 5:08 AM ast wrote: >> Le 19/11/2021 à 03:51, MRAB a écrit : >>> On 2021-11-19 02:40, [email protected] wrote: On 2021-11-18 at 23:16:32 -0300, René Silva Valdés wrote: > Working with floats i notic

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-19 Thread dn via Python-list
On 20/11/2021 10.21, Chris Angelico wrote: > On Sat, Nov 20, 2021 at 7:39 AM dn via Python-list > wrote: >>>> >>> 0.3 + 0.3 + 0.3 == 0.9 >>>> False >>> >>> That's because 0.3 is not 3/10. It's not because floats are >>>

Re: Negative subscripts

2021-11-26 Thread dn via Python-list
On 26/11/2021 22.17, Frank Millman wrote: > In my program I have a for-loop like this - > for item in x[:-y]: > ...    [do stuff] > > 'y' may or may not be 0. If it is 0 I want to process the entire list > 'x', but of course -0 equals 0, so it returns an empty list. ... > But in my actual p

Friday Finking: Docstrings and DataClasses

2021-11-26 Thread dn via Python-list
How have you updated your (team's) standards and conventions for docstrings, when using dataclasses? NB the question is specifically class-related. Whereas many of the examples 'here' are of functions; a docstring is a docstring, is a docstring. The original word on the subject is/was "PEP 257

Re: Negative subscripts

2021-11-27 Thread dn via Python-list
On 27/11/2021 19.11, Frank Millman wrote: > On 2021-11-26 11:24 PM, dn via Python-list wrote: >> On 26/11/2021 22.17, Frank Millman wrote: >>> In my program I have a for-loop like this - >>> >>>>>> for item in x[:-y]: >>> ...    [do stuff]

Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-11-28 Thread dn via Python-list
On 29/11/2021 02.18, Chris Angelico wrote: > On Mon, Nov 29, 2021 at 12:10 AM Abdur-Rahmaan Janhangeer > wrote: > > Flags are actually constructed from multiple codepoints. What you want > is to insert each codepoint separately. You can see them listed in the > second column of the table you link

Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-11-29 Thread dn via Python-list
On 29/11/2021 12.06, Cameron Simpson wrote: > On 29Nov2021 09:19, Chris Angelico wrote: >> On Mon, Nov 29, 2021 at 8:10 AM dn via Python-list >> wrote: >>> However, when trying the above, with our local flag in (Fedora Linux, >>> Gnome) Terminal or PyCharm's

Re: Failure to Display Top menu

2021-11-29 Thread dn via Python-list
On 30/11/2021 07.43, Peter Mwale wrote: > Hello Christian, > Am referring to menu marked in picture below. It's not coming on my window. > > > On Sat, Nov 27, 2021, 20:19 Christian Gollwitzer wrote: > >> Am 26.11.21 um 21:38 schrieb Peter Mwale: >>> Hello, my python 3.10 shell is not displaying

Re: Negative subscripts

2021-11-29 Thread dn via Python-list
On 27/11/2021 21.23, Chris Angelico wrote: > On Sat, Nov 27, 2021 at 7:21 PM dn via Python-list > wrote: >> The expression list is evaluated once; it should yield an iterable >> object. An iterator is created for the result of the expression_list. >> The suite is the

Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-11-29 Thread dn via Python-list
On 30/11/2021 10.19, Cameron Simpson wrote: > On 29Nov2021 22:25, DL Neil wrote: Probably a font issue. Not many fonts support the flags. >>> >>> Agree about the font support. Some terminal emulators make an effort to >>> have fallback fonts for when your preferred font lacks a glyph. IIRC >>

PyCharm settings - per: print('\N{flag: Mauritius}') not supported in py3.9

2021-12-01 Thread dn via Python-list
On 29/11/2021 10.08, dn via Python-list wrote: > On 29/11/2021 02.18, Chris Angelico wrote: >> On Mon, Nov 29, 2021 at 12:10 AM Abdur-Rahmaan Janhangeer >> wrote: >> >> Flags are actually constructed from multiple codepoints. What you want >> is to insert each

Re: Return

2021-12-07 Thread dn via Python-list
On 08/12/2021 09.45, Roland Mueller via Python-list wrote: > Hello > > ti 7. jouluk. 2021 klo 19.47 vani arul ([email protected]) kirjoitti: > >> Hey There, >> Can someone help to understand how a python function can return value with >> using return in the code? >> It is not not about explici

Re: Return

2021-12-07 Thread dn via Python-list
On 08/12/2021 11.07, Chris Angelico wrote: > On Wed, Dec 8, 2021 at 9:04 AM dn via Python-list > wrote: >> >> plus Python, unlike some other languages, allows us to return multiple >> values, either as a collection or as an implied-tuple: >> >> def function_

Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-12-21 Thread dn via Python-list
On 30/11/2021 12.31, Cameron Simpson wrote: > On 30Nov2021 10:59, DL Neil wrote: ... >> I've nominated Kitty as >> Fedora's default terminal. We'll see how it goes with work-loads beyond >> raising the flag... > > I'd like to hear how that goes down the track. If I find myself on a > Linux desk

Re: Selection sort

2021-12-24 Thread dn via Python-list
On 25/12/2021 03.22, vani arul wrote: > Hello, > I am trying write a code.Can some help me find the error in my code. > Thanks! > > > def selectionsort(arr): ># le=len(arr) > for b in range(0,len(arr)-1): > pos=b > for a in range(b+1,len(arr)-1): > if arr[b]>ar

Re: Extracting dataframe column with multiple conditions on row values

2022-01-07 Thread dn via Python-list
Salaam Mahmood, On 08/01/2022 12.07, Mahmood Naderan via Python-list wrote: >I have a csv file like this >V0,V1,V2,V3 >4,1,1,1 >6,4,5,2 >2,3,6,7 > >And I want to search two rows for a match and find the column. For >example, I want to search row[0] for 1 and row[1] fo

Re: What to write or search on github to get the code for what is written below:

2022-01-13 Thread dn via Python-list
On 14/01/2022 09.48, Dennis Lee Bieber wrote: > On Thu, 13 Jan 2022 15:22:50 -0500, Dennis Lee Bieber > declaimed the following: > > Talking to myself in public again... Bad habit... Recommend that you not start any arguments then - they will be unwinnable! -- Regards, =dn -- https://ma

Re: Writing a string with comma in one column of CSV file

2022-01-15 Thread dn via Python-list
On 16/01/2022 09.56, Mahmood Naderan via Python-list wrote: > Hi, > I use the following line to write some information to a CSV file which is > comma delimited. > > f = open(output_file, 'w', newline='') > wr = csv.writer(f) > ... > f.write(str(n) + "," + str(key) + "\n" ) > > > Problem is that

Re: How to set environmental variables for Python

2022-01-17 Thread dn via Python-list
On 17/01/2022 22.31, Shaozhong SHI wrote: > I got quite a few version of Python on my machine. > > How do I set environmental variables for Python 3.6.1 to work? Set from Python, or set in the OpSys? https://docs.python.org/3/library/os.html?highlight=environment%20variable MS-Win: https://doc

Questioning the effects of multiple assignment

2020-07-06 Thread dn via Python-list
TLDR; if you are a Python 'Master' then feel free to skim the first part (which you should know hands-down), until the excerpts from 'the manual' and from there I'll be interested in learning from you... Yesterday I asked a junior prog to expand an __init__() to accept either a series of (>1)

Re: Access last element after iteration

2020-07-07 Thread dn via Python-list
On 8/07/20 12:45 AM, Chris Angelico wrote: On Tue, Jul 7, 2020 at 10:28 PM Frank Millman wrote: Hi all After iterating over a sequence, the final element is still accessible. In this case, the variable 'i' still references the integer 4. Yes, it's guaranteed. It isn't often useful; but the

Re: Questioning the effects of multiple assignment

2020-07-07 Thread dn via Python-list
On 7/07/20 7:21 PM, Mike Dewhirst wrote: Original message For comparison, here's the original form:- >>> def f( a, *b, c=0 ): ... print( a, type( a ) ) ... print( c, type( c ) ) ... print( b ) ... >>> f( 1, 'two', 3, 'four' ) 1 0 ('two', 3, 'four') Shouldn't

Re: Questioning the effects of multiple assignment

2020-07-07 Thread dn via Python-list
On 7/07/20 7:44 PM, Kyle Stanley wrote: Can you explain why these two (apparently) logical assignment processes have been designed to realise different result-objects? The reason is because of the conventions chosen in PEP 3132, which implemented the feature in the first place. It wa

Re: Questioning the effects of multiple assignment

2020-07-08 Thread dn via Python-list
On 8/07/20 2:40 PM, Kyle Stanley wrote: A matter of style, which I like to follow [is it TDD's influence? - or does it actually come-from reading about DBC (Design by Contract*)?] is the injunction that one *not* vary the value of a parameter inside a method/function. (useful

Re: Questioning the effects of multiple assignment

2020-07-08 Thread dn via Python-list
On 8/07/20 11:11 PM, o1bigtenor wrote: On Tue, Jul 7, 2020 at 2:30 AM Mike Dewhirst <mailto:[email protected]>> wrote: Original message ----From: dn via Python-list mailto:[email protected]>> Date: 7/7/20  16:04  (GMT+10:00) To: 'Python

Re: python software foundation

2020-07-10 Thread dn via Python-list
On 11/07/20 5:19 AM, Chris Angelico wrote: On Sat, Jul 11, 2020 at 3:10 AM Jithesh Thirumaran wrote: please uninstall the site packages of python 3.7.2 and tell me the result thank you The result was 1. @Chris, we should discuss this: A correc

Friday Finking: Limiting parameters

2020-07-10 Thread dn via Python-list
Do you prefer to limit the number of parameters accepted by a single function/method, and if so, how do you handle situations where more data is needed? TLDR; specific questions at the end of this msg Along with one of our list-colleagues (a fellow graduate?survivor from the time of mainfram

Re: Friday Finking: Limiting parameters

2020-07-12 Thread dn via Python-list
On 12/07/20 10:10 PM, Barry Scott wrote: On 12 Jul 2020, at 00:15, DL Neil via Python-list mailto:[email protected]>> wrote: That does not necessarily mean that the function needs to know the particular representation or form of that data.   Let those be objects with getter methods for th

Re: Python pandas Excel

2020-07-17 Thread dn via Python-list
On 18/07/20 3:36 AM, J Conrado wrote: HI, I have an excel file with several columns, the first day/month,/year and hour: Data 01/11/2017 00:00 01/11/2017 03:00 ... Please, how can I get four arrays for day, month, year and hour this column of my excel. What do you have so-far? How are y

Re: Python pandas Excel

2020-07-17 Thread dn via Python-list
On 18/07/20 11:06 AM, Dennis Lee Bieber wrote: On Sat, 18 Jul 2020 09:08:50 +1200, dn via Python-list declaimed the following: Assuming the import produces a string, are you able to "slice" the string into the requisite components? Given the OP's stated output --

Re: help

2020-07-17 Thread dn via Python-list
On 18/07/20 1:53 PM, Castillo, Herbert S wrote: I downloaded python not to long ago, and today when I opened Python on Windows it gave me a modify setup prompt. I have tried to click on modify , repair and even uninstalled and installed it back, but when I try to open Python up again, I keep o

Re: Issues in downloading python

2020-07-17 Thread dn via Python-list
On 17/07/20 7:22 PM, Shanmika Sugavaneswaran wrote: Though I install the setup , I couldn’t find Python in my system . I don’t know what cause the problem. Please help me! Please advise if the answer is not already covered in https://docs.python.org/dev/using/windows.html -- Regards =dn -- h

Re: excel (multiple sheets) to yml file for each sheet

2020-07-17 Thread dn via Python-list
On 18/07/20 12:04 PM, stack flow wrote: help please. On Thursday, July 16, 2020 at 10:38:23 PM UTC-4, stack flow wrote: Hi, I have excel file with multiple sheets and need output as yml file for each sheet. could someone help me with python code? following is an example: aep sheet: aep

Re: A Python installation help doc much more friendly to newcomers? [Was Re: help]

2020-07-17 Thread dn via Python-list
On 18/07/20 3:29 PM, boB Stepp wrote: On Fri, Jul 17, 2020 at 9:48 PM dn via Python-list wrote: On 18/07/20 1:53 PM, Castillo, Herbert S wrote: I downloaded python not to long ago, and today when I opened Python on Windows it gave me a modify setup prompt. I have tried to click on modify

Re: A Python installation help doc much more friendly to newcomers? [Was Re: help]

2020-07-18 Thread dn via Python-list
On 18/07/20 11:48 PM, Oscar Benjamin wrote: On Sat, 18 Jul 2020 at 05:39, dn via Python-list wrote: On 18/07/20 3:29 PM, boB Stepp wrote: On Fri, Jul 17, 2020 at 9:48 PM dn via Python-list wrote: On 18/07/20 1:53 PM, Castillo, Herbert S wrote: I downloaded python not to long ago, and

Re: Python Program Help

2020-07-21 Thread dn via Python-list
On 7/22/20 7:16 AM, Dennis Lee Bieber wrote: On Tue, 21 Jul 2020 06:38:55 -0700 (PDT), ksikor14--- via Python-list declaimed the following: Since this is apparently a homework assignment, I'm not going to provide fixes -- just some comments. Logic error? (not entirely poking-fun: is

Re: Iterators, iterables and special objects

2020-07-21 Thread dn via Python-list
On 7/21/20 9:32 PM, Peter Slížik wrote: Hi list, two related questions: 1. Why do functions used to iterate over collections or dict members return specialized objects like type(dict.keys()) -> class 'dict_keys' type(dict.values()) -> class 'dict_values' type(dict.items()) -> class 'dict_items'

Re: How to limit *length* of PrettyPrinter

2020-07-21 Thread dn via Python-list
On 7/22/20 1:31 PM, Stavros Macrakis wrote: I see how to limit the *depth* in pretty-printing: import pprint pprint.PrettyPrinter(depth=2).pprint(((11,12,13),(21,22,23,(241,242,243),25,26,27))) ((11, 12, 13), (21, 22, 23, (...), 25, 26, 27)) But I would also like to limit the *length, *someth

Re: "OSError: [Errno 9] Bad file descriptor" When I try to Install the library in conda prompt

2020-07-21 Thread dn via Python-list
On 7/22/20 4:46 PM, Mathiyazhagan S wrote: Dear Sir/Madam, I'm new to the python program. I'm trying to install the "numby" or anything to add into the library by using the windows command prompt I'm getting some error please find the attachment. So please help me to resolve this issue.

Re: [BUG] missing ')' causes syntax error on next line

2020-07-22 Thread dn via Python-list
On 23/07/2020 10:33, Chris Angelico wrote: -- Forwarded message - From: Jeff Linahan See attached image. Would be nice if it printed "SyntaxError: unbalanced parens" as it can difficult to see the problem if code like this is run in an environment that only prints the problem

Re: Fwd: [BUG] missing ')' causes syntax error on next line

2020-07-22 Thread dn via Python-list
On 23/07/2020 10:46, Ethan Furman wrote: On 7/22/20 2:57 PM, Jeff Linahan wrote: Subscribing to the mailing list as per the bot's request and resending. *beep* *whir* WE ARE NOT *click* *whi* A BOT. *bzzzt* WE ARE *bzzzt* *click* ADVANCED LIFE *whi* FORMS *click* *beep*

Re: Fwd: [BUG] missing ')' causes syntax error on next line

2020-07-22 Thread dn via Python-list
On 23/07/2020 11:51, Chris Angelico wrote: On Thu, Jul 23, 2020 at 9:17 AM dn via Python-list wrote: However, questions remain:- Robot: any machine or mechanical device that operates automatically with humanlike skill What about a human that operates mechanically with merely robot-like

Re: Friday Finking: Limiting parameters

2020-07-22 Thread dn via Python-list
On 22/07/2020 05:37, Peter J. Holzer wrote: On 2020-07-13 17:21:40 +1200, dn via Python-list wrote: On 12/07/20 10:10 PM, Barry Scott wrote: I'd expect to see something like this: def mail_label( person, address ): first_name = person.first_name # or if you want a function inte

Re: Spam, bacon, sausage and Spam

2020-07-23 Thread dn via Python-list
On 23/07/2020 20:39, Christian Heimes wrote: On 23/07/2020 02.12, Cameron Simpson wrote: On 22Jul2020 15:00, Christian Heimes wrote: ... would it be possible to reduce the amount of EuroPython spam on @python.org mailing lists to a sensible level? This mailing list is a general discussion li

Re: How to limit *length* of PrettyPrinter

2020-07-23 Thread dn via Python-list
Redirected from Digest (see below) On 23/07/2020 11:59, Stavros Macrakis wrote: > Mousedancer, thanks! Yes, I even look like a (younger) Kevin Costner! (you believe me - right!?) > As a finger exercise, I thought I'd try implementing print-level and print-length as an object-to-object transf

Re: Iterators, iterables and special objects

2020-07-24 Thread dn via Python-list
On 25/07/2020 06:35, Random832 wrote: On Tue, Jul 21, 2020, at 15:54, Terry Reedy wrote: The transformers should be once-through iterators because they can be passed once-through interators. I suppose one could make them iterables and add an attribute 'pristine' set to True in __init__ and Fals

Re: How to limit *length* of PrettyPrinter

2020-07-25 Thread dn via Python-list
Let me preface this reply with the concern that my level of competence, in this area, is insufficient. However, there are a number of folk 'here' who are 'into' Python's internals, and will (hopefully) jump-in... Also, whilst we appear to be concentrating on understanding the content of a dat

Re: Symlinks already present

2020-07-26 Thread dn via Python-list
On 27/07/2020 00:56, Termoregolato wrote: There is any way to check if  a directory is already symlinked, without controlling every symlink viewing the link? That is a bit time consuming, due I've two or three directory that can have a new symlink, but I've to check on a list of 20-3 symlin

Re: Dowloading package dependencies from locked down machine

2020-07-28 Thread dn via Python-list
On 29/07/2020 07:29, J. Pic wrote: Ideas for solutions: - use pip install --user at home, copy over ~/.local/lib/python3.8/site-packages - same, but with ~/.cache/pip ...or even building an entire parallel Python environment on an Internet-connected machine (even a VM), from which the PYTHON

Re: Winreg

2020-07-30 Thread dn via Python-list
On 31/07/2020 07:25, Barry Scott wrote: Use the Reply or Reply-To-All feature of your email program and it will do the rest for you. I can't find instructions for the proper way to reply to 'python list'. Is it simply a matter of keeping the message title identical to the original message and

Re: questions re: calendar module

2020-07-31 Thread dn via Python-list
On 31/07/2020 02:52, o1bigtenor wrote: I regularly work in planning through multiple years at once. This means that I like to have a lot of stuff available in a calendar function. Python seems to be locked when I need to display more than 1 year at a time. I don't see a way to display something l

Re: questions re: calendar module

2020-08-01 Thread dn via Python-list
On 01/08/2020 23:36, o1bigtenor wrote: On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list mailto:[email protected]>> wrote: On 31/07/2020 02:52, o1bigtenor wrote: > I regularly work in planning through multiple years at once. > This means that I like to have a

Re: questions re: calendar module

2020-08-01 Thread dn via Python-list
On 02/08/2020 12:24, o1bigtenor wrote: On Sat, Aug 1, 2020 at 6:29 PM dn via Python-list wrote: On 01/08/2020 23:36, o1bigtenor wrote: On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list mailto:[email protected]>> wrote: On 31/07/2020 02:52, o1bigtenor wrote: > I regul

Re: questions re: calendar module

2020-08-01 Thread dn via Python-list
On 02/08/2020 12:42, o1bigtenor wrote: On Sat, Aug 1, 2020 at 7:24 PM o1bigtenor wrote: On Sat, Aug 1, 2020 at 6:29 PM dn via Python-list wrote: On 01/08/2020 23:36, o1bigtenor wrote: On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list mailto:[email protected]>> wrote: On 31/0

Re: Python running in the Command Prompt Window questions

2020-08-02 Thread dn via Python-list
On 03/08/2020 13:52, Steve wrote: When I double click on a .py file, it executes at the command prompt with black background and small white font. Is there python code to change the font size and background color? Ctrl-Shift-+ ? === FootNote: Would it be

Re: Updating a variable problem.

2020-08-04 Thread dn via Python-list
On 04/08/2020 20:38, Steve wrote: Why should line 6 fail until line 7 is commented out? Python complains that MSN is "referenced before assignment". def ReadTheEQfile(): global MSN MSN = ("1 Monitor") #This line works every time. def EditTheEQlist(): print("MSN2 = " + MSN) # Work

Re: Explicit is better than Implicit

2020-08-06 Thread dn via Python-list
On 07/08/2020 05:33, Skip Montanaro wrote: Hmmm... Rename genes, fix Excel, or dump Excel in favor of Python? I know what my choice would have been. :-) https://www.theverge.com/2020/8/6/21355674/human-genes-rename-microsoft-excel-misreading-dates At the risk of screaming off-topic... The ar

Re: Save-to-file code not quite working completely

2020-08-08 Thread dn via Python-list
On 09/08/2020 08:51, Steve wrote: I have a file containing specifications. My .py program can read and manipulate the data but I cannot seem to get it to update the original file properly. The code is simple and works except that the original line remains in the file after the new updated one h

Re: importlib: import X as Y; from A import B

2020-08-08 Thread dn via Python-list
On 09/08/2020 15:23, Jason Friedman wrote: I have some code I'm going to share with my team, many of whom are not yet familiar with Python. They may not have 3rd-party libraries such as pandas or selenium installed. Yes I can instruct them how to install, but the path of least resistance is to ha

Re: Save-to-file code not quite working completely

2020-08-10 Thread dn via Python-list
On 10/08/2020 05:23, Dennis Lee Bieber wrote: On Sun, 9 Aug 2020 11:50:51 +1200, dn via Python-list declaimed the following: To be a logomach, let's talk about "update":- May I advise that a 'good practice' would be to create a new file, and thus be able to (also) main

Re: Any timeline for PIL for Python 3.4

2020-08-10 Thread dn via Python-list
On 11/08/2020 16:35, Martin wrote: I am running Python 3.4.4, and would like to use the Python Imaging Library (PIL).  This is currently not available for Python Version 3.  Does anybody know when it will become available? Plan B is to install Python 2.7.18.  I just need an idea of how long I wo

Re: Unable to save any files

2020-08-11 Thread dn via Python-list
On 11/08/2020 21:27, Lim Clayton wrote: Hi, I am a relatively new Python User. I recently downloaded Python on my desktop and I am unable to save anything when I use IDLE. I can run codes on the shell without any issue but running anything on the window which requires saving causes nothing to ha

Re: Support

2020-08-13 Thread dn via Python-list
On 14/08/2020 08:31, Alexa Oña wrote: Helo, I am already subscribed. I De: Alexa Oña Enviado: jueves, 13 de agosto de 2020 18:51 Para: [email protected] Asunto: Support Hello, I am Alexa I have tried to install PYTHON 3.8.5, but could not install it on my

Whitespace not/required

2020-08-13 Thread dn via Python-list
Although many new-comers are intrigued by the compulsory indentation rule, I have been surprised to discover that even though whitespace does not usually feature as a formatting-specification, nevertheless Python sometimes requires an absence of whitespace. Will this behavior/requirement conti

Re: How to install your personal module/package on site.

2020-08-14 Thread dn via Python-list
On 14/08/2020 22:32, Antoon Pardon wrote: Well the question is in the subject. I have a number of modules/packages which were until recently personal use only. However python is getting more popular at work and some of my work was considered useful enough to install in a public available spot.

Re: Whitespace not/required

2020-08-15 Thread dn via Python-list
On 15/08/2020 08:01, Dennis Lee Bieber wrote: On Fri, 14 Aug 2020 16:29:18 +1200, dn via Python-list declaimed the following: it is ignored by Python. (yes, this discussion disdains comments!) For example, whitespace is no problem when it comes to defining a list: month_names = ['Ja

Re: How to install your personal module/package on site.

2020-08-15 Thread dn via Python-list
Does the word "public" mean world-wide, or perhaps only amongst your work-colleagues? Only among work-colleagues. We only want that anyone writing and running python scripts on particular hosts, can easily import these modules/packages. Of possible interest:- Private Python package managem

Re: Syntax question

2020-08-16 Thread dn via Python-list
On 16/08/2020 20:12, Klaus Jantzen wrote: Hi, the other day I came across the book "Classic Computer Science Problems in Python" by David Kopec. The function definitions in the examples  like = def fib2(n: int) -> int:     if n < 2:  # base case     return n     return fib2(n - 2)

Re: LittleRookie

2020-08-18 Thread dn via Python-list
i would say i'm new at programing i have a year of experience in python(but i'm tottaly a noob) i guess i'm starting to learn SQL now.What should i do to learn better and faster? Enroll in the local college and start your journey there? Successfully finish it and get an internship. Follow with

Re: LittleRookie

2020-08-19 Thread dn via Python-list
On 19/08/2020 14:19, Jamelaumn wrote: actually for me to sign for any online courses like stanford etc... if it's needed any document i couldnt  get in because i have none i'm from brazil :v anyway thank u guys ;) i will try find something Did you try either of the two platforms mentioned pre

Re: Issue

2020-08-20 Thread dn via Python-list
On 21/08/2020 07:01, Sreelakshmi Madhu wrote: not able to open IDLE and also while running a program in cmd saved in notepad, it's showing not found such a python file. Please review the Python documentation (https://docs.python.org/3/), in particular the "Python Setup and Usage" notes releva

Re: Temporary text for multiple entries

2020-08-21 Thread dn via Python-list
On 22/08/2020 00:01, Ashanti Aggarwal wrote: I am working to make a form where I have added multiple entries. I wish to add temporary text on all of them, as the text to be deleted when clicked and to inserted again when focused out. I have done with the single entry but not able to find a sol

Re: Matrix of size 100*100- Meghna

2020-08-21 Thread dn via Python-list
On 22/08/2020 02:17, Meghna Karkera wrote: Dear Respected Sir I am Meghna, a PhD student. I have installed python in my ubuntu OS from your website recently and tried using spyder and jupyter. May I request you to help me with importing few matrices, each of size 100*100 in python from XLSX and

Re: Program chaining on Windows

2020-08-23 Thread dn via Python-list
On 23/08/2020 19:31, Rob Cliffe via Python-list wrote: On WIndows 10, running Python programs in a DOS box, I would like one Python program to chain to another.  I.e. the first program to be replaced by the second (*not* waiting for the second to finish, as with e.g. os.system).  This doesn't s

Re: Program chaining on Windows

2020-08-23 Thread dn via Python-list
On 24/08/2020 09:04, Chris Angelico wrote: On Mon, Aug 24, 2020 at 6:39 AM dn via Python-list wrote: On 23/08/2020 19:31, Rob Cliffe via Python-list wrote: On WIndows 10, running Python programs in a DOS box, I would like one Python program to chain to another. I.e. the first program to be

Training Review: Computational Thinking for Problem Solving

2020-08-24 Thread dn via Python-list
Many of us learn Python by memorising code-constructs and their use. Even over-coming this learning-curve is but a small portion of becoming a competent coder or programmer. The challenges of learning how to construct an algorithm, and/or how to analyse a real-world problem to produce a soluti

Re: Output showing "None" in Terminal

2020-08-25 Thread dn via Python-list
On 25/08/2020 01:12, Py Noob wrote: Hi! i'm new to python and would like some help with something i was working on from a tutorial. I'm using VScode with 3.7.0 version on Windows 7. Below is my code and the terminal is showing the word "None" everytime I execute my code. Many thanks! print("Co

Re: About float/double type number in range.

2020-08-26 Thread dn via Python-list
On 26/08/2020 19:58, Joel Goldstick wrote: On Wed, Aug 26, 2020 at 3:43 AM ADITYA wrote: Dear Sir/Ma’am I am requesting you to satisfy me about float number in Range function, because in the argument of range we can take integer but not double or float whenever double as well

Re: file to bits text and text containing bits to file

2020-10-09 Thread dn via Python-list
On 09/10/2020 19:27, Harshit Sharma wrote: I want to read bits data of all file of any extention in 0s and 1s. And also want to do back means means construct file from bits text data how to do that tell with proof please. I am on a work of something like new sloot method but here I stuck.help

Re: What might cause my sample program to forget that already imported datetime?

2020-10-12 Thread dn via Python-list
On 13/10/2020 06:47, Steve wrote: Thank you, those two fixes took care of the problem. At the top of my sample program, I have: import datetime from datetime import * ... These are incompatible with each other, so you're going to get issues. I'd recommend doing just the first one, and then

Re: File Name issue

2020-10-18 Thread dn via Python-list
On 18/10/2020 12:58, Mladen Gogala via Python-list wrote: On Sat, 17 Oct 2020 22:51:11 +, Mladen Gogala wrote: On Sat, 17 Oct 2020 18:12:16 -0400, Steve wrote: with open("HOURLYLOG.txt", 'r') as infile: works but, when I rename the file, the line: with open("HOURLY-LOG.txt", 'r') as infile

Re: File Name issue

2020-10-18 Thread dn via Python-list
On 19/10/2020 05:58, Mladen Gogala via Python-list wrote: On Sun, 18 Oct 2020 21:00:18 +1300, dn wrote: On 18/10/2020 12:58, Mladen Gogala via Python-list wrote: On Sat, 17 Oct 2020 22:51:11 +, Mladen Gogala wrote: BTW, I used this cp /var/log/syslog ./in-file.log #!/usr/bin/env python3 imp

Re: How to expand and flatten a nested of list of dictionaries of varied lengths?

2020-10-18 Thread dn via Python-list
On 19/10/2020 09:09, Shaozhong SHI wrote: Even worse is that, in some cases, an addition called serviceRatings as a key occur with new data unexpectedly. "Even worse" than what? Do you need to keep a list of acceptable/applicable/available keys? (and reject or deal with others in some alternat

Re: How to expand and flatten a nested of list of dictionaries of varied lengths?

2020-10-18 Thread dn via Python-list
at we can't "snip" or 'do some gardening', to remove unnecessary or erroneous material, as the conversation progresses. You will notice (as below) that this also enables a posting with multiple questions, to be discussed point-by-point. Now to work... > On Sun, 18

Re: Help with the best practice to learn python

2020-10-19 Thread dn via Python-list
On 20/10/2020 04:12, Azhar Ansari wrote: Hello Python Community, Kindly help me with the best practice to learn python. Lots of material over net but its very confusing. You are so right - it is very confusing! Different people have different preferences for 'the best way to learn'. Also, we

Re: Why x+=1 doesn't return x value instead of an object

2020-10-30 Thread dn via Python-list
On 31/10/2020 16:20, Chris Angelico wrote: On Sat, Oct 31, 2020 at 1:51 PM Jon Ribbens via Python-list wrote: On 2020-10-31, Stefan Ram wrote: Siddhharth Choudhary writes: I want to know why x+=1 does not return the value of the variable. Which value? The old or the new one? Expre

Re: Why x+=1 doesn't return x value instead of an object

2020-10-31 Thread dn via Python-list
On 31/10/2020 19:41, Chris Angelico wrote: On Sat, Oct 31, 2020 at 4:44 PM dn via Python-list wrote: Free advice: whatever you do, don't call @Chris a walrus! Yeah... I do have quite a moustache, but it doesn't merit a high title like that! :) It's the tusks I'd

Re: Find word by given characters

2020-11-02 Thread dn via Python-list
On 02/11/2020 23:29, Bischoop wrote: On 2020-11-01, duncan smith wrote: But this generates the letters counts for each word. They only need to be generated once (outside the for loop). And using count requires iterating over the letters / words for each x in letters (rather than once). For a

Re: Find word by given characters

2020-11-02 Thread dn via Python-list
On 03/11/2020 12:10, Bischoop wrote: On 2020-11-02, dn wrote: If you have a working Py2 version, once print-statements were changed into functions, what errors were thrown-up? That was almost 15 if no more years ago when I was learning then had a long break beacause Life :-) Got married, work

Re: Find word by given characters

2020-11-02 Thread dn via Python-list
On 03/11/2020 13:13, duncan smith wrote: On 02/11/2020 19:09, dn wrote: On 02/11/2020 23:29, Bischoop wrote: On 2020-11-01, duncan smith wrote: But this generates the letters counts for each word. They only need to be generated once (outside the for loop). And using count requires iterating o

Re: Find word by given characters

2020-11-03 Thread dn via Python-list
On 04/11/2020 12:27, Bischoop wrote: On 2020-11-03, Chris Angelico wrote: This seems strangely backwards for a Scrabble game. Normally you would have a set of available tiles, and you have to form a word using only those tiles, but it doesn't necessarily have to use them all. You seem to have

Re: returning totals in functions of math

2020-11-08 Thread dn via Python-list
On 09/11/2020 08:47, Quentin Bock wrote: Ok, I don't know how to change add to accept an arbitrary number of arguments (I'm pretty new) and as for total = 1 idk but it worked for other versions of this (multiplication), and figured it might work for this one, do you have any tips on what a better

Re: returning totals in functions of math

2020-11-08 Thread dn via Python-list
Comments interposed:- On 09/11/2020 08:14, [email protected] wrote: On 2020-11-08 at 19:00:34 +, Peter Pearson wrote: On Sun, 8 Nov 2020 13:50:19 -0500, Quentin Bock wrote: Errors say that add takes 1 positional argument but 3 were given? Does this limit how many number

Re: returning totals in functions of math

2020-11-08 Thread dn via Python-list
On 09/11/2020 09:41, Quentin Bock wrote: Okay, thank you :) I didn't understand about 90% of what you explained lol (sorry) but the sum worked and I have the correct answer. Also, do you know any numbers that could replace 1 in this function as the total? just curious Thanks :) Yes, apologi

Re: How can I make this more complex?

2020-11-09 Thread dn via Python-list
On 10/11/2020 10:04, Quentin Bock wrote: grade = input("Enter your grade: ") if grade >= 90: print("You got an A ") if grade >= 80: print("You got a B ") if grade >= 70: print("You got a C") if grade >= 60: print("You got a D ") if grade >= 50: print("You failed") Firs

Re: Problem with rearanging list with paired letters next to each others

2020-11-11 Thread dn via Python-list
On 12/11/2020 00:45, Bischoop wrote: I see now I overcomplicated it, what is a good idea then? This is a variation on a data-compression technique called RLE=Run-Length Encoding (excepting that in this case there is no need to count the repetitions). Web.Ref: https://stackabuse.com/run-len

<    1   2   3   4   5   >