etter Python synax to
use?
Thanks,
-Stephan
--
http://mail.python.org/mailman/listinfo/python-list
der record and a
corresponding detail record on the next line. Each line type has a
different number of fields.)
Can the CSV module be coerced to read two line formats at once or am I
better off using read and split?
Thanks for your insight,
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
r way?
--
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
)
# Print the parsed data
print '-' * 40
print "Header (%d fields): %s" % (len(header), header)
print "Detail (%d fields): %s" % (len(detail), detail)
except StopIteration: break
Regards,
-Stephan
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Im am using PyRun_SimpleString() inside a BCB 5.0 GUI app
on win32.
All works fine.
The PyRun_SimpleStript() runs a piece of python
code which calls often a callback function to
refresh my gui App so my Form still can react
to user input.
Now, I would like to implement a possibility
to inte
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
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
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
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
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),
ge contains *precisely enough* parentheses.
;-)
(Fortunate that I commented out the unbalanced closing parenthesis.)
Stephan
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
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 :
>
>> 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
>
handing network connections.
https://github.com/harvimt/quamash
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
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
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
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
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
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
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
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
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-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
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
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
ses on an instance.
Stephan
--
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
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
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-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
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]:
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
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
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
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
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
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
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
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
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
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
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
(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
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
ps://github.com/danthedeckie/simpleeval
Might be a good starting point.
Greetings Stephan
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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 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 Tue, 04 Jan 2005 05:43:32 -0800, michele.simionato wrote:
> Holger:
>
>> FWIW, i added the recipe back to the online cookbook. It's not
> perfectly
>> formatted but still useful, i hope.
>
>> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/361742
>
> Uhm... on my system I get:
>
>
r one, and
have no idea how to do it.
I hope it has become clear what I want to do, if not feel free to ask.
I'm running python 2.4
Thanks in advance,
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
ript.
You might want to check out MochiKit (http://mochikit.com), a lightweight
JavaScript library written by Bob Ippolito. Bob did a very good job in
turning programming JS into a more python like experience.
- stephan
--
http://mail.python.org/mailman/listinfo/python-list
I just found out by accident, that slice indices can be larger than
the length of the object. For example
>>> 'test'[:50]
'test'
>>> 'test'[40:50]
''
I'd rather expected to be confronted with an IndexError.
(This is actually described in
http://docs.python.org/lib/typesseq.html, so my expectation
On Mon, 05 Sep 2005 14:26:14 -0400, Terry Reedy wrote:
>
> "Stephan Diehl" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>>I just found out by accident, that slice indices can be larger than
>> the length of the object. For example
>
rvers
> type='submit'>WKPEA1
> type='submit'>WKNHA2
>
>
>
> And the code that's messing things up:
>
No, here you are wrong. IE doesn't work as expected with buttons.
See
http://www.solanosystems.com/blog/archives/2005/04/12/the-submi
, Christian Tismer, is one of the main
developers of the PyPy project. (http://codespeak.net/pypy)
For this reason, there is an extremely good chance that the ideas
behind stackless will survive :-) .
Visit www.stackless.com for further info.
---
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
program is executed. That is
not, of course, intended (or working).
Is there a (portable, standard) way for the program/module to find out
if it is imported or executed stand-alone?
You can find the code at
http://www.eprover.org/SOFTWARE/utilities.html
Bye,
Stephan
--
In article <[EMAIL PROTECTED]>,
Fredrik Lundh wrote:
>Stephan Schulz wrote:
>
>> Is there a (portable, standard) way for the program/module to find out
>> if it is imported or executed stand-alone?
>
>if a module is executed, it's name is set to "__main
ating systems.
A complete list of changes is available here:
http://wingware.com/pub/wingide/2.0.2/CHANGELOG.txt
For more information see:
Product Info: http://wingware.com/products
Sales: http://wingware.com/store/purchase
Upgrades: http://wingware.com/store/upgrade
Sincerely,
St
On Tue, 15 Mar 2005 03:48:40 -0400, vegetax wrote:
> if i have a dictionary:
> d = {'a':2,'b':3 }
> l = (1,2)
>
> how can i pass it to a generic function that takes variable keywords as
> arguments? same thing with variable arguments, i need to pass a list of
> arguments to the function
>
> def
rades: http://wingware.com/store/upgrade
Sincerely,
Stephan Deibel
--
Wingware
Wing IDE for Python
Advancing Software Development
www.wingware.com
--
http://mail.python.org/mailman/listinfo/python-list
lso covers contribution of code to the PSF, which is
only an issue if your code will become part of the Python distribution.
The contribution process is still being set up, so this part of the
document is subject to change.
Please cc me on any replies, as I can't currently keep up with CLP.
Thanks!
is a registered 501(c)(3) charity so donations are tax-deductible
for US tax payers. There is still time to make a donation that can be
deducted in the 2004 tax year.
If you would like to learn more about the PSF, please visit:
http://www.python.org/psf/
Happy New Year!
Sincerely,
Stephan D
g/psf/donations.html
I hope you will consider including the PSF in your year-end giving. In
addition to funding grants, your donation will help the PSF to run PyCon
annually (http://www.python.org/pycon) and to protect the intellectual
property rights behind Python.
Thanks very much, and Happy New Year!
St
e is usually getting approval from the company
to write about Python. It may require some educating about open
source to get past rules against endorsing commercial products
(which Python obviously isn't).
If you have any questions, please let me know.
Thanks,
Stephan Deibel
Pythonology.com
-
? 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
Paolo Pantaleo wrote:
> [I hope I am posting to the right place]
>
> I have a cheetah template something like this:
>
> x is: $x
> y is: $y
> z is: $z
>
> [Actually more complicated]
>
> If for example $y is not defined I get an exception and the parsing
> of the template stops. Is there any
g like that for python,
but I did not find a way to achieve that, yet.
Regards
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
Michał Bartoszkiewicz wrote:
> #!/bin/sh
> """exec" python "$0" "$@"""
Wow, cool... I like that!
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
I really love Python too for many
reasons. But I miss features and tricks in both languages that I have in
the other...
Interleaving the script-language with shell-scripting was one of them. So
I'm a little bit happier with Python now... ;-)
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
ZeD wrote:
> print "Hello, world"
> $ file test.py
> test.py: Bourne shell script text executable
Yes, the same happens with all Tcl-Scripts. I like to see this as a bug in
"file", not in the scripting...
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
But file
should recognize this for Tcl, because it is common there. And if it needs
to work for Tcl only, one can construct a simple mechanism for "file" to
check this.
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
reasoning. But if you accept, that file can not be perfect anyway and want
it to be as good as possible, then it is some kind of bug or missing
feature in "file" that it recognizes (or tries to) some morphing file
formats but not another (which is fairly wide spread, even if Tcl is not
Cameron Laird wrote:
> goon summarizes WSGI resources:
> http://groups.google.com/group/comp.lang.python/msg/f7d67bc039748792
>
THE wsgi resource at the moment is http://wsgi.org . (sorry, I've missed
the original thread)
Stephan
--
http://mail.python.org/mailman/l
d in the comparison of these different types of thinking and (how
Stephenson says) cultures, find a very good essay about it in this small
book.
Regards
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
rn that some day... ;-)
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
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
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
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
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
bayerj schrieb:
> I want to make a registry of methods of a class during creation. My
> attempt was this
>
> """ classdecorators.py
>
> Author: Justin Bayer
> Creation Date: 2006-06-22
> Copyright (c) 2006 Chess Pattern Soft,
> All rights reserved. """
>
> class decorated(object):
>
> meth
f = file('output.txt','w')
print >>f, '%-30s | %-12d | %-12d |%-12d ' % (typename,
size / count,
count,
size)
f.close()
> hello,
>
> one more question i will
Gnosis (http://gnosis.cx/download/) is able to do this if you mean
something like pickling, but with an XML-like ouput.
--
http://mail.python.org/mailman/listinfo/python-list
the scripts, that create
such a installer. They are a little bit confused written, since they had to
be finished yesterday, as ever (and laying around since, annoying me, when
I look at the code). But may be they help or at least inspire you, doing
the same thing but better.
Regards
Stephan
--
http:
return value of close is the return value of the command run. If you
need to read stdout and stderr of your command or write to its stdin, use
popen2, popen3, popen4 from the os-module.
Regards
Stephan
--
http://mail.python.org/mailman/listinfo/python-list
):
other=linecache.getline(os.path.join('/proc', str(pid), 'cmdline'),
1).split('\0')[0:2]
if script[0] == other[0] and os.path.basename(script[-1]) ==
os.path.basename(other[-1]):
raise "already running!"
-
HTH
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
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
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
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
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
1 - 100 of 140 matches
Mail list logo