how to generate a standard email form by default OS mail client?

2019-07-30 Thread dmitrey15
Hello,

is Python capable of generating a email form (from standard data - address, 
topic, string message) with raising it by a default OS email client, e.g. 
Thunderbird? User would like to have a possibility to review/modify email 
content inside the OS email client window before sending it.

Raising gmail.com GUI form also could be a solution.

Thank you in advance, D.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to generate a standard email form by default OS mail client?

2019-07-30 Thread Thomas Jollans
On 30/07/2019 10.06, [email protected] wrote:
> Hello,
>
> is Python capable of generating a email form (from standard data - address, 
> topic, string message) with raising it by a default OS email client, e.g. 
> Thunderbird? User would like to have a possibility to review/modify email 
> content inside the OS email client window before sending it.
>
> Raising gmail.com GUI form also could be a solution.
>
> Thank you in advance, D.

You could construct a mailto URI

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

 subject = 'This is the subject'
>>> body = 'This is the text'
>>> to = '[email protected]'
>>> cc = '[email protected]'
>> mailto_url = urllib.parse.quote(f'mailto:{to}?') +
urllib.parse.urlencode({'cc': cc, 'subject': subject, 'body': body},
quote_via=urllib.parse.quote)

If you open that URI with the webbrowser module, it should work. Well,
it might. On my system, Chrome refuses to open a mailto URI like this,
but Firefox plays along.

The better option would be to call the mail program directly (such as
using the subprocess module), but how you find out what to call will
depend on your OS. If this is just for one PC and you use Thunderbird,
then you might as well hard-code the Thunderbird executable, of course...



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


Xml File Error

2019-07-30 Thread Dipangi Shah
Hi,

import os from xml.etree import ElementTree
file_name = 'Users.xml' full_file = os.path.abspath(os.path.join('data',
file_name)) print(full_file) with above code, path is successfully printed
as "C:\Users\Evosys\PycharmProjects\Python Level1\data\Users.xml" but when
I add below 2 lines, there is an error saying "FileNotFoundError: [Errno 2]
No such file or directory: 'C:\\Users\\Evosys\\PycharmProjects\\Python
Level1\\data\\Users.xml' dom = ElementTree.parse(full_file,None) print(dom) Can
you suggest to me why I am facing the error?

-- 
Regards,

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


RE: Xml File Error

2019-07-30 Thread David Raymond
Is that the correct path to the file, without any typos?

os.path.abspath and os.path.join don't do any checking on whether their 
resulting path exists. So if there is a typo or error in your path it doesn't 
get reported until you actually try and open it by running ElementTree.parse

You can check if your path is ok using either os.path.exists() or 
os.path.isfile() before trying to actually open it to see if it is already 
there.



-Original Message-
From: Python-list  On 
Behalf Of Dipangi Shah
Sent: Tuesday, July 30, 2019 3:20 AM
To: [email protected]
Subject: Xml File Error

Hi,

import os from xml.etree import ElementTree
file_name = 'Users.xml' full_file = os.path.abspath(os.path.join('data',
file_name)) print(full_file) with above code, path is successfully printed
as "C:\Users\Evosys\PycharmProjects\Python Level1\data\Users.xml" but when
I add below 2 lines, there is an error saying "FileNotFoundError: [Errno 2]
No such file or directory: 'C:\\Users\\Evosys\\PycharmProjects\\Python
Level1\\data\\Users.xml' dom = ElementTree.parse(full_file,None) print(dom) Can
you suggest to me why I am facing the error?

-- 
Regards,

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


Modify setup

2019-07-30 Thread Steven via Python-list
Good morning,

I have uninstalled and reinstalled different versions of Python, and continue 
to get the "modify setup" box when I try to open.

Is there something I'm doing wrong?

Sent from ProtonMail mobile
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Modify setup

2019-07-30 Thread MRAB

On 2019-07-30 18:20, Steven via Python-list wrote:

Good morning,

I have uninstalled and reinstalled different versions of Python, and continue to get the 
"modify setup" box when I try to open.

Is there something I'm doing wrong?

Try to open what? It sounds to me like you're just running the installer 
again. The installer is just that, the _installer_.

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


Re: .python_history file

2019-07-30 Thread teXture
> IMHO, this is a rather niche use case. And I suppose you could
> relatively easily implement it yourself with a site hook that adds
> magic
> comments to ~/.pyhistory as you suggest. If you want this
> functionality,
> there's no need for it to be part of Python itself.
> 
> FWIW, IPython, as far as I can tell, already saves some timestamp
> information in its history file.
> 
> -- Thomas
Hy Thomas, 
where i can find info on how python writes te history file?
Thanks.

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


ANN: Austin -- CPython frame stack sampler 0.7.0

2019-07-30 Thread Gabriele
I am delighted to announce the release 0.7.0 of Austin. If you haven't 
heard of Austin before, it is a frame stack sampler for CPython. It can 
be used to obtain statistical profiling data out of a running Python 
application without a single line of instrumentation. This means that you 
can start profiling a Python application straightaway, even while it's 
running on a production environment, with minimal impact on performance.

The simplest way of using Austin is by piping its output to FlameGraph 
for a quick and detailed representation of the collected samples. The 
latest release introduces a memory profiling mode which allows you to 
profile memory usage.

Austin is a pure C application that has no other dependencies other than 
the C standard library. Its source code is hosted on GitHub at

https://github.com/P403n1x87/austin

The README contains installation and usage details, as well as some 
examples of Austin in action. Details on how to contribute to Austin's 
development can be found at the bottom of the page.

I hope that you can find Austin useful!

All the best,
Gabriele
-- 
https://mail.python.org/mailman/listinfo/python-list