Re: not able to use python

2022-08-17 Thread Dan Ciprus (dciprus) via Python-list

Those people keep me on my toes every time I look at such a message :-/.


On Wed, Aug 17, 2022 at 12:35:28PM -0500, Igor Korot wrote:

Hi,

On Wed, Aug 17, 2022 at 12:20 PM i am unable to use python
 wrote:





AND I"M UNABLE TO SEE ANYTHING IN YOUR MESSAGE...

THANK YOU.





   Sent from [1]Mail for Windows



References

   Visible links
   1. https://go.microsoft.com/fwlink/?LinkId=550986
--
https://mail.python.org/mailman/listinfo/python-list

--
https://mail.python.org/mailman/listinfo/python-list


--
Daniel Ciprus  .:|:.:|:.
CONSULTING ENGINEER.CUSTOMER DELIVERY   Cisco Systems Inc.
dcip...@cisco.com
tel: +1-703-484-0205
mob: +1-540-223-7098

[ curl -L http://git.io/unix ]


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Conecting to MySQL

2022-08-09 Thread Dan Ciprus (dciprus) via Python-list
I'm not sure about this but this mailing list does not allow attachments ... 


On Tue, Aug 09, 2022 at 12:45:33PM -0300, Guilherme Campos wrote:

Hi Igor,

Accessing mysql-workbench it appeared new error messages when I clicked
Server Status.

I created my database on MySQL Workbench . Is that your question?


[image: image.png]

[image: image.png]


Em ter., 9 de ago. de 2022 às 12:36, Igor Korot 
escreveu:


Hi,
@OP,
Can you try to connect with mysql-workbench?
Also - you didn't answer my first question.

Are you using an ODBC wrapper or python module?

Thank you.


On Tue, Aug 9, 2022 at 10:27 AM Axy  wrote:
>
>
> >> trying to connect to MYSQL it appears the error msg below:
> >> InterfaceError: 2003: Can't connect to MySQL server on
'localhost:3306'
> >> (111 Connection refused)
> >> [image: conexao.png]
> >> How can i fix that.?
> > What do you use for connection?
> > Does the firewall interfere with the connection?
>
> Firewall usually causes connection to hang and timeout with no response.
>
> But in this case connection looks immediately refused which means either
> port number is wrong or mysql is not listening on 127.0.0.1.
>
>
> Axy
>


--
https://mail.python.org/mailman/listinfo/python-list


--
Daniel Ciprus  .:|:.:|:.
CONSULTING ENGINEER.CUSTOMER DELIVERY   Cisco Systems Inc.
dcip...@cisco.com
tel: +1-703-484-0205
mob: +1-540-223-7098

[ curl -L http://git.io/unix ]


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Conecting to MySQL

2022-08-09 Thread Dan Ciprus (dciprus) via Python-list

Yes, exactly that .. I replied from different account and my email was 
rejected. Just make sure that
your mysql is actually running. Depending on your OS, run netstat -an | grep 
3306 and this will tell
you whether socket is actually in listening mode or not. If it's not, your 
mysql is either not
running or you have a problem with the configuration.

On Tue, Aug 09, 2022 at 08:27:16AM -0700, Axy via Python-list wrote:



trying to connect to MYSQL it appears the error msg below:
InterfaceError: 2003: Can't connect to MySQL server on 'localhost:3306'
(111 Connection refused)
[image: conexao.png]
How can i fix that.?

What do you use for connection?
Does the firewall interfere with the connection?


Firewall usually causes connection to hang and timeout with no response.

But in this case connection looks immediately refused which means 
either port number is wrong or mysql is not listening on 127.0.0.1.



Axy

--
https://mail.python.org/mailman/listinfo/python-list


--
Daniel Ciprus  .:|:.:|:.

[ curl -L http://git.io/unix ]


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Exchange OWA using Python?

2022-03-31 Thread Dan Ciprus (dciprus) via Python-list
Yes, this ... I've been using this successfully for years and it obviously has 
its sad parts but it works pretty well overall.


From: Python-list  on behalf 
of Christian Gollwitzer 
Sent: Thursday, March 31, 2022 3:22 PM
To: python-list@python.org
Subject: Re: Exchange OWA using Python?

Am 31.03.22 um 16:41 schrieb Grant Edwards:
> Is anybody aware of any Python code for the Exchange OWA protocol/API?
>
> The OWA e-mail client I've been using has stopped working. It was a
> commerical Python application named Hiri, wich has been abandoned by
> the developer.
>
> So, for now, I'm stuck with the OWA web client. It's clumsy and
> everything takes 3X as long to accomplish as it would with a real
> e-mail client, but I can survive with it if I have to.

I can recommend davmail as a workaround:

http://davmail.sourceforge.net/

Davmail converts OWA into regular mail protocols like POP3, IMAP, SMTP.
You can use any email/calender client (I've used thunderbird) and most
of it worked well.

Davmail is written in Java, not Python, but basically this should not
matter if you only use it.

Christian
--
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Exchange OWA using Python?

2022-03-31 Thread Dan Ciprus (dciprus) via Python-list
Our org does not have imap nor pop enabled so I guess it depends on your IT and 
what's enabled for your org. Just my $.02 ..


On Thu, Mar 31, 2022 at 07:12:10PM +0200, Dieter Maurer wrote:

Grant Edwards wrote at 2022-3-31 07:41 -0700:

Is anybody aware of any Python code for the Exchange OWA protocol/API?


According to "https://en.wikipedia.org/wiki/Outlook.com#Mail_client_access";
Outlook.com (the modern name for OWA) supports "pop3" and "imap",
both supported by Python library modules.

Read the "Outlook.com" documentation about how you can connect
via those protocols.
--
https://mail.python.org/mailman/listinfo/python-list


--
Daniel Ciprus  .:|:.:|:.
CONSULTING ENGINEER.CUSTOMER DELIVERY   Cisco Systems Inc.
dcip...@cisco.com
tel: +1-703-484-0205
mob: +1-540-223-7098

[ curl -L http://git.io/unix ]


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python

2022-03-03 Thread Dan Ciprus (dciprus) via Python-list
if OP formulates question the way he/she did, it's not worth to respond to it. 
There is plenty of similar questions in the archive.


On Tue, Feb 22, 2022 at 07:07:54AM -0700, Mats Wichmann wrote:

On 2/21/22 23:17, SASI KANTH REDDY GUJJULA wrote:

Pip files are not installing after the python 3.10.2 version installing in my 
devise. Please solve this for me.


Please ask a clearer question.

Can you tell us what "are not installing" means? Are you getting
permission errors?  Are you installing and then unable to import what
you have installed?  Something else?

--
https://mail.python.org/mailman/listinfo/python-list


--
Daniel Ciprus  .:|:.:|:.
CONSULTING ENGINEER.CUSTOMER DELIVERY   Cisco Systems Inc.

[ curl -L http://git.io/unix ]


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Repair Install of 64 bit python

2021-04-16 Thread Dan Ciprus (dciprus) via Python-list

Isn't the recommended python3 way of pip-ing stuff:

python3 -m pip install ...

.. just curious.

On Thu, Apr 15, 2021 at 08:36:56PM -0500, o1bigtenor wrote:

On Thu, Apr 15, 2021 at 8:03 PM Dodson, Matthew
 wrote:


Hi,

Having an issue after installing 64 bit python. Can't pip install any packages. Get the 
error "No module named pip".



No expert here but to me that reads like you need to install 'pip'.

On linux I need to make sure its pip3 - - - for python 3.
Then after that's done you sounds be able to go $ pip3 install x .

HTH
--
https://mail.python.org/mailman/listinfo/python-list


--
Daniel Ciprus  .:|:.:|:.
CONSULTING ENGINEER.CUSTOMER DELIVERY   Cisco Systems Inc.
dcip...@cisco.com
tel: +1-703-484-0205
mob: +1-540-223-7098



signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Website

2021-04-15 Thread Dan Ciprus (dciprus) via Python-list
Well I did not get the point of his question, obviously so apologies for being 
sarcastic at the beginning. This triggered my reaction because of the history 
of "funny" questions which you can find in this mailing list.

Sent from my smartphone
Do Not Get Outlook for Android<https://aka.ms/ghei36> !

From: o1bigtenor 
Sent: Thursday, April 15, 2021 9:49:45 AM
To: Dan Ciprus (dciprus) 
Cc: Rainyis ; python-list@python.org 

Subject: Re: Website

On Thu, Apr 15, 2021 at 7:40 AM Dan Ciprus (dciprus) via Python-list
 wrote:
>
> https://en.wikipedia.org/wiki/Sergio_Llorente
>
> wow .. you made it that far ?
>
> Jokes aside .. why are you asking for a permission to get a domain ? I would
> love to read a deeper explanation what made you send an email to this mailing
> list.
>
> On Wed, Apr 14, 2021 at 03:41:37PM +0200, Rainyis wrote:
> >Hello,
> >I am Sergio Llorente, and I want to create a web about python. I
> >will publish apps, scripts.. made by python. I will like to put python in
> >the domain. The domain will be like all-about-python.com but in Spanish(
> >todosobrepython.com). Can I use it?
> >
> >Thanks in advance,
> >Sergio
> >--
> >https://mail.python.org/mailman/listinfo/python-list
>

I would suggest that you quite missed the point of the question.

To me he is asking if he can use the word "python", which carries
a lot of meaning in the computer world, in his domain name.
I'd be handing him top marks for his asking rather than laughing
that he did ask. Its a very polite and respectful thing to ask
before registering the domain imo.

Regards
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Website

2021-04-15 Thread Dan Ciprus (dciprus) via Python-list

https://en.wikipedia.org/wiki/Sergio_Llorente

wow .. you made it that far ? 

Jokes aside .. why are you asking for a permission to get a domain ? I would 
love to read a deeper explanation what made you send an email to this mailing 
list. 


On Wed, Apr 14, 2021 at 03:41:37PM +0200, Rainyis wrote:

Hello,
I am Sergio Llorente, and I want to create a web about python. I
will publish apps, scripts.. made by python. I will like to put python in
the domain. The domain will be like all-about-python.com but in Spanish(
todosobrepython.com). Can I use it?

Thanks in advance,
Sergio
--
https://mail.python.org/mailman/listinfo/python-list


--
Daniel Ciprus  .:|:.:|:.
CONSULTING ENGINEER.CUSTOMER DELIVERY   Cisco Systems Inc.
dcip...@cisco.com
tel: +1-703-484-0205
mob: +1-540-223-7098



signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: convert script awk in python

2021-03-25 Thread Dan Ciprus (dciprus) via Python-list
... funny thing is that OP never contributed to this discussion. Several people 
provided very valuable inputs but OP did not even bother to say "thank you".


just saying ...

On Wed, Mar 24, 2021 at 11:22:02AM -0400, Avi Gross via Python-list wrote:

Cameron,

I agree with you. I first encountered AWK in 1982 when I went to work for
Bell Labs.

I have not had any reason to use AWK since before the year 2000 so I was not
sure that unused variables were initialized to zero. The code seemed to
assume that. I have learned quite a few languages since and after a while,
they tend to blend into each other.

I think it would indeed have been more AWKthonic (or should that be called
AWKward?) to have a BEGIN section in which functions were declared and
variables clearly initialized but the language does allow some quick and
dirty ways to do things and clearly the original programmer used some.

Which brings us back to languages like python. When I started using AWK and
a slew of other UNIX programs years ago, what I found interesting is how
much AWK was patterned a bit on the C language, not a surprise as the K in
AWK is Brian Kernighan who had a hand in C. But unlike C that made me wait
around as it compiled, AWK was a bit more of an interpreted language and I
could write one-liner shell scripts (well, stretched over a few lines if
needed) that did things. True, if you stuck an entire program in a BEGIN
statement and did not actually loop over data, it seems a tad wasteful. But
sometimes it was handy to use it to test out a bit of C code I was writing
without waiting for the whole compile thing. In a sense, it was  bit like
using the python REPL and getting raid feedback. Of course, when I was an
early adopter of C++, too many things were not in AWK!

What gets me is the original question which made it sound a bit like asking
how you would translate some fairly simple program from language A to
language B. For some fairly simple programs, the translation effort could be
minimal. There are often trivial mappings between similar constructs. Quite
a bit of python simply takes a block of code in another language that is
between curly braces, and lines it up indented below whatever it modifies
and after a colon. The reverse may be similarly trivial. There are of course
many such changes needed for some languages but when some novel twist is
used that the language does not directly support, you may need to innovate
or do a rewrite that avoids it. But still, except in complicated
expressions, you can rewrite x++ to "x += 1" if that is available or "x = x
+ 1" or "x -> x + 1" or whatever.

What gets me here is that AWK in his program  was being used exactly for
what it was designed. Python is more general-purpose. Had we been asked (not
on this forum) to convert that AWK script to PERL, it would have been much
more straightforward because PERL was also designed to be able to read in
lines and break them into parts and act on them. It has constructs like the
diamond operator or split that make it easy.

Hence, at the end, I suggested Tomasz may want to do his task not using just
basic python but some module others have already shared that emulates some
of the filter aspects of AWK. That may make it easier to just translate the
bits of code to python while largely leaving the logic in place, depending
on the module.

Just to go way off the rails, was our annoying cross-poster from a while
back also promising to include a language like AWK into their universal
translator by just saving some JSON descriptions?

-Original Message-
From: Python-list  On
Behalf Of Cameron Simpson
Sent: Tuesday, March 23, 2021 6:38 PM
To: Tomasz Rola 
Cc: Avi Gross via Python-list 
Subject: Re: convert script awk in python

On 23Mar2021 16:37, Tomasz Rola  wrote:

On Tue, Mar 23, 2021 at 10:40:01AM -0400, Avi Gross via Python-list wrote:
[...]

I am a tod concerned as to where any of the variables x, y or z have
been defined at this point. I have not seen a BEGIN {...}
pattern/action or anywhere these have been initialized but they are
set in a function that as far as I know has not been called. Weird.
Maybe awk is allowing an uninitialized variable to be tested for in
your code but if so, you need to be cautious how you do this in python.


As far as I can say, the type of uninitialised variable is groked from
the first operation on it. I.e., "count += 1" first initializes count
to 0 and then adds 1.

This might depend on exact awk being used. There were few of them
during last 30+ years. I just assume it does as I wrote above.


I'm pretty sure this behaviour's been there since very early times. I think
it was there when I learnt awk, decades ago.


Using BEGIN would be in better style, of course.


Aye. Always good to be up front about initial values.


There is a very nice book, "The AWK Programming Language" by Aho,
Kernighan and Weinberger. First printed in 1988, now free and in pdf
format. Go search.


Yes, a really nice book. [.

Re: How to loop over a text file (to remove tags and normalize) using Python

2021-03-09 Thread Dan Ciprus (dciprus) via Python-list

No problem, list just converts everything into plain/txt which is GREAT ! :-)

So without digging deeply into what you need to do: I am assuming that your 
input contains html tags. Why don't you utilize lib like: 
https://pypi.org/project/beautifulsoup4/ instead of doing harakiri with parsing 
data without using regex ? Just a hint ..


On Wed, Mar 10, 2021 at 04:22:19AM +0600, S Monzur wrote:

  Thank you and apologies! I did not realize how jumbled it was at the
  receiver's end. 
  The code is now at this site :  [1]https://pastebin.com/wSi2xzBh 
  I'm basically trying to do a few things with my code-

   1. Extract 3 strings from the text- title, date and main text

   2. Remove all tags afterwards

   3. Save in a dictionary, with three keys- title, date and bodytext.

   4. Remove punctuation and stopwords (I've used a user generated function
  for that).

  I've been able to do all of these steps for the file [2]ListFileReduced,
  as shown in the code (although it's clunky).

  But, I would like to be able to do it for the other text file: [3]ListFile
  which has more articles. I used BeautifulSoup to scrape the data from the
  website, and then generated a list that I saved as a text file. 

  Best,
  Monzur
  On Wed, Mar 10, 2021 at 4:00 AM Dan Ciprus (dciprus)
  <[4]dcip...@cisco.com> wrote:

If you could utilized pastebin or similar site to show your code, it
would help
tremendously since it's an unindented mess now and can not be read
easily.

On Wed, Mar 10, 2021 at 03:07:14AM +0600, S Monzur wrote:
>Dear List,
>
>Newbie here. I am trying to loop over a text file to remove html tags,
>punctuation marks, stopwords. I have already used Beautiful Soup
(Python v
>3.8.3) to scrape the text (newspaper articles) from the site. It
returns a
>list that I saved as a file. However, I am not sure how to use a loop
in
>order to process all the items in the text file.
>
>In the code below I have used listfilereduced.text(containing data from
one
>news article, link to listfilereduced.txt here

><[5]https://drive.google.com/file/d/1ojwN4u8cmh_nUoMJpdZ5ObaGW5URYYj3/view?usp=sharing>),
>however I would like to run this code on listfile.text(containing data
from
>multiple articles, link to listfile.text

><[6]https://drive.google.com/file/d/1V3s8w8a3NQvex91EdOhdC9rQtCAOElpm/view?usp=sharing>
>).
>
>
>Any help would be greatly appreciated!
>
>P.S. The text is in a Non-English script, but the tags are all in
English.
>
>
>#The code below is for a textfile containing just one item. I am not
sure
>how to tweak this to make it run for listfile.text (which contains raw
data
>from multiple articles) with open('listfilereduced.txt', 'r',
>encoding='utf8') as my_file: rawData = my_file.read() print(rawData)
>#Separating body text from other data articleStart = rawData.find("class=\"story-element story-element-text\">") articleData =
>rawData[:articleStart] articleBody = rawData[articleStart:]
>print(articleData) print("***") print(articleBody) print("***")
>#First, I define a function to strip tags from the body text def
>stripTags(pageContents): insideTag = 0 text = '' for char in
pageContents:
>if char == '<': insideTag = 1 elif (insideTag == 1 and char == '>'):
>insideTag = 0 elif insideTag == 1: continue else: text += char return
text
>#Calling the function articleBodyText = stripTags(articleBody)
>print(articleBodyText) ##Isolating article title and publication date
>TitleEndLoc = articleData.find("") dateStartLoc =
>articleData.find("class=\"storyPageMetaData-m__publish-time__19bdV\">")
>dateEndLoc=articleData.find("storyPageMetaDataIcons-m__icons__3E4Xg\">") titleString =
>articleData[:TitleEndLoc] dateString =
articleData[dateStartLoc:dateEndLoc]
>##Call stripTags to clean articleTitle= stripTags(titleString)
articleDate
>= stripTags(dateString) print(articleTitle) print(articleDate)
#Cleaning
>the date a bit more startLocDate = articleDate.find(":") endLocDate =
>articleDate.find(",") articleDateClean =
>articleDate[startLocDate+2:endLocDate] print(articleDateClean) #save
all
>this data to a dictionary that saves the title, data and the body text
>PAloTextDict = {"Title": articleTitle, "Date": articleDateClean,
"Text":
>articleBodyText} print(PAloTextDict) #Normalize text by: #1. Splitting
>paragraphs of text into lists of words articleBodyWordList =
>articleBodyText.split() print(articleBodyWordList) #2.Removing
punctuation
>and stopwords from bnlp.corpus import stopwords, punctuations #A.
Remove
>punctuation first listNoPunct = [] for word in articleBodyWordList: for
>mark in punctuations: word=word.replace(mark, '')
listNoPunct.append(word)
>print(listNoPunct) #B. removing stopwords banglastopwor

Re: How to loop over a text file (to remove tags and normalize) using Python

2021-03-09 Thread Dan Ciprus (dciprus) via Python-list
If you could utilized pastebin or similar site to show your code, it would help 
tremendously since it's an unindented mess now and can not be read easily.


On Wed, Mar 10, 2021 at 03:07:14AM +0600, S Monzur wrote:

Dear List,

Newbie here. I am trying to loop over a text file to remove html tags,
punctuation marks, stopwords. I have already used Beautiful Soup (Python v
3.8.3) to scrape the text (newspaper articles) from the site. It returns a
list that I saved as a file. However, I am not sure how to use a loop in
order to process all the items in the text file.

In the code below I have used listfilereduced.text(containing data from one
news article, link to listfilereduced.txt here
),
however I would like to run this code on listfile.text(containing data from
multiple articles, link to listfile.text

).


Any help would be greatly appreciated!

P.S. The text is in a Non-English script, but the tags are all in English.


#The code below is for a textfile containing just one item. I am not sure
how to tweak this to make it run for listfile.text (which contains raw data
from multiple articles) with open('listfilereduced.txt', 'r',
encoding='utf8') as my_file: rawData = my_file.read() print(rawData)
#Separating body text from other data articleStart = rawData.find("") articleData =
rawData[:articleStart] articleBody = rawData[articleStart:]
print(articleData) print("***") print(articleBody) print("***")
#First, I define a function to strip tags from the body text def
stripTags(pageContents): insideTag = 0 text = '' for char in pageContents:
if char == '<': insideTag = 1 elif (insideTag == 1 and char == '>'):
insideTag = 0 elif insideTag == 1: continue else: text += char return text
#Calling the function articleBodyText = stripTags(articleBody)
print(articleBodyText) ##Isolating article title and publication date
TitleEndLoc = articleData.find("") dateStartLoc =
articleData.find("")
dateEndLoc=articleData.find("") titleString =
articleData[:TitleEndLoc] dateString = articleData[dateStartLoc:dateEndLoc]
##Call stripTags to clean articleTitle= stripTags(titleString) articleDate
= stripTags(dateString) print(articleTitle) print(articleDate) #Cleaning
the date a bit more startLocDate = articleDate.find(":") endLocDate =
articleDate.find(",") articleDateClean =
articleDate[startLocDate+2:endLocDate] print(articleDateClean) #save all
this data to a dictionary that saves the title, data and the body text
PAloTextDict = {"Title": articleTitle, "Date": articleDateClean, "Text":
articleBodyText} print(PAloTextDict) #Normalize text by: #1. Splitting
paragraphs of text into lists of words articleBodyWordList =
articleBodyText.split() print(articleBodyWordList) #2.Removing punctuation
and stopwords from bnlp.corpus import stopwords, punctuations #A. Remove
punctuation first listNoPunct = [] for word in articleBodyWordList: for
mark in punctuations: word=word.replace(mark, '') listNoPunct.append(word)
print(listNoPunct) #B. removing stopwords banglastopwords = stopwords()
print(banglastopwords) cleanList=[] for word in listNoPunct: if word in
banglastopwords: continue else: cleanList.append(word) print(cleanList)
--
https://mail.python.org/mailman/listinfo/python-list


--

Daniel Ciprus  .:|:.:|:.
CONSULTING ENGINEER.CUSTOMER DELIVERY   Cisco Systems Inc.

dcip...@cisco.com

tel: +1 703 484 0205
mob: +1 540 223 7098



signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Startup failure

2021-02-19 Thread Dan Ciprus (dciprus) via Python-list
It would be nice if you could provide a bit more details ... Exceptions/logs 
etc.




From: Python-list  on behalf 
of Smit Patel 
Sent: Friday, February 19, 2021 1:27 AM
To: python-list@python.org
Subject: Startup failure

I recently downloaded python from your website and when I started using it,
it worked correctly but when I installed the random2 module it showed
startup failure and won't work again.
So, I uninstalled it and downloaded it again but it is showing the same
problem of startup failure.

Let me know if there is a way to resolve the problem.
Thank you
--
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list