Advanced Scientific Programming in Python
=
a Summer School by the G-Node, the Bernstein Center for Computational
Neuroscience Munich and the Graduate School of Systemic Neurosciences
Scientists spend more and more time writing, maintaining, and debugging
I've just released version 0.2.0 of distlib on PyPI [1]. For newcomers,
distlib is a library of packaging functionality which is intended to be
usable as the basis for third-party packaging tools.
The main changes in this release are as follows:
Updated match_hostname to use the latest
I have an vps ,my local pc is in the local area network. When paramiko
installed on my local pc ,i can get file from my vps.
import paramiko
t = paramiko.Transport((vps ip,22))
t.connect(username = username, password = key)
sftp = paramiko.SFTPClient.from_transport(t)
remotepath='/tmp/test.txt'
Hi,
Abubakar Roko schrieb am 17.12.2014 um 07:30:
Please I am new in using python to write program. I am trying to parse an XML
document using sax parse and store the parsed result in a tree like
definedbelow. XNode class define an xml element which has an ID , a tag, a
text value,
Dumped uwsgi - the documentation is utterly ridculous!!
Switched to 'Bottle' - very nice, intutive and clean -
tutorial+documentation is excellent and i got 'hello world' up and running
in like 10-15 minutes vs the 2 days intermittent it took to scroll through
the crap that is uwsgi-server.
Hello guys,
I have a question about delegation coding pattern(I'm working with Python
3.4).
In order to describe my question , I'll provide particular example:
Let assume I have two classes written in module named person.py:
Case 1:
class Person:
def __init__(self, name, job = None,
smtplib.SMTPRecipientsRefused: {'aahlin!@gmail.com': (550, 'restricted
characters in address')}
As in this question, the answer has reference to RFCs that spec it out, and
state that exclamations are ok, so why is smptplib throwint this error?
On Tue, Dec 16, 2014 at 11:30 PM, Abubakar Roko
abr...@yahoo.com.dmarc.invalid wrote:
Good day,
Please I am new in using python to write program. I am trying to parse an
XML document using sax parse and store the parsed result in a tree like
defined
below. XNode class define an xml element
Hi,
On Wed, Dec 17, 2014 at 08:16:23AM -0800, radzh...@gmail.com wrote:
smtplib.SMTPRecipientsRefused: {'aahlin!@gmail.com': (550, 'restricted
characters in address')}
As in this question, the answer has reference to RFCs that spec it out, and
state that exclamations are ok, so why is
It strikes me as oddly dangerous that signal.signal() accepts callable handlers
of the wrong arity:
def timeout_cleanup():
...
signal.signal(signal.SIGALRM, timeout_cleanup) # I desire a TypeError
here
signal.alarm(PROCESS_TIMEOUT)
... time passes ...
thanks i'll try that, I can also telnet on the server and see what I get if I
use that recipient. I'm using exim, not sure why it would have that restriction
--
https://mail.python.org/mailman/listinfo/python-list
thanks i'll try that, I can also telnet on the server and see what I get if I
use that recipient. I'm using exim, not sure why it would have that restriction
--
https://mail.python.org/mailman/listinfo/python-list
No need to do more troubleshooting, need to update the config. Found that exim
default config denies these so nothing to do with smptlib indeed:
What this statement is doing is to accept unconditionally all recipients in
messages that are submitted by SMTP from local processes using the
Its all in here for those using exim4
http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_default_configuration_file.html
I went into /etc/exim4 and ran this command to find where the deny message is
stored, which lead me to the regex variable CHECK_RCPT_LOCAL_LOCALPARTS. So I
I know about the schedule modules and such but they work in situations like
'run this in a X hours/minutes/seconds interval', I already have my code in
a while loop with sleep (it's a bit ugly, I'l change to a scheduler soon).
What I really want is, for example:
24/7/365
9:00 AM - Start
11:59 PM
In mailman.17010.1418843457.18130.python-l...@python.org Juan Christian
juan0christ...@gmail.com writes:
--047d7b874b2c1e67eb050a6e3cc4
Content-Type: text/plain; charset=UTF-8
I know about the schedule modules and such but they work in situations like
'run this in a X hours/minutes/seconds
I've just released version 0.2.0 of distlib on PyPI [1]. For newcomers,
distlib is a library of packaging functionality which is intended to be
usable as the basis for third-party packaging tools.
The main changes in this release are as follows:
Updated match_hostname to use the latest
On Wed Dec 17 2014 at 5:45:31 PM John Gordon gor...@panix.com wrote:
You could write a separate program whose only job is to send a STOP or
CONTINUE signal to your main program, and then run that program from a
scheduler.
The standard system kill command would probably work for this purpose,
Ops, sorry.
It's: 9:00 AM ~ 11:59 PM - Running
... and not 9:00 AM ~ 11:50 PM - Running
--
https://mail.python.org/mailman/listinfo/python-list
Ok, trying simple code from a pygame tutorial snippet - nothing happens - just
silent, but with no errors being returned:
# play a sound to the left, to the right and to the center
# import the time standard module
import time
# import the pygame module
import pygame
# start pygame
In mailman.17012.1418845926.18130.python-l...@python.org Juan Christian
juan0christ...@gmail.com writes:
The standard system kill command would probably work for this purpose,
assuming you have access to your main program's process ID.
There isn't any 'prettier' way? Such as a built-in or
On Wed Dec 17 2014 at 6:25:39 PM John Gordon gor...@panix.com wrote:
If you want to solve your problem entirely within Python, look at the
scheduler module. (Although even this isn't a complete solution, as you
still have to make sure the program is running in the first place...)
My script is
Radomir Wojcik wrote:
No need to do more troubleshooting, need to update the config. Found that
exim default config denies these so nothing to do with smptlib indeed:
What this statement is doing is to accept unconditionally all recipients in
messages that are submitted by SMTP from local
On Thu, Dec 18, 2014 at 7:42 AM, Juan Christian
juan0christ...@gmail.com wrote:
Is there any kind of time calculation in Python that counts the time like 0,
1, 2, 3... so that 0AM would be 0, and 11:59PM would be let's say
'64562'? And everyday it gets a reset when the clock 'turns'?
On Wed Dec 17 2014 at 7:35:10 PM Chris Angelico ros...@gmail.com wrote:
time.time() % 86400
That's number of seconds since midnight UTC, ranging from 0 up to
86399. (I've no idea what 64562 would mean. That's an awfully big
number for a single day.) If you offset that before calculating, you
On Thu, Dec 18, 2014 at 7:59 AM, Michael Ströder mich...@stroeder.com wrote:
You should really think about why these chars were excluded in the
configuration: The reason is that those they are special in shells.
And many SMTP deployments have pretty naive (shell) scripts or software with
Hi Juan,
I don't know what platform you're on, but you've got several options.
Mac: setup a launchd job, I use http://www.soma-zone.com/LaunchControl/ to do
the setups
Linux/unix: setup a cron job, depending on your distro launchd may also be an
option.
Windows: setup a scheduled job in
Juan Christian wrote:
I know about the schedule modules and such but they work in situations
like 'run this in a X hours/minutes/seconds interval', I already have my
code in a while loop with sleep (it's a bit ugly, I'l change to a
scheduler soon).
[...]
I want my script to start at a given
Hi,
I found your Python group on Google+ and I'm searching for someone with 3+
years of Python development experience for a full-time position in California.
Salary north of $100K and working for an amazing company. Ideally I'd like to
find someone who is nice, plugged into the movie and
On Wed Dec 17 2014 at 9:40:52 PM Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
Juan Christian wrote:
I know about the schedule modules and such but they work in situations
like 'run this in a X hours/minutes/seconds interval', I already have my
code in a while loop with
I have many machines on which the following command returns nothing (but does
not throw an error as well
python -c 'import socket; socket.gethostbyname(socket.getfqdn())'
but on just one machine. this command throws
Traceback (most recent call last):
File string, line 1, in module
On Thu, Dec 18, 2014 at 2:21 PM, abhis...@gmail.com wrote:
I have many machines on which the following command returns nothing (but does
not throw an error as well
python -c 'import socket; socket.gethostbyname(socket.getfqdn())'
but on just one machine. this command throws
Traceback
I was able to resolve the issue.
since you said that there is nothing wrong with python as such... and its a
networking issue.
I deleted the network adapter of my vm and then re-created it.
now suddenly it began to work. funny!
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, Dec 18, 2014 at 3:26 PM, Abhishek Srivastava abhis...@gmail.com wrote:
I was able to resolve the issue.
since you said that there is nothing wrong with python as such... and its a
networking issue.
I deleted the network adapter of my vm and then re-created it.
now suddenly it
Ivan Evstegneev webmailgro...@gmail.com writes:
I have a question about delegation coding pattern(I'm working with Python
3.4).
Unlike Java, Python supports multiple inheritance. This means
that you need delegation much more rarely in Python.
Python does not have much special support for
Saimadhav Heblikar added the comment:
ZoomHeight behavior on linux is as what you mentioned. Now I have understood
this issue. Working on it.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22706
Changes by Serhiy Storchaka storch...@gmail.com:
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15513
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
stage: - needs patch
type: - enhancement
versions: +Python 2.7, Python 3.5 -Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19548
Nick Coghlan added the comment:
Perhaps an API like importlib.util.locks_held() that returns a list of module
names?
We'd then just iterate over the _module_locks() dictionary, looking for locks
where the owner matched the current thread id (alternatively, if speed was
critical for Guido's
Martin Panter added the comment:
RFC 1521 says that a text newline should be encoded as CRLF, and that any
combination of 0x0D and 0x0A bytes that do not represent newlines should be
encoded like other control characters as =0D and =0A.
Since in Python 3 the codec outputs bytes, I don’t think
Gustavo Frederico Temple Pedrosa added the comment:
ping
--
nosy: +gustavotemple
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22038
___
___
Marc-Andre Lemburg added the comment:
I agree with Vajrasky: a patch for the documentation would probably be a good
idea.
Note that mixing line end conventions in a single text is never a good idea. If
you stick to one line end convention, there's no problem with the codec, AFAICT.
Changes by Trent Nelson tr...@snakebite.org:
--
nosy: +trent
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22919
___
___
Python-bugs-list mailing
Roundup Robot added the comment:
New changeset 81c73f964066 by Berker Peksag in branch '3.4':
Issue #23070: Fix a comment in the tutorial.
https://hg.python.org/cpython/rev/81c73f964066
New changeset 81e2f58d9e4b by Berker Peksag in branch 'default':
Issue #23070: Fix a comment in the tutorial.
Roundup Robot added the comment:
New changeset 8cd84e62c1fd by Berker Peksag in branch '2.7':
Issue #23070: Fix a comment in the tutorial.
https://hg.python.org/cpython/rev/8cd84e62c1fd
--
___
Python tracker rep...@bugs.python.org
Berker Peksag added the comment:
Fixed. Thanks for the report, Ross.
--
nosy: +berker.peksag
resolution: - fixed
stage: - resolved
status: open - closed
type: - behavior
versions: +Python 2.7, Python 3.5
___
Python tracker rep...@bugs.python.org
Roundup Robot added the comment:
New changeset 4c81b1846e14 by Steve Dower in branch 'default':
Issue #22733: MSVC ffi_prep_args doesn't handle 64-bit arguments properly
https://hg.python.org/cpython/rev/4c81b1846e14
--
nosy: +python-dev
___
Python
Eric Snow added the comment:
(Unless I've missed something, we don't run user code with the global
import lock held any more)
Ah. You are correct.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23068
Roundup Robot added the comment:
New changeset 24f4569a1308 by Steve Dower in branch 'default':
Issue #22733: Added NEWS item
https://hg.python.org/cpython/rev/24f4569a1308
--
___
Python tracker rep...@bugs.python.org
Roundup Robot added the comment:
New changeset 1794d754ff3c by Steve Dower in branch 'default':
Issue #23060: Suppresses a multiprocessing assert that fails incorrectly
https://hg.python.org/cpython/rev/1794d754ff3c
--
nosy: +python-dev
___
Python
Changes by Steve Dower steve.do...@microsoft.com:
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22733
___
Steve Dower added the comment:
I've commented out the assertion for now with a comment pointing to this issue,
so that'll keep the buildbots running while we figure out how to deal with this
properly.
--
___
Python tracker rep...@bugs.python.org
Steve Dower added the comment:
When you say 2.7.X, which version are you installing and which version did
you have installed?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23065
___
Guido van Rossum added the comment:
Oh. I'd forgotten the PY3 situation is completely different from the PY2
situation. We're still stuck here in PY2 land where there's just the one
import lock. I guess not even ctypes can help us find out whether the
current thread is holding the import lock
Wes Turner added the comment:
* Macros could be useful.
* Would this make it easy/faster to also have a DefaultOrderedDict (which
can/could also be accomplished with .get(attr, []) and .setdefault(attr, [])?
* There may be some value in looking at
https://pypi.python.org/pypi/cyordereddict
*
Martin Panter added the comment:
Okay so maybe the documentation should include these restrictions on encoding:
* The data being encoded should only include \r or \n bytes that are part of \n
or \r\n newline sequences. Encoding arbitrary non-text data is not supported.
* The two kinds of
Serhiy Storchaka added the comment:
Pure Python implementation returns different result.
import quopri
quopri.encodestring(b'\r\n')
b'\r\n'
quopri.a2b_qp = quopri.b2a_qp = None
quopri.encodestring(b'\r\n')
b'=0D\n'
See also issue18022.
--
nosy: +serhiy.storchaka
Eric Snow added the comment:
Suggestions from Antoine on python-dev:
* do not make cOrderedDict builtin; drop changes to:
- Include/Python.h
- Objects/object.c
- Makefile.pre.in
* do not add a C-API
* include the linked list pointers in the hash entries? (may simplify things)
* drop the
New submission from bbc:
The documentation page for the cmd module contains an example with the turtle
module:
https://docs.python.org/3.4/library/cmd.html#cmd-example
It seems like the turtle module has changed quite a bit since the code was
written, and exposes a Pen class instead of all
New submission from STINNER Victor:
Spinoff of the issue #22926: asyncio.get_event_loop() must always raise an
exception, even when assertions are disabled by -O.
Attached patch implements this suggestion.
--
components: asyncio
files: get_event_loop.patch
keywords: patch
messages:
Nick Coghlan added the comment:
Looking at the implementation of PyImport_ImportModuleNoBlock, you should be
able to invoke that via ctypes with a nonsense module name to probe for whether
or not the current thread has the import lock.
A call like
Nick Coghlan added the comment:
You'd still need to check lock_held() to see if *some* thread is holding the
import lock. The non-blocking import API should then let you determine if that
thread is the current one.
--
___
Python tracker
STINNER Victor added the comment:
Guido So in order to do correct diagnostics here we would have to add an
owning
thread pointer to every event loop;
I didn't understand why this approach was not taken when the check was
introduced. I was surprised that get_event_loop() was used for the check
Ethan Furman added the comment:
Please do! Working examples are better than non-working ones. :)
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23073
___
Ethan Furman added the comment:
While you're at it, could you also sign the contributors' license agreement?
https://www.python.org/psf/contrib/contrib-form/
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23073
STINNER Victor added the comment:
Fedora 20 provides GCC 4.7 but no stdatomic.c: HAVE_BUILTIN_ATOMIC set
(HAVE_STD_ATOMIC unset).
Fedora 21 provides GCC 4.9 with stdatomic.c: HAVE_BUILTIN_ATOMIC and
HAVE_STD_ATOMIC are set.
I tested atomicv2.patch on Fedora 20 (x86_64) and Fedora 21
Guido van Rossum added the comment:
Interesting. The Dropbox server team thanks you for the suggestion!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23068
___
New submission from Alex Gaynor:
Whether __builtins__ is a module or a dict is undefined in CPython. Use the
reliably well defined `import __builtin__` instead.
--
components: Library (Lib)
files: mock-backport.diff
keywords: patch
messages: 232838
nosy: alex, benjamin.peterson,
STINNER Victor added the comment:
atomicv2.patch:
_Atomic int _value;
Why not using the atomic_int type from stdatomic.h here?
https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html
__atomic_store_n(): The valid memory model variants are __ATOMIC_RELAXED,
__ATOMIC_SEQ_CST, and
STINNER Victor added the comment:
It would be backwards incompatible to change, though.
I'm in favor of breaking the compatibility with Python 3.4 and return the
format as an Unicode string.
--
nosy: +haypo
___
Python tracker
Changes by STINNER Victor victor.stin...@gmail.com:
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21619
___
___
Python-bugs-list
New submission from Antony Lee:
glob.glob returns an empty list when passed an empty pattern as argument, but
pathlib's Path.glob fails with IndexError. The first option seems more
reasonable (or at least it should be a ValueError).
--
components: Library (Lib)
messages: 232841
nosy:
New submission from Nick Coghlan:
As per python-dev discussion [1], filing this as the home for a proposed update
to PEP 1 that allows Standards Track PEPs to be granted Provisional status
before moving on to Accepted/Final.
The new status will be for PEPs where we want to release an initial
Martin Panter added the comment:
I originally assumed it would be a text string from the existing documentation,
so changing the behaviour to match also seems reasonable
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21071
Roundup Robot added the comment:
New changeset b4dce0e695df by Victor Stinner in branch '3.4':
Issue #23074: asyncio.get_event_loop() now raises an exception if the thread
https://hg.python.org/cpython/rev/b4dce0e695df
--
nosy: +python-dev
___
Python
STINNER Victor added the comment:
Change applied to Python 3.4, 3.5 and Tulip (c6115bc83acc).
Thanks for the review Guido.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23074
STINNER Victor added the comment:
I also updated aiotest test suite:
https://bitbucket.org/haypo/aiotest/commits/d6f544a16a8f55729268d8d4b8d864d1b0af2d12
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23074
bbc added the comment:
It turns out the script is fine. I could have investigated it more thoroughly
at first if I had more carefully read the docs for turtle.
I thought those functions were not exposed because they were reportedly not
found after I copy-pasted, executed the example script
Ethan Furman added the comment:
No worries, thanks for following up.
--
resolution: - not a bug
stage: - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23073
Martin Panter added the comment:
Here is a patch addressing many of the points raised. Please have a look and
give any feedback. Beware I am not very familiar with the Restructured Text
markup and haven’t tried compiling it.
1. Mentioned bytes-to-bytes and text-to-text in general right at the
Martin Panter added the comment:
The “unicode-escape” and “utf-7” cases affect the more widely-used
TextIOWrapper interface:
TextIOWrapper(BytesIO(br\u2013 * 2000), unicode-escape).read(1)
Traceback (most recent call last):
File stdin, line 1, in module
File
Martin Panter added the comment:
I included the proposed doc fix in my patch for Issue 19548
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19539
___
Changes by Berker Peksag berker.pek...@gmail.com:
--
nosy: +berker.peksag
stage: needs patch - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19548
___
Martin Panter added the comment:
Here is the patch (against the default branch)
--
keywords: +patch
Added file: http://bugs.python.org/file37486/codecs-all.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23071
Martin Panter added the comment:
Patch looks sensible enough to me
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23062
___
___
Python-bugs-list
Berker Peksag added the comment:
Thanks! Could you also add a test? See PublicAPITests in
Lib/test/test_shutil.py as an example.
--
stage: needs patch - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23071
Martin Panter added the comment:
Here is a new patch based on John’s suggestion
--
Added file: http://bugs.python.org/file37487/issue21279.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21279
liu chang added the comment:
In[6]: pathlib.Path.glob()
Traceback (most recent call last):
File
/home/liuchang/ENV3/lib/python3.4/site-packages/IPython/core/interactiveshell.py,
line 2883, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File ipython-input-6-a6dcf250fe73,
Martin Panter added the comment:
Here is a patch that changes over to a str() type.
Is it safe to assume PyUnicode_AsUTF8() is null-terminated (like
PyBytes_AS_STRING() is)? My documentation doesn’t say.
--
Added file: http://bugs.python.org/file37488/format-str.patch
Martin Panter added the comment:
Assuming it is intended to support byte strings, here is a patch that documents
them being allowed, and adds a test case
--
keywords: +patch
Added file: http://bugs.python.org/file37489/format-bytes.patch
___
Python
GamesGamble added the comment:
2.7.7 was installed and I has installed 2.7.8 and 2.7.8 was installed and then
I has installed 2.7.9.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23065
Martin Panter added the comment:
Here is another patch that removes the method instead, as suggested in the
review
--
Added file: http://bugs.python.org/file37490/doctype-remove.patch
___
Python tracker rep...@bugs.python.org
Martin Panter added the comment:
This patch includes a new test; although this kind of testing won’t detect when
someone adds a new API and forgets to add it to __all__.
--
Added file: http://bugs.python.org/file37491/codecs-all.patch
___
Python
Arfrever Frehtes Taifersar Arahesis added the comment:
doctype-remove.patch is acceptable for both 3.4 and 3.5 or only 3.5?
If only 3.5, then please apply inherit-doctype.patch in 3.4.
--
___
Python tracker rep...@bugs.python.org
94 matches
Mail list logo