From advait.sharma at student.tugraz.at Thu Dec 1 01:57:59 2022 From: advait.sharma at student.tugraz.at (Advait Sharma) Date: Thu, 01 Dec 2022 07:57:59 +0100 Subject: [Tutor] Fwd: Urgent assistence Message-ID: <20221201075759.Horde.sPCJUdNx2wC78XomIIy6ENb@webmail.tugraz.at> -------------- next part -------------- An embedded message was scrubbed... From: Advait Sharma Subject: Urgent assistence Date: Thu, 01 Dec 2022 07:55:44 +0100 Size: 1785 URL: From alan.gauld at yahoo.co.uk Thu Dec 1 04:20:06 2022 From: alan.gauld at yahoo.co.uk (Alan Gauld) Date: Thu, 1 Dec 2022 09:20:06 +0000 Subject: [Tutor] Fwd: Urgent assistence In-Reply-To: <20221201075759.Horde.sPCJUdNx2wC78XomIIy6ENb@webmail.tugraz.at> References: <20221201075759.Horde.sPCJUdNx2wC78XomIIy6ENb@webmail.tugraz.at> Message-ID: On 01/12/2022 06:57, Advait Sharma wrote: > Hi, welcome to the tutor list. Unfortunately we are a text only list and the server has stripped off your attached message. Please resend with the text of your message in the body of the email. As list moderator I did see the top of your post so I know what it is about but for the benefit of the list please resend so that someone with some knowledge of the subject might respond. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos From threesomequarks at proton.me Thu Dec 1 13:04:46 2022 From: threesomequarks at proton.me (ThreeBlindQuarks) Date: Thu, 01 Dec 2022 18:04:46 +0000 Subject: [Tutor] Fwd: Urgent assistence In-Reply-To: References: <20221201075759.Horde.sPCJUdNx2wC78XomIIy6ENb@webmail.tugraz.at> Message-ID: I was able to read the text of the forwarded message and unfortunately it asks one of those vague questions that is not really one anyone can answer, let alone urgently. It looks suspiciously like some abstract questions we have seen where someone just wants to sit back and watch a debate. The real question seems to be from someone who does not know much about Python and is asking reasonably if they should start a project using python given rumors it crashes on an abstract 3-body problem. Generally, this is what some call a "stupid" question. I mean without details, I can assure you every single programming language or environment will hang or crash or stop because it has run out of memory if the problem and the approach are large or inefficient enough. Python is in many ways better suited to avoid crashes outright but only if you wrap all parts of the code properly so errors are caught. There is no mention of what modules the person may want to use. Presumably the comparison to MATLAB suggests there is a known way using MATLAB, quite possibly using extensions. In general, Python and extensions can do anything MATLAB does and the specific methods and code can make a big difference. There are MATLAB libraries that can be accessed within python and a big question for getting a project done is whether you need to start from scratch or use various pre-written chunks we call modules that are built-in or can be imported. And you need to look at what makes a problem "blow up" and avoid it. If files get too large, you may want to process them in chunks when that is possible. If your model makes matrices that are very fine-grained and have dimensions or lengths in the trillions, don't do that or find a way to keep chunks of memory on disk and swap them in and out. There is nothing intrinsic about any language that makes it invulnerable to programs that go too far. Q ORIGINAL ATTACHMENT: Respected Team Greetings for the day It is with immense pleasure and with due veneration that I want to pen down this Email to you with respect to my project .I am a Masters Degree student in Mechanical Engineering in Austria and want to develop a python code for my project on Multibody Dynamics. My professor told me to contact you in order to know if this project can be done with python or not.I just want to confirm if I can undertake this project in Python . The supervisors told me that in some stages and cases python crashes when you are handling a mechanical project involving more than 3 multibodies. I am attaching the project description with this Email .Could you please help me know if I the project is doable with python or not?When this problem can be handled easily with python then it will also be a big contribution to your software team also because in that case python will have a upper hand as compared to competitor softwares like MATLAB etc. I really wanted to undertake this project in python thats why I am avoiding MATLAB. Your words will highly be appreciable and taken into consideration. Please reply me as soon as possible. Thanking You Advait END OF ATTACHMENT Sent with Proton Mail secure email. ------- Original Message ------- On Thursday, December 1st, 2022 at 4:20 AM, Alan Gauld via Tutor wrote: > On 01/12/2022 06:57, Advait Sharma wrote: > > > Hi, welcome to the tutor list. Unfortunately we are a text only > list and the server has stripped off your attached message. > Please resend with the text of your message in the body of > the email. > > As list moderator I did see the top of your post so I know > what it is about but for the benefit of the list please > resend so that someone with some knowledge of the subject > might respond. > > -- > Alan G > Author of the Learn to Program web site > http://www.alan-g.me.uk/ > http://www.amazon.com/author/alan_gauld > Follow my photo-blog on Flickr at: > http://www.flickr.com/photos/alangauldphotos > > > > _______________________________________________ > Tutor maillist - Tutor at python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor From jakecohen120 at gmail.com Sat Dec 3 23:45:10 2022 From: jakecohen120 at gmail.com (Jacob Cohen) Date: Sat, 3 Dec 2022 23:45:10 -0500 Subject: [Tutor] (no subject) Message-ID: My code for this section is to get the current year from the user, and do the current year-1946 which was the NBA founding year to find how old the NBA is and it is giving me error messages? From nulla.epistola at web.de Sun Dec 4 05:33:02 2022 From: nulla.epistola at web.de (Sibylle Koczian) Date: Sun, 4 Dec 2022 11:33:02 +0100 Subject: [Tutor] (no subject) In-Reply-To: References: Message-ID: Am 04.12.2022 um 05:45 schrieb Jacob Cohen: > My code for this section is to get the current year from the user, and do the current year-1946 which was the NBA founding year to find how old the NBA is and it is giving me error messages? > So we know that you did write code. That's good. And you get error messages. That's usual. But how can anybody help you without seeing the code and the error messages? We need both, as text and in the body of the mail, because this lists removes attachments. And as we are talking about Python, don't let your email client change the indentation of your code. Additional information we might need: your OS and Python version. Moreover your mail should have a good subject - but without seeing the error messages at the very least I can't advise you. HTH Sibylle From nulla.epistola at web.de Sun Dec 4 05:33:02 2022 From: nulla.epistola at web.de (Sibylle Koczian) Date: Sun, 4 Dec 2022 11:33:02 +0100 Subject: [Tutor] (no subject) In-Reply-To: References: Message-ID: Am 04.12.2022 um 05:45 schrieb Jacob Cohen: > My code for this section is to get the current year from the user, and do the current year-1946 which was the NBA founding year to find how old the NBA is and it is giving me error messages? > So we know that you did write code. That's good. And you get error messages. That's usual. But how can anybody help you without seeing the code and the error messages? We need both, as text and in the body of the mail, because this lists removes attachments. And as we are talking about Python, don't let your email client change the indentation of your code. Additional information we might need: your OS and Python version. Moreover your mail should have a good subject - but without seeing the error messages at the very least I can't advise you. HTH Sibylle From threesomequarks at proton.me Sun Dec 4 10:05:36 2022 From: threesomequarks at proton.me (ThreeBlindQuarks) Date: Sun, 04 Dec 2022 15:05:36 +0000 Subject: [Tutor] (no subject) In-Reply-To: References: Message-ID: This looks like a reasonable beginner problem but without details I have to ask how you read in a number from the user? What type was the answer? What type does it have to be to do a subtraction without an error? Sent from Proton Mail mobile -------- Original Message -------- On Dec 3, 2022, 11:45 PM, Jacob Cohen wrote: > My code for this section is to get the current year from the user, and do the current year-1946 which was the NBA founding year to find how old the NBA is and it is giving me error messages? _______________________________________________ Tutor maillist - Tutor at python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor From mhysnm1964 at gmail.com Wed Dec 14 03:47:55 2022 From: mhysnm1964 at gmail.com (mhysnm1964 at gmail.com) Date: Wed, 14 Dec 2022 19:47:55 +1100 Subject: [Tutor] ftp recursive directory function doesn't work. Message-ID: <001b01d90f98$c35fa050$4a1ee0f0$@GMAIL.COM> All, I am trying to navigate a ftp server directory structure to see how big the directory actually is. The function recursively goes through the directories. When I pass the first if test calling the os object. I get a file not found error and it breaks. Everything in the first level directory are directories. I cannot work out what is going wrong. from ftplib import FTP import os def get_size(ftp, directory): size = 0 ftp.cwd(directory) files = ftp.nlst(b ) for file in files: if os.path.isdir(file): size += get_size(ftp, file) else: size += ftp.size(file) return size ftp = FTP('ftp.example.com') username = 'a name' pwd = 'a password' ftp.login(user = username, passwd = pwd) starting_dir = '/dvds/' size = get_size(ftp, starting_dir) print('Total size of directory and subdirectories:', size) This is not a school exercise. I am trying to work how long it will take backup a directory. Sean From bouncingcats at gmail.com Wed Dec 14 04:47:33 2022 From: bouncingcats at gmail.com (David) Date: Wed, 14 Dec 2022 20:47:33 +1100 Subject: [Tutor] ftp recursive directory function doesn't work. In-Reply-To: <001b01d90f98$c35fa050$4a1ee0f0$@GMAIL.COM> References: <001b01d90f98$c35fa050$4a1ee0f0$@GMAIL.COM> Message-ID: On Wed, 14 Dec 2022 at 19:48, wrote: > I am trying to navigate a ftp server directory structure to see how big the > directory actually is. The function recursively goes through the > directories. When I pass the first if test calling the os object. I get a > file not found error and it breaks. Everything in the first level directory > are directories. I cannot work out what is going wrong. > files = ftp.nlst(b ) Hi, this gives you a list of files that are on the *server*. > for file in files: > if os.path.isdir(file): And there you check to see if that file is a directory on the *client*. You need to replace your os.path.isdir() test with a different approach that can test for directories using information available from the server. At a casual glance, perhaps you could parse the output of ftp.retrlines('LIST') or there might be a better way. From cs at cskk.id.au Wed Dec 14 04:50:11 2022 From: cs at cskk.id.au (Cameron Simpson) Date: Wed, 14 Dec 2022 20:50:11 +1100 Subject: [Tutor] ftp recursive directory function doesn't work. In-Reply-To: <001b01d90f98$c35fa050$4a1ee0f0$@GMAIL.COM> References: <001b01d90f98$c35fa050$4a1ee0f0$@GMAIL.COM> Message-ID: On 14Dec2022 19:47, mhysnm1964 at gmail.com wrote: >I am trying to navigate a ftp server directory structure to see how big >the >directory actually is. The function recursively goes through the >directories. When I pass the first if test calling the os object. I get a >file not found error and it breaks. Everything in the first level directory >are directories. I cannot work out what is going wrong. [...] >from ftplib import FTP >import os > >def get_size(ftp, directory): > size = 0 > ftp.cwd(directory) > files = ftp.nlst(b ) > for file in files: > if os.path.isdir(file): > size += get_size(ftp, file) > else: > size += ftp.size(file) > return size Ignoring syntax errors above, the `os.path.isdir` call checks `file` in the local filesystem, not on the FTP server's file system. I don't see a method in the `ftplib` module to check whether a remote path is a directory, but you could try `ftp.cwd(file)` for each name. If that succeeds it should be a directory, and if it fails you could assumes it is a file. I haven't tried this. Cheers, Cameron Simpson From mhysnm1964 at gmail.com Wed Dec 14 17:05:34 2022 From: mhysnm1964 at gmail.com (Sean Murphy) Date: Thu, 15 Dec 2022 09:05:34 +1100 Subject: [Tutor] ftp recursive directory function doesn't work. In-Reply-To: References: Message-ID: Thanks all, I knew I missed something very obvious in relation to the OS Method I will have to use regular expressions as the output from one of the FTP functions give you the file permissions, My experience is the part > On 14 Dec 2022, at 8:50 pm, Cameron Simpson wrote: > > ?On 14Dec2022 19:47, mhysnm1964 at gmail.com wrote: >> I am trying to navigate a ftp server directory structure to see how big the >> directory actually is. The function recursively goes through the >> directories. When I pass the first if test calling the os object. I get a >> file not found error and it breaks. Everything in the first level directory >> are directories. I cannot work out what is going wrong. > [...] > >> from ftplib import FTP >> import os >> >> def get_size(ftp, directory): >> size = 0 >> ftp.cwd(directory) >> files = ftp.nlst(b ) >> for file in files: >> if os.path.isdir(file): >> size += get_size(ftp, file) >> else: >> size += ftp.size(file) >> return size > > Ignoring syntax errors above, the `os.path.isdir` call checks `file` in the local filesystem, not on the FTP server's file system. > > I don't see a method in the `ftplib` module to check whether a remote path is a directory, but you could try `ftp.cwd(file)` for each name. If that succeeds it should be a directory, and if it fails you could assumes it is a file. I haven't tried this. > > Cheers, > Cameron Simpson From sergio_r at mail.com Mon Dec 19 14:50:55 2022 From: sergio_r at mail.com (Sergio Rojas) Date: Mon, 19 Dec 2022 20:50:55 +0100 Subject: [Tutor] Video (in Spanish) on using python/sympy in physics courses References: Message-ID: Hello folks, ? ? A (Spanish) YouTube video on using python and sympy in physics course is at: ? ? ? ? ? ?https://youtu.be/QwugdqapM3s ? Regards, ? Sergio From Dennis at netwealth.com.au Mon Dec 26 04:26:31 2022 From: Dennis at netwealth.com.au (Dennis Nguyen) Date: Mon, 26 Dec 2022 09:26:31 +0000 Subject: [Tutor] Update Python 3.9.16 from Python 3.9.13 Message-ID: Hi Tutors, I understand that there is no installers file to install python 3.9.16, we must install python 3.9.13. My question: could we able to install security fixes 3.9.16 on a windows VM which currently install 3.9.13. Regarding with this link https://www.python.org/downloads/release/python-3916/, I am able to download oython-3.9.16.tgz. After downloaded, I extracted the file, but I have no idea how to install this patch. Could you please instruct us how to patch security fix? Thank you. Dennis Nguyen Senior Systems Engineer Netwealth Investments Limited Freecall 1800 888 223 Phone +61 3 9655 1345 Web netwealth.com.au | LinkedIn | Twitter | Facebook Saddress1 Awards* Best overall platform (2015-2019 and 2021), Investment Trends Ranked number 1 for overall user platform satisfaction (2012-2021), Investment Trends Super Fund Award for Best Advised Product of the year (2018-2022), Chant West Learn about new platform features and enhancements, here Access FAQs and how-to-guides for our products, here Proud sponsors of financial literacy in schools. Learn about Banqer. Netwealth Investments Limited ABN 85 090 569 109 AFSL 230975 *Our awards include: 'Overall Satisfaction with Platform', Investment Trends 2021 Adviser Technology Needs Report; Winner, award for 'Best Platform Overall', Investment Trends 2021 Platform Competitive Analysis and Benchmarking Report; Chant West Super Fund Award for Best Advised Product of the Year (2022). Private & confidential: This email may contain confidential or privileged information. If it's not intended for you, please notify the sender and destroy all copies. General information only: If there is any financial product advice in this email, it is general advice only. Before acting on it, consider if it's appropriate to your particular objectives, financial situation and needs, because we have not taken them into account. You should obtain and consider the relevant disclosure document before deciding whether to acquire, dispose of or hold an investment in any financial product. Netwealth and its associates accept no responsibility for any loss suffered by any person arising from reliance on this information. *Our awards include: SuperRatings 2017 Gold Rating for Netwealth Super Accelerator Core and Plus for our Super and Standard Income Stream products (for details of SuperRatings' rating criteria visit www.superratings.com.au); Joint winner, 'Overall Satisfaction with Platform', Investment Trends 2017 Planner Technology Report; Winner, 'Best Platform Overall', Investment Trends 2016 Platform Benchmarking Report. Netwealth Investments Limited ABN 85 090 569 109 Trustee of the Netwealth Superannuation Master Fund ABN 94 573 747 704 & Operator of the Netwealth Wrap Service ABN 73 092 895 154. From mats at wichmann.us Tue Dec 27 12:11:32 2022 From: mats at wichmann.us (Mats Wichmann) Date: Tue, 27 Dec 2022 10:11:32 -0700 Subject: [Tutor] Update Python 3.9.16 from Python 3.9.13 In-Reply-To: References: Message-ID: <74820e32-b7bb-88e1-5293-c07e11277b7a@wichmann.us> On 12/26/22 02:26, Dennis Nguyen via Tutor wrote: > Hi Tutors, > > I understand that there is no installers file to install python 3.9.16, we must install python 3.9.13. > My question: could we able to install security fixes 3.9.16 on a windows VM which currently install 3.9.13. > > Regarding with this link https://www.python.org/downloads/release/python-3916/, I am able to download oython-3.9.16.tgz. After downloaded, I extracted the file, but I have no idea how to install this patch. > > Could you please instruct us how to patch security fix? You need to build Python for yourself if you want a version that doesn't have installers built for it. On Windows, this is not entirely trivial. The canoncial location for insructions is here: https://devguide.python.org/ There's a rather more targeted blurb here (which I think the developer guide points to): https://github.com/python/cpython/blob/main/PCbuild/readme.txt#L57