> On 20 Jul 2020, at 16:31, Jonathan Gossage wrote:
>
> I have the following code and I would like to type the variable *contents*:
>
> contents: something = importlib._import_module(name)
>
>
> I have been unable to find out what *something* should be.
types.ModuleType
>
> --
> Jonatha
On 3/31/20 8:00 PM, Dieter Maurer wrote:
Stephan Lukits wrote at 2020-3-31 17:44 +0300:
background:
- a daemon creates package p1 (e.g. directory with __init__.py-file) and
in p1 a module m1 is created.
- Then the daemon wants to import from m1, which functions (so far all
the time
On 3/31/20 9:01 PM, Pieter van Oostrum wrote:
"Dieter Maurer" writes:
Stephan Lukits wrote at 2020-3-31 17:44 +0300:
background:
- a daemon creates package p1 (e.g. directory with __init__.py-file) and
in p1 a module m1 is created.
- Then the daemon wants to import from
Hello,
background:
- a daemon creates package p1 (e.g. directory with __init__.py-file) and
in p1 a module m1 is created.
- Then the daemon wants to import from m1, which functions (so far all
the time).
- Then a module m2 is created in p1 and the daemon wants to import from
m2 which fail
ps://github.com/danthedeckie/simpleeval
Might be a good starting point.
Greetings Stephan
--
https://mail.python.org/mailman/listinfo/python-list
l you call ’.Test.py’
In the second call you call ’test.py’
“supprocess” doesn’t exist
How about
subprocess.call(‘\.Test.py’)
Or
subprocess.call([‘\.Test.py’])
Whereas the later makes more sense if you want to pass arguments to Test.py
Greetings Stephan
--
https://mail.python.org/mailman/listinfo/python-list
(The same reason is also why most shells such as bash, zsh, don't bother
with posix_spawn.)
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
Op 2018-07-25, Ian Kelly schreef :
> Is there a reason for using singledispatch here rather than a simpler and
> more readable "if color is None" check?
Yes, the other 20 cases I didn't show.
And extensibility.
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
actual code I have:
@singledispatch
def as_color(color):
"""Convert object to QColor."""
return QtGui.QColor(color)
as_color.register(type(None), lambda x: QtGui.QColor(0, 0, 0, 0))
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
icts.
An alternative is to install Python yourself (from source, without the package
manager) in, say, /opt/python. You are then in splendid isolation from
the package manager and can install any version of Python and tensorflow
you desire.
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
of 1000's of files, and it runs
> often, so it needs to run very fast. Needless to say, my change has
> made it take 2x as long.
It's not at all obvious to me. Did you actually measure it?
Seems to depend strongly on what stuff1a and stuff2a are doing.
> Can anyone see a way t
I have used a strategy of starting with 10 ms and then,
on no event, slowly back off to polling every 200ms).
It is by far the simplest solution, and AFAIK the only one which will
work with the standard Python distribution + Tkinter.
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
the Tk widget set (Python 3.5)
py36-tkinter-3.6.2_6 Python bindings to the Tk widget set (Python 3.6)
pypy-tkinter-5.8.0 PyPy bindings to the Tk widget set
and for sure installing py36-tkinter-3.6.2_6 works fine.
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
o installed and Docker started working. I've read that
> all the cool programming kids are using Docker these days. I certainly
> hope it was worth the cost. O_o
You could have just used a Linux VM in Virtualbox for $0, and run Docker
in that.
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
e for reading, the input file may be the concatenation
of multiple separate compressed streams. These are transparently decoded
as a single logical stream."
This seems to open the possibility to simply divide your input into,
say, 100 MB blocks, compress each of them in a separate thread
p",), stdin=subprocess.PIPE, stdout=f)
sp.stdin.write(b"Hello, world\n")
sp.stdin.close()
Does compression in a separate process ;-)
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
the moment I wouldn't bother to support anything lower than
3.4. That means testing 3.4, 3.5 and 3.6 (and 3.7 prerelease if
you want to be thorough).
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
te that the remark from Steve is on the topic of descriptors.
I suppose the first advice to anybody wanting to learn about
either descriptors or decorators is to not confuse them
with the other thing.
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
ly an official type, but loosely speaking these
are any functions which can be applied meaningfully with a single
function or class as argument. Some very mundane functions can be
(ab)used as decorators.
In [1]: @repr
...: def hello():
...: pass
...:
In [2]: hello
Out[2]:
Op 2017-09-30, Marko Rauhamaa schreef :
> Robert L. is only trolling. He uses fake technical comments to spread
> white supremacy in his signatures.
My apologies.
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
Op 2017-09-27, Robert L. schreef :
>> > (defun myloop (initial final increment)
>> > (loop for i = initial then (+ i increment)
>> > while (< i final)
>> > do (print i)
>> > finally (let ((i final)) (print i
>> >
> In Python?
myloop = lambda *args: print("{}{}".forma
Op 2017-09-27, Robert L. schreef :
> (sequence-fold + 0 #(2 3 4))
> ===>
> 9
>
> In Python?
>>> sum([2, 3, 4])
9
--
https://mail.python.org/mailman/listinfo/python-list
Help on _Helper in module _sitebuiltins object:
class _Helper(builtins.object)
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
ses on an instance.
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
by value" is almost
always contrasted with "call by name" (nobody seems to have ever
published a paper discussing "call by reference").
Typically, this comparison is done in calculi which even lack
assignment so that the difference between call by value and call by
reference would be unobservable anyway.
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
arge images or attachments?
>>
>> Thanks!
>>
>> Leam
>
> https://stackoverflow.com/questions/29586520/can-one-get-hierarchical-graphs-from-networkx-with-python-3#29597209
For direct inclusion in source code, what about plain text with
Unicode box drawing characters?
┏━━┓
┃ob
Op 2017-09-22, Irmen de Jong schreef :
> On 09/22/2017 08:34 PM, Stephan Houben wrote:
>
>> I was vaguely tempted to offer the Mingw-w64 (GCC) Python as an
>> alternative, since it doesn't rely on any optionally-installed Microsoft
>> DLLs and so avoids this issue. But
Op 2017-09-22, Thomas Jollans schreef :
> Just to make the implication explicit:
>
>>>> from math import nan
>>>> nan is nan
> True
>>>> nan == nan
> False
>>>> nan != nan
> True
>>>>
To add to the fun:
>>> nan is nan
True
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
Op 2017-09-21, Thomas Jollans schreef :
> On 2017-09-19 20:21, Stefan Ram wrote:
>> I do not use UTF-8
>>
>
> Why on earth not?!
Even *More* Older Man Yells at UTF-8?
--
https://mail.python.org/mailman/listinfo/python-list
ssue. But I suppose that is not really the
newbie-friendly solution the OP was looking for...
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
in the standard library, provided you download the
correct version of Python, namely the one from:
https://python-xy.github.io/
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
Op 2017-09-12, Jona Azizaj schreef :
> It looks very nice, thanks for sharing :)
print(insertionSort)
It's even Python3-compliant!
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
on for my own
development and just install a recent version of my choice locally. It
saves a lot of headaches. The system Python is there to run system
programs.
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
of installing things on Windows... is there anything that can be done?
I just added issue 31427 on the Python bug tracker proposing
adding this to the Windows FAQ.
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
name.
2. On Posix platforms, it creates a file which is opened and immediately
unlink()-ed, and the file descriptor is communicated to the child
process using a UNIX-domain socket.
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
27;s supposed to work on all platforms (including Windows).
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
handing network connections.
https://github.com/harvimt/quamash
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
Op 2017-09-10, Marko Rauhamaa schreef :
> Stephan Houben :
>
>> Would we not eventually want a file object to deliver its lines
>> asynchronously (with non-blocking reads under the hood) if
>> iterated over with "async for", while preserving the current
>
gt; application would be inefficient from an enduser
> perspective.
You mean, like the existing .Xdefaults mechanism
(yes Tk also supports that on Windows),
and the "option" mechanism?
https://www.tcl.tk/man/tcl8.6/TkCmd/option.htm
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
Op 2017-09-10, Marko Rauhamaa schreef :
> Stephan Houben :
>>
>> Why not bundle the Python interpreter with your application?
>> It seems to work for Windows developers...
>
> I've seen that done for Python and other technologies. It is an
> expensive route to t
Op 2017-09-10, Marko Rauhamaa schreef :
> As an application developer, I can't make the customers depend on EPEL.
> It's Python2 until the distro comes with Python3.
Why not bundle the Python interpreter with your application?
It seems to work for Windows developers...
S
al-world situations where that's the case.
Would we not eventually want a file object to deliver its lines
asynchronously (with non-blocking reads under the hood) if
iterated over with "async for", while preserving the current
blocking behavior in the "for" case?
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
ge contains *precisely enough* parentheses.
;-)
(Fortunate that I commented out the unbalanced closing parenthesis.)
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
Timsort ( https://en.wikipedia.org/wiki/Timsort )
algorithm. Timsort is O(N) in the special case of a list of N elements
where the first N-1 are already sorted and the last one is arbitrary.
So appending the value and then calling sort() is in fact O(N) in Python
(hence asymptotically optimal),
Tk also supported tear-off
menus under Windows (but not under macOS).
However, many applications apparently explicitly suppress
this functionality by doing
Menu(..., tearoff=0)
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
except asyncio.CancelledError:
print("got CancelledError")
print("f1 cancelled: ", f1.cancelled()) # prints False
print("f2 cancelled: ", f2.cancelled()) # prints True
So cancellation "normally" proceeds from inner future -> outer future.
It
of proto-Python was already an "old question".
In this paper, Plotkin introduces the λV-calculus, the call-by-value
lambda-calculus, to formalize what it is what ISWIM (and Python) are
actually doing. This paper is, to the best of my knowledge, the closest
thing to an "official&q
Mac OS, Linux, Windows)...
I would suggest trying to reproduce the issue in a small Tcl/Tk script.
If the issue can be reproduced in Tcl I would suggest filing a bug
report at https://core.tcl.tk/tk/reportlist .
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
e normalization,
the more attractive case sensitivity looks ;-)
Also slim hope to have a single caseInsensitiveCompare function
which "Does The Right Thing"™.
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
Op 2017-08-23, Ben Finney schreef :
> Could you be convinced to instead do::
>
> import functools
> import itertools
>
> generate_id = functools.partial(next, itertools.count())
I certainly could be, but I was so far unaware of the desirability to do so.
ou are correct. That's kind of a deception, really.
I have often done things like:
generate_id = itertools.count().__next__
but I suppose that isn't OK either, then.
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
;
No need for partial and gt.
[x + 1 for x in takewhile((5).__gt__, (0,1,2,999,3,4))]
Basically, Haskell's infix opererator sections can often be
translated into Python by attribute access to the bound method.
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
a facility in its standard library.
std::transform (and many other functions operating on sequences, but
you asked for a map() equivalent) takes an optional
"execution_policy" parameter which indicates if the operation
should be run sequentially (the default) or can be parallellized.
s:
class Person:
def __init__(self, first_name, last_name, address, city):
self.first_name = first_name
self.last_name = last_name
self.address = address
self.city = city
Greetings,
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
Good Morning,
I've tried ten times to install pip with no success in windows 10 using
python 64bit version.
Is there a solution available?
I'm looking forward hearing you soon.
--
https://mail.python.org/mailman/listinfo/python-list
I rarely ever post here.
But I wanted to say that people responding to this Nikos troll makes reading
this list a nuisance.
You've never ever been successful in convincing him to behave, and it's been
going on for quite a while now.
I remain subscribed for occasional interesting new idioms an
And seniority combined with annual cost of living raises, due to Perl being in
use longer
S
Sent from my pocket UNIVAC.
On May 5, 2013, at 10:11 AM, Ignoramus16992
wrote:
> According to CIO.com, Python programmers make only $83,000 per year,
> while Perl programmers make $93,000 per year.
>
Most likely more legacy Perl code in mission critical systems
S
Sent from my pocket UNIVAC.
On May 5, 2013, at 10:11 AM, Ignoramus16992
wrote:
> According to CIO.com, Python programmers make only $83,000 per year,
> while Perl programmers make $93,000 per year.
>
> http://www.cio.com/slides
? Don't hesitate to email us at sa...@wingware.com.
Thanks,
--
Stephan Deibel
Wingware | Python IDE
Advancing Software Development
www.wingware.com
--
http://mail.python.org/mailman/listinfo/python-list
,
preferably in Python.
I'm so far only familiar with Python 2.X. Is Python 3 sucessful enough
to make a switch worthwhile now? Or will students still face an
infrastructure with mostly Python 2.X deployed in, say, 2 years time,
when they graduate?
Bye,
Stephan
--
-
Hi,
Wingware has released version 3.2.4 of Wing IDE, our integrated development
environment for the Python programming language. Wing IDE can be used on
Windows, Linux, and OS X to develop Python code for web, GUI, and embedded
scripting applications. Wing IDE provides auto-completion, call tip
Hi,
Wingware has released version 3.2.1 of Wing IDE, our integrated development
environment for the Python programming language. This is a bug fix release
that includes the following changes:
* Improved support for Snow Leopard (OS X 10.6)
* Support for x86_64 Python 2.4+ on OS X
* Support for
or an external
convenience feed. For the real application, we have a controlled
environment, and loosing the occasional packet is much less critical
than the overhead and delays of a safe protocol. But this is getting
off-topic.
Bye,
Stephan
--
-- It can be done! --
__call__(self):
self.static_var+=1
return self.static_var
fun_with_state = hidden()
>>> fun_with_state()
1
>>> fun_with_state()
2
>>> fun_with_state()
3
>>> fun_with_state()
4
Bye,
Stephan
--
-- It can be done! ------
for any input!
Bye,
Stephan
--
-- It can be done! -
Please email me as [EMAIL PROTECTED] (Stephan Schulz)
--
http://mail.python.org/mailman/listinfo/python-list
ntation on codespeak.net as
it will probably answer all of your questions. Alternativly, you might
want to join the #pypy channel on freenode
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
Lie wrote:
> On Jun 9, 10:22 pm, Stephan Diehl <[EMAIL PROTECTED]> wrote:
>> Hi lazyweb,
>> I'm wondering, if there is a usable money data type for python available.
>> A quick search in pypi and google didn't convey anything, even though the
>> decima
Hi lazyweb,
I'm wondering, if there is a usable money data type for python available.
A quick search in pypi and google didn't convey anything, even though the
decimal data type seemed to be planned as a money data type originaly.
Thanks for any pointers
Stephan
--
http://mail.python.o
elly check out an USB CAN adapter
which might be easier to handle (but one never knows).
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
Lew wrote:
} John Thingstad wrote:
} > Perl is solidly based in the UNIX world on awk, sed, bash and C.
} > I don't like the style, but many do.
}
} Please exclude the Java newsgroups from this discussion.
Did it ever occur to you that you don't speak for entire news groups?
Ste
ce as the primary decision criteria, or I'll stop coming.
I have to admit, I'll keep coming to PyCon even if all the talks suck
abysmally as long as there's good hallway time, open space, BoFs, and
sprints. ;-)
But, yes, lightning talks are also a critical part of the conf, and
woul
Hi,
We're happy to announce version 3.0.4 of Wing IDE, an advanced development
environment for the Python programming language. It is available from:
http://wingware.com/downloads
Version 3.0.4 is a bug fix release that reduces debugger overhead by about
50% per Python instruction executed, impr
int for the Euro sign, so u'\u20ac' is the
unicode euro sign in python. The different encode calls translate the
unicode into actual encodings.
What you are seeing in your xml document is the iso-8859-15 encoded euro
sign. As Diez already noted, you must make shure, that
1. the whole xml document is encoded in latin-15 and the encoding header
reflects that
or
2. make sure that the utf-8 encoded euro sign is in your xml document.
Hope that makes sense
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
gert wrote:
> can my http://appwsgi.googlecode.com/ be on the http://wsgi.org/ page
> somewhere please :)
you are free to register yourself on wsgi.org and put a link to your
software at the appropriate place. It's a wiki, after all.
--
http://mail.python.org/mailman/listinfo/python-list
The Berlin Python User Group is meeting on the 23.1. at newthinking store at
7pm. All details can be found at http://wiki.python.de/User_Group_Berlin.
The Berlin Python User Group is planning to meet every two month to talk
about Python. Most talking will be done in german, but I can assure you
th
/sponsorship/
Or become a sponsor of PyCon 2008, a great way to gain exposure
for your business or find talented Python programmers to hire:
http://us.pycon.org/2008/sponsors/
If you have any questions, please email me directly.
Thanks, and Happy Holidays!
--
Stephan Deibel
Chairman of the
l price to upgrade.
--
Stephan Deibel
Wingware | Python IDE
Advancing Software Development
www.wingware.com
--
http://mail.python.org/mailman/listinfo/python-list
Martin Marcher wrote:
> Hello,
>
> is there something like a standard full text search engine?
>
> I'm thinking of the equivalent for python like lucene is for java or
> ferret for rails. Preferrably something that isn't exactly a clone of
> one of those but more that is python friendly in terms
tually failed?
Nothing I've read about 3.0 has alarmed me that much yet, but I've not
yet actually tried converting code for it (except a few extension modules,
which at least _compiled_ just fine against 3.0).
- Stephan
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I'm happy to announce the release of Wing IDE 3.0 beta 2. It is available from
http://wingware.com/wingide/beta
Changes since the previous beta release include:
* Stackless Python 2.4 and 2.5 are now supported
* Python 2.5 for 64-bit Windows is now supported
* Fixed Zope WingDBG so it will
time: 3.4., 7pm
place: c-base
info: http://groups.google.de/group/python-berlin
--
http://mail.python.org/mailman/listinfo/python-list
Horta wrote:
> Hi folks,
>
> Suppose I have to loop over 3 lists being the same size at the same
> time and order. How can I do that without using the range() function
> or whatever indexing?
>
> Example using range:
>
> a = ['aaa', '']
> b = ['bb', '']
> c = ['c', '']
>
> for
Stephan Diehl wrote:
> http://starship.python.net/cgi-bin/mailman/listinfo/python-berlin
argghhh, wrong link. please try
http://starship.python.net/mailman/listinfo/python-berlin
--
http://mail.python.org/mailman/listinfo/python-list
n't done so already, subscribe to
http://starship.python.net/cgi-bin/mailman/listinfo/python-berlin
for last minute information. If you plan to come, please leave a short
notice there, so we know how many people to expect.
Cheers
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
Dennis Lee Bieber wrote:
> Uhm... Unless something has happened that I don't know about, isn't
> C# a M$ specific product?
Mono?
Regards
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
out
in them. New kids on the block may be more dynamic (Python really is), but
they can learn much from the old guys. Sometimes one should have a look and
learn from still good working ancestors...
Regards
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
Sebastian 'lunar' Wiesner wrote:
> Morpheus <[EMAIL PROTECTED]> wrote
>
>> So, what am I supposed to do here now?
>
> That's easy: Breed it...
Since two days I'm fighting with myself not to make this joke. Thanks for
relieving me...
Regards
Stephan
comes in for general coding
standards. Many rules of coding standards can be tested automatically and
Python is a good choice for text processing and checking source code
against the rules of a coding standard. I wrote a Python package for a
subset of our coding standards and that is a
eters:
http://www.tcl.tk/man/tcl8.4/TclCmd/interp.htm (See in the lower third of
the page at "Safe Interpreters")
http://www.tcl.tk/man/tcl8.4/TclCmd/safe.htm
Regards
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
> Anyone with an interest in secure Python should take a look at what
> Brett Cannon is doing in his postgraduate work. There have been some
> discussions on the python-dev list.
Can you some links to his work, the discussions or some other starting
point?
Stephan
Hendrik van Rooyen wrote:
> I seem to recall previous discussion on this group about a thing called
> the bastion module,
> and that it was deprecated. Not sure if it has any relevance.
Never heard about it, maybe it's worth a look for the OP.
Stephan
--
http://mail.pyth
xecute some hundreds of them in parallel on a game
server (or CGI) which itself runs on a virtual host at your webhoster, and
of course none of them should be able to kill it's neighbours, so all of
them need their own VM... phiu, that would need a really big iron. So the
the idea of VMs _is_ a good one for certain situations, but the need for
secure execution environments inside an interpreter remains.
Regards
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
ions for untrusted code in a platform independent manner at the OS
level. - Managing all this in the interpreter would solve the problem, at
the cost of implementing lots of resource management code. A good sandbox
seems to be a real adventure with few survivors, as can be seen in the
JavaScript-wor
g a sandbox
really secure is a hard job, and may need some serious changes in the
Python interpreter, but AFAIK from Tcl, it is possible - and would be nice
to have.
Regards
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
pecially with this kind of problem, such as having no keywords,
which makes it possible to change the semantics of even the most basic
constructs in the language from the scripting level), but I think it would
be a really useful feature for Python to have a sandbox mechanism to run
untruste
rn that some day... ;-)
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
utabintarbo wrote:
> http://pywinauto.pbwiki.com/ for Win32
Thanks for the hint, looks usable. But it seems, there's nothing for X11 and
MacOSX. I didn't thought, that the problem would be so unusual...
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
se you should put all that into defs and create own write/print
functions to encapsulate the whole buffering/processing/cleanup.
This works great for scripting, but I'm pretty sure, that it does not work
for C Libraries in Python. But I do not know, how Python handles its
strea
erate Mouse
events (move, click etc.) and keyboard events and inject them directly into
the event-queue of the underlying window system.
Does somebody know such a module or do I have to utilize platform specific
tools from within Python?
Regards and Thanks
Stephan
--
http://mail.python.org/ma
happens and what
it means. Additionally, if it should work with threads, you must take care
that every thread gets its own output file. But as a first step to get a
trace of execution, this should do it.
HTH, Regards
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 140 matches
Mail list logo