From selvi.dct at gmail.com Mon Jun 6 12:38:13 2022 From: selvi.dct at gmail.com (selvi dct) Date: Mon, 6 Jun 2022 22:08:13 +0530 Subject: [Chennaipy] Chennaipy - Monday Module - 06 Jun 2022 Message-ID: Introduction: It's always hard to parse the binary file to text. Today we will see rescue module which will help us to convert docx to md file Module: docx2md Installation: pip install docx2md About: Converts Microsoft Word document files (.docx extension) to Markdown files. Execution: % python -m docx2md ~/Downloads/example.docx output.msd # save output.msd # save media/image1.png # save media/image4.jpg # save media/image3.gif # save media/image2.png Output: % cat output.msd
# chapter 1 text of chapter 1 ## section 1-1 text of section 1-1 ### subsection 1-1-1 text of subsection 1-1-1
insert png insert bmp insert gif insert jpg
* aaaaa * bbbbb * ccccc * ddddd * eeeee * fffff * ggggg * hhhhh * iiiii * jjjjj
a b c
d e f
g h i
Reference: https://pypi.org/project/docx2md/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From selvi.dct at gmail.com Mon Jun 13 09:52:07 2022 From: selvi.dct at gmail.com (selvi dct) Date: Mon, 13 Jun 2022 19:22:07 +0530 Subject: [Chennaipy] Chennaipy - Monday Module - 13 Jun 2022 Message-ID: Date: 13 Jun 2022 Introduction: Handling and manipulating date, different zones, differences requires lots of attention and coding. Well today we have a module which would ease datetimes manipulation. Module: pendulum Installation: pip install pendulum About: Library to work with dates and times. Sample Source Code: import pendulum # Current time in India now_in_india = pendulum.now('Asia/Kolkata') print("Current time in India: {}".format(now_in_india)) # Convert time in UTC timezone print("Converted time in UTC timezone: {}".format(now_in_india.in_timezone('UTC'))) # Easy manipulations for with the dates tomorrow = pendulum.now().add(days=1) print("Tomorrow's date: {}".format(tomorrow)) last_week = pendulum.now().subtract(weeks=1) print("Last Week same day date: {}".format(last_week)) past = pendulum.now().subtract(minutes=2) print("Two mins's back time: {}".format(past)) print("Two mins's back time human readable: {}".format(past.diff_for_humans())) delta = past - last_week delta.hours print("Time differences: {}".format(delta.hours)) Execution: $ python pendulum_sample.py Output: Current time in India: 2022-06-13T19:10:00.285442+05:30 Converted time in UTC timezone: 2022-06-13T13:40:00.285442+00:00 Tomorrow's date: 2022-06-14T19:10:00.286219+05:30 Last Week same day date: 2022-06-06T19:10:00.286327+05:30 Two mins's back time: 2022-06-13T19:08:00.286385+05:30 Two mins's back time human readable: 2 minutes ago Time differences: 23 Reference: https://pypi.org/project/pendulum/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From tshrinivasan at gmail.com Wed Jun 15 07:28:13 2022 From: tshrinivasan at gmail.com (Shrinivasan T) Date: Wed, 15 Jun 2022 16:58:13 +0530 Subject: [Chennaipy] Fwd: [BangPypers] Looking for Python / Django Developers In-Reply-To: References: Message-ID: ---------- Forwarded message --------- ??????????: Lakshmi Date: ???., 15 ????, 2022, ???????? 4:25 Subject: [BangPypers] Looking for Python / Django Developers To: Bangalore Python Users Group - India Hello All, We have an immediate requirement for a 5+yrs experience Python / Django Web Developer for a SaaS based startup located in bangalore. Anyone interested pls reach out to me on a private window with your profile. Best Regards, Lakshmi _______________________________________________ BangPypers mailing list BangPypers at python.org https://mail.python.org/mailman/listinfo/bangpypers -- Regards, T.Shrinivasan My Life with GNU/Linux : http://goinggnu.wordpress.com Free E-Magazine on Free Open Source Software in Tamil : http://kaniyam.com Get Free Tamil Ebooks for Android, iOS, Kindle, Computer : http://FreeTamilEbooks.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From tshrinivasan at gmail.com Wed Jun 15 10:30:07 2022 From: tshrinivasan at gmail.com (Shrinivasan T) Date: Wed, 15 Jun 2022 20:00:07 +0530 Subject: [Chennaipy] Fwd: [BangPypers] Looking for Python Microservices Trainer In-Reply-To: References: Message-ID: ---------- Forwarded message --------- From: Lakshmi Date: Wed, Jun 15, 2022, 6:31 PM Subject: [BangPypers] Looking for Python Microservices Trainer To: Bangalore Python Users Group - India Hello All, We have a requirement for freshers training who can train on Python Microservices and Kubernetes. Any freelance trainer - industry experienced with live projects can undertake this requirement. Pls reach out to me on private window. Thanks Lakshmi _______________________________________________ BangPypers mailing list BangPypers at python.org https://mail.python.org/mailman/listinfo/bangpypers -------------- next part -------------- An HTML attachment was scrubbed... URL: From selvi.dct at gmail.com Mon Jun 20 00:40:53 2022 From: selvi.dct at gmail.com (selvi dct) Date: Mon, 20 Jun 2022 10:10:53 +0530 Subject: [Chennaipy] Chennaipy - Monday Module - 20 Jun 2022 Message-ID: Date: 20 Jun 2022 Introduction: Whether you need to bootstrap your database, create good-looking XML documents, fill-in your persistence to stress test it, or anonymize data taken from a production service, Faker is for you. Module: Faker Installation: pip install Faker About: Faker package helps to generate fake data, such as name, address, text, color, date time, currencies, sentences, phone numbers and so on. To ensure that all the generated values are unique for a specific function, the .unique method is called. Instead, to generate the same value each time, the seed() method is used. Sample Source Code: from faker import Faker fake = Faker() print("Name:", fake.name()) print("Address:", fake.address()) print("Email:", fake.email()) print("Phone Number:", fake.phone_number()) print("Company:", fake.company()) print("Text:", fake.text()) Execution: $ python faker_sample.py Output: Name: Maria Miller Address: 006 Melissa Radial Emilyfort, MA 79709 Email: bradfordjacqueline at hotmail.com Phone Number: (315)802-5718x3723 Company: Lopez-Estrada Text: Site church style yeah truth before. Boy shoulder his man could. Administration mouth create career difficult return speech. Mrs town concern us. Reference: https://pypi.org/project/Faker -------------- next part -------------- An HTML attachment was scrubbed... URL: From sakthirengaraj at gmail.com Fri Jun 24 10:04:29 2022 From: sakthirengaraj at gmail.com (Rengaraj D) Date: Fri, 24 Jun 2022 19:34:29 +0530 Subject: [Chennaipy] June meetup RSVP required Message-ID: Hi Everyone Welcome to June month meetup. # Schedule * Python-can for software upgrade * Python For Kids * Monday Modules * Lightning talks # Venue * Online * RSVP to get the meeting link https://www.meetup.com/chennaipy/events/286420134/ # Date & Time * 25/06/2022 * 3:00 PM to 5:00 PM # New to Python ? * Learn Python in 30 minutes https://learnxinyminutes.com/docs/python/ * How to think like a computer Scientist? http://openbookproject.net/thinkcs/python/english3e/ Regards Rengaraj -------------- next part -------------- An HTML attachment was scrubbed... URL: From tshrinivasan at gmail.com Sun Jun 26 11:53:24 2022 From: tshrinivasan at gmail.com (Shrinivasan T) Date: Sun, 26 Jun 2022 21:23:24 +0530 Subject: [Chennaipy] Fwd: Long Live Linux Users Groups In-Reply-To: References: Message-ID: ---------- Forwarded message --------- ??????????: Shrinivasan T Date: ????., 26 ????, 2022, ???????? 9:22 Subject: Long Live Linux Users Groups To: ILUG-Chennai Today, we had our weekly Kanchi Linux Users Group, online via https://meet.jit.si Platform. All the meeting was on Tamil Language. Dhanasekar introduced Docker. He explored the basic usage, writing Docker files and demonstrated how to build and run Docker images. Mohan explained how chroot is mother of all virtualization solutions like Docker, Podman, LXC, snap, flatpak etc. Then, We started to discuss on many things on the FOSS world. Many students studying at https://Payilagam.com joined. For many of them, it is a new experience to hear the open source discussions in Tamil itself. The very good thing Payilagam does is, they ask all the students to install LinuxMint on their machines. It is a mandatory thing. After showing linux on their machine only, their classes starts. As the students have the linux already, now they are enabled to learn millions of new things on their computer. They attend various tech meetups. They attend Kanchi Linux Users Group, Indian Linux Users Group Chennai ( ILUGC ), ChennnaiPy meetups. Few of them are already giving talks. A switch to Linux OS will open millions of gates in Life. In todays meeting, we asked all the participants to give one talk on the upcoming meetups. The LUGs are the best place to start learning. Not only tech. It will give all the life skills. For me, ILUGC, KanchiLUG, Villupuram LUG gave me life long friends, tons of learnings, and the ability to do anything on the world. Today, wondered to know about Badri from Villupuram. Villupuram LUG is celebrating Software Freedom Day every year. 8 years ago, when he was at 9th standard, he attended one Software Freedom Day celebration there. He got to know about Linux OS, Free Software philosophies, Free Hardware and all major free software. He installed Linux and started using it. He explored all the distros. He learnt mobile development, flutter on his collge days. He started to talk about linux to all his friends, and moving them all to Linux. He is still at his final year of collge. He got job already as a flutter development. He is using Manjora Linux. Good to know it is used in remote deep villages too. Another one is from Gopinath. He started to attend ChennaiPy meetups. Then he joined ILUGC meetings. He still remember that we were celebrating Debian Buster Release with a cake cutting on ILUGC meet. Since then he is attending all possible open source related meetups. He grows on knowledge and career along with all these meetings. Annamalai from Trichy NIT. Told that ChennaiPy Vijay and Creator of Ezhil Language Muthu are from NIT Trichy. They are part of NIT LUG on those days. That LUG spirit is still driving them even after many years,. Asked him to restart LUG activities there. Kavitha told that she is a security expert. She told that she is looking for a tamil tech community for long time and happy to find us. She agreed to give talks on upcoming meetings. Dhanasekaran is a Civil engineer. Still using Linux for past 18 years. He is interested in Free Hardware. He will give talks on that soon. Happy to know that many people are following https://Kaniyam.com as it is the only online magazine for Free/Open Source Software. Thanks for all the contributors for Kaniyam.com for keeping it alive for 10+ years. Missed to write about many participants. Will take better notes next time. It is really a social revolution that all the Linux Users Groups are doing, silently. Even a small meetup, a Linux Demo day, a software freedom day can open up someone mind and it will lead to great life change for them. Even my life started to shift it gears after ILUGC meetings only. The pains I took to travel to attend ILUGC meeting, from Kanchipuram to Chennai, are still paying back to me with good job, good skills and never ending learnings. I request all of you join a nearby Linux User Group. If not start one. It is so easy to start a LUG. Just find one or two supporting people and start spreading the software freedom. Even the small regular activities can lit light on many people?s life. You dont need to be an expert to give a talk. Just share what ever you are learning. Another tip here. If you want to learn any topic deeply, announce a talk on that. It will make to read a lot, practice a lot. On giving a talk, you will learn tons of things. Thats what I follow for many years. I wish there is a Linux Users Group, in every village, every town, every city, every college. They will build a great human society, because Linux is not just a Operating system. It is a life style. Long Live all the existing Linux User Groups, all around the world. Thanks for all who are contributing to all LUG activities. -- Regards, T.Shrinivasan My Life with GNU/Linux : http://goinggnu.wordpress.com Free E-Magazine on Free Open Source Software in Tamil : http://kaniyam.com Get Free Tamil Ebooks for Android, iOS, Kindle, Computer : http://FreeTamilEbooks.com -- Regards, T.Shrinivasan My Life with GNU/Linux : http://goinggnu.wordpress.com Free E-Magazine on Free Open Source Software in Tamil : http://kaniyam.com Get Free Tamil Ebooks for Android, iOS, Kindle, Computer : http://FreeTamilEbooks.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From vishnuprabhabv97 at gmail.com Fri Jun 24 08:17:07 2022 From: vishnuprabhabv97 at gmail.com (vishnu prabha b v) Date: Fri, 24 Jun 2022 17:47:07 +0530 Subject: [Chennaipy] To extract text from docx file using python Message-ID: from docx import document document = Document('sample.docx') type(document) document.paragraphs type(document.paragraphs) document.paragraphs(0) document.paragraphs[0].text document.paragraphs[1].text index = 0 for para in document.paragraphs: index+=1 if (len(para.text)>0): print("\n paragraph",index,"is") print(para.text) In this ,I have used pip install python-docx even after installed , i have found No module found error. [image: image.png] help me to fix this problem and is this is the correct way to extract txt from docs? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 51359 bytes Desc: not available URL: From tstnarayan at gmail.com Sun Jun 26 23:20:01 2022 From: tstnarayan at gmail.com (Thirunarayanan Srinivasan) Date: Mon, 27 Jun 2022 08:50:01 +0530 Subject: [Chennaipy] To extract text from docx file using python In-Reply-To: References: Message-ID: Looks like your installation didn?t go through properly. If you are Python3 , can you try this. pip uninstall python-docx pip3 install python-docx On Mon, 27 Jun 2022 at 8:45 AM vishnu prabha b v wrote: > from docx import document > document = Document('sample.docx') > type(document) > document.paragraphs > type(document.paragraphs) > document.paragraphs(0) > document.paragraphs[0].text > document.paragraphs[1].text > index = 0 > for para in document.paragraphs: > index+=1 > if (len(para.text)>0): > print("\n paragraph",index,"is") > print(para.text) > > > > In this ,I have used pip install python-docx > even after installed , i have found No module found error. > [image: image.png] > help me to fix this problem and is this is the correct way to extract txt > from docs? > _______________________________________________ > Chennaipy mailing list > Chennaipy at python.org > https://mail.python.org/mailman/listinfo/chennaipy > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 51359 bytes Desc: not available URL: From vishnuprabhabv97 at gmail.com Mon Jun 27 01:34:13 2022 From: vishnuprabhabv97 at gmail.com (vishnu prabha b v) Date: Mon, 27 Jun 2022 11:04:13 +0530 Subject: [Chennaipy] To extract text from docx file using python In-Reply-To: References: Message-ID: It doesn't work because python version is 2.7.17 On Mon, 27 Jun, 2022, 8:53 am Thirunarayanan Srinivasan, < tstnarayan at gmail.com> wrote: > Looks like your installation didn?t go through properly. If you are > Python3 , can you try this. > > pip uninstall python-docx > pip3 install python-docx > > > On Mon, 27 Jun 2022 at 8:45 AM vishnu prabha b v < > vishnuprabhabv97 at gmail.com> wrote: > >> from docx import document >> document = Document('sample.docx') >> type(document) >> document.paragraphs >> type(document.paragraphs) >> document.paragraphs(0) >> document.paragraphs[0].text >> document.paragraphs[1].text >> index = 0 >> for para in document.paragraphs: >> index+=1 >> if (len(para.text)>0): >> print("\n paragraph",index,"is") >> print(para.text) >> >> >> >> In this ,I have used pip install python-docx >> even after installed , i have found No module found error. >> [image: image.png] >> help me to fix this problem and is this is the correct way to extract txt >> from docs? >> _______________________________________________ >> Chennaipy mailing list >> Chennaipy at python.org >> https://mail.python.org/mailman/listinfo/chennaipy >> > _______________________________________________ > Chennaipy mailing list > Chennaipy at python.org > https://mail.python.org/mailman/listinfo/chennaipy > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 51359 bytes Desc: not available URL: From sakthirengaraj at gmail.com Mon Jun 27 05:54:50 2022 From: sakthirengaraj at gmail.com (Rengaraj D) Date: Mon, 27 Jun 2022 15:24:50 +0530 Subject: [Chennaipy] To extract text from docx file using python In-Reply-To: References: Message-ID: On Mon, 27 Jun 2022 at 14:10, vishnu prabha b v wrote: > It doesn't work because python version is 2.7.17 > > On Mon, 27 Jun, 2022, 8:53 am Thirunarayanan Srinivasan, < > tstnarayan at gmail.com> wrote: > >> Looks like your installation didn?t go through properly. If you are >> Python3 , can you try this. >> >> pip uninstall python-docx >> pip3 install python-docx >> >> If you carefully go through the error , the python interpreter is looking for a library present in the Python3 path. Either you installed the module in a virtual environment and forget to activate the virtual environment or you are running the code with python3 instead of python2. Also next time when you share an error message don't share it as an image. Copy paste the console error log so that we can easily point out. mailing list guidelines - http://chennaipy.org/mailing-list-guidelines.html Regards Rengaraj -------------- next part -------------- An HTML attachment was scrubbed... URL: From selvi.dct at gmail.com Mon Jun 27 13:06:35 2022 From: selvi.dct at gmail.com (selvi dct) Date: Mon, 27 Jun 2022 22:36:35 +0530 Subject: [Chennaipy] Chennaipy - Monday Module - 27 Jun 2022 Message-ID: *Date:* 27 Jun 2022 *Module:* pycurl *Installation:* pip install pycurl *About:* PycURL is a Python interface to libcurl, the multiprotocol FILE, FTPS, HTTP, HTTPS, IMAP, POP3, SMTP, SCP, SMB, etc. file transfer library. PycURL module can be used to fetch objects with high speed from a URL. *Sample:* import pycurl from io import BytesIO b_obj = BytesIO() crl = pycurl.Curl() # Set URL value crl.setopt(crl.URL, 'https://wiki.python.org/moin/BeginnersGuide') # Write bytes that are utf-8 encoded crl.setopt(crl.WRITEDATA, b_obj) # Perform a file transfer crl.perform() # End curl session crl.close() # Get the content stored in the BytesIO object (in byte characters) get_body = b_obj.getvalue() # Decode the bytes stored in get_body to HTML and print the result print('Output of GET request:\n%s' % get_body.decode('utf8')) *Execution:* % % python pycurl_sample.py *Output:* Output of GET request: .. < wiki page content > .. *Reference:* https://pypi.org/project/pycurl/ https://stackabuse.com/using-curl-in-python-with-pycurl/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From nsh531 at gmail.com Mon Jun 27 13:56:38 2022 From: nsh531 at gmail.com (=?UTF-8?B?16DXqteZINep15jXqNef?=) Date: Mon, 27 Jun 2022 20:56:38 +0300 Subject: [Chennaipy] wsgiref library - help Message-ID: pls help me on wsgiref library: wsgiref ? WSGI Utilities and Reference Implementation ? Python 3.10.5 documentation tnx nate -- -------------- next part -------------- An HTML attachment was scrubbed... URL: From nsh531 at gmail.com Tue Jun 28 03:57:59 2022 From: nsh531 at gmail.com (=?UTF-8?B?16DXqteZINep15jXqNef?=) Date: Tue, 28 Jun 2022 10:57:59 +0300 Subject: [Chennaipy] why function throws an error? Message-ID: def add_route(self, route): # """ Add a route object, but do not change the :data:`Route.app` # attribute.""" self.routes.append(route) self.router.add(route.rule, route.method, route, name=route.name ) # if DEBUG: route.prepare() -- -------------- next part -------------- An HTML attachment was scrubbed... URL: From nsh531 at gmail.com Tue Jun 28 09:35:22 2022 From: nsh531 at gmail.com (=?UTF-8?B?16DXqteZINep15jXqNef?=) Date: Tue, 28 Jun 2022 16:35:22 +0300 Subject: [Chennaipy] WHAT THE ERROR ON MY CODE??? Message-ID: import requests from requests.structures import CaseInsensitiveDict url = "https://api.crowdstrike.com/oauth2/token" headers = CaseInsensitiveDict() headers["Content-Type"] = "application/x-www-form-urlencoded" headers["Authorization"] = "Basic YjMwMzcwODY3NTUzNDMwNTg5NzA2MjkyNDFmMDE1YWY6VjNKYTk2Y1F4RTFzeTdYbzRnbkt0a2k1djhscXUyU01oSE5VWUwwRg==" data = "POST" resp = requests.post(url, headers=headers, data=data) print(resp.text) print(resp.status_code) import requests from requests.structures import CaseInsensitiveDict MYurl = " https://api.crowdstrike.com/intel/combined/indicators/v1?q=123.123.123.123" headersa = CaseInsensitiveDict() headersa["Authorization"] = "Bearer "+resp.text resp1 = requests.get(MYurl, headers=headersa) print(resp1.status_code) -------------- next part -------------- An HTML attachment was scrubbed... URL: From vijaykumar at zilogic.com Tue Jun 28 09:52:08 2022 From: vijaykumar at zilogic.com (Vijay Kumar B) Date: Tue, 28 Jun 2022 19:22:08 +0530 Subject: [Chennaipy] WHAT THE ERROR ON MY CODE??? In-Reply-To: References: Message-ID: <181aa956bbc.30c93716590333.161446694552286463@zilogic.com> Hi, Please provide some background / context to your program. Indicate what issue you are facing, and then ask for help. Without this information it is impossible to help you out. Regards, Vijay -------------- next part -------------- An HTML attachment was scrubbed... URL: