how to simulate tar filename substitution across piped subprocess.Popen() calls?

2012-11-08 Thread jkn
Hi All
i am trying to build up a set of subprocess.Ponen calls to
replicate the effect of a horribly long shell command. I'm not clear
how I can do one part of this and wonder if anyone can advise. I'm on
Linux, fairly obviously.

I have a command which (simplified) is a tar -c command piped through
to xargs:

tar  -czvf myfile.tgz -c $MYDIR mysubdir/ | xargs -I '{}' sh -c "test -
f $MYDIR/'{}'"

(The full command is more complicated than this; I got it from a shell
guru).

IIUC, when called like this, the two occurences of '{}' in the xargs
command will get replaced with the file being added to the tarfile.

Also IIUC, I will need two calls to subprocess.Popen() and use
subprocess.stdin on the second to receive the output from the first.
But how can I achive the substitution of the '{}' construction across
these two calls?

Apologies if I've made any howlers in this description - it's very
likely...

Cheers
J^n






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


Re: how to simulate tar filename substitution across piped subprocess.Popen() calls?

2012-11-12 Thread jkn
Hi Hans
thanks a lot for your reply:

> That's what 'xargs' will do for you.  All you need to do, is invoke
> xargs with arguments containing '{}'.  I.e., something like:
>
> cmd1 = ['tar', '-czvf', 'myfile.tgz', '-c', mydir, 'mysubdir']
> first_process = subprocess.Popen(cmd1, stdout=subprocess.PIPE)
>
> cmd2 = ['xargs', '-I', '{}', 'sh', '-c', "test -f %s/'{}'" % mydir]
> second_process = subprocess.Popen(cmd2, stdin=first_process.stdout)
>

Hmm - that's pretty much what I've been trying. I will have to
experiment a bit more and post the results in a bit more detail.

> > Apologies if I've made any howlers in this description - it's very
> > likely...
>

> I think the second '-c' argument to tar should have been a '-C'.

You are correct, thanks. Serves me right for typing the simplified
version in by hand. I actually use the equivalent "--directory=..." in
the actual code.

> I'm not sure I understand what the second command is trying to
> achieve.  On my system, nothing happens, because tar writes the
> names of the files it is adding to stderr, so xargs receives no
> input at all.  If I send the stderr from tar to the stdin of
> xargs, then it still doesn't seem to do anything sensible.

That's interesting ... on my system, and all others that I know about,
the file list goes to stdout.

> Perhaps your real xargs command is more complicated and more
> sensible.

Yes, in fact the output from xargs is piped to a third process. But I
realise this doesn't alter the result of your experiment; the xargs
process should filter a subset of the files being fed to it.

I will experiment a bit more and hopefully post some results. Thanks
in the meantime...

Regards
Jon N

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


Re: how to simulate tar filename substitution across piped subprocess.Popen() calls?

2012-11-12 Thread jkn
slight followup ...

I have made some progress; for now I'm using subprocess.communicate to
read the output from the first subprocess, then writing it into the
secodn subprocess. This way I at least get to see what is
happening ...

The reason 'we' weren't seeing any output from the second call (the
'xargs') is that as mentioned I had simplified this. The actual shell
command was more like (in python-speak):

"xargs -I {} sh -c \"test -f %s/{} && md5sum %s/{}\"" % (mydir, mydir)

ie. I am running md5sum on each tar-file entry which passes the 'is
this a file' test.

My next problem; how to translate the command-string clause

"test -f %s/{} && md5sum %s/{}" # ...

into s parameter to subprocss.Popen(). I think it's the command
chaining '&&' which is tripping me up...

Cheers
J^n



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


Re: how to simulate tar filename substitution across piped subprocess.Popen() calls?

2012-11-12 Thread jkn
On Nov 12, 4:58 pm, Rebelo  wrote:
> Dana četvrtak, 8. studenoga 2012. 19:05:12 UTC+1, korisnik jkn napisao je:
>
> > Hi All
>
> >     i am trying to build up a set of subprocess.Ponen calls to
>
> > replicate the effect of a horribly long shell command. I'm not clear
>
> > how I can do one part of this and wonder if anyone can advise. I'm on
>
> > Linux, fairly obviously.
>
> >     J^n
>
> You should try to do it in pure python, avoiding shell altogether.
> The first step would be to actually write what it is you want to do.
>

Hi Rebelo
   FWIW I intend to do exactly this - but I wanted to duplicate the
existing shell action beforehand, so that I could get rid of the shell
command.

After I've tidied things up, that will be my next step.

Cheers
Jon N



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


Re: how to simulate tar filename substitution across piped subprocess.Popen() calls?

2012-11-12 Thread jkn
Hi Hans

On Nov 12, 4:36 pm, Hans Mulder  wrote:
> On 12/11/12 16:36:58, jkn wrote:
>
>
>
>
>
>
>
>
>
> > slight followup ...
>
> > I have made some progress; for now I'm using subprocess.communicate to
> > read the output from the first subprocess, then writing it into the
> > secodn subprocess. This way I at least get to see what is
> > happening ...
>
> > The reason 'we' weren't seeing any output from the second call (the
> > 'xargs') is that as mentioned I had simplified this. The actual shell
> > command was more like (in python-speak):
>
> > "xargs -I {} sh -c \"test -f %s/{} && md5sum %s/{}\"" % (mydir, mydir)
>
> > ie. I am running md5sum on each tar-file entry which passes the 'is
> > this a file' test.
>
> > My next problem; how to translate the command-string clause
>
> >     "test -f %s/{} && md5sum %s/{}" # ...
>
> > into s parameter to subprocss.Popen(). I think it's the command
> > chaining '&&' which is tripping me up...
>
> It is not really necessary to translate the '&&': you can
> just write:
>
>     "test -f '%s/{}' && md5sum '%s/{}'" % (mydir, mydir)
>
> , and xargs will pass that to the shell, and then the shell
> will interpret the '&&' for you: you have shell=False in your
> subprocess.Popen call, but the arguments to xargs are -I {}
> sh -c "", and this means that xargs ends up invoking the
> shell (after replacing the {} with the name of a file).
>
> Alternatively, you could translate it as:
>
>     "if [ -f '%s/{}' ]; then md5sum '%s/{}'; fi" % (mydir, mydir)
>
> ; that might make the intent clearer to whoever gets to
> maintain your code.

Yes to both points; turns out that my problem was in building up the
command sequence to subprocess.Popen() - when to use, and not use,
quotes etc. It has ended up as (spelled out in longhand...)


xargsproc = ['xargs']

xargsproc.append('-I')
xargsproc.append("{}")

xargsproc.append('sh')
xargsproc.append('-c')

xargsproc.append("test -f %s/{} && md5sum %s/{}" % (mydir,
mydir))


As usual, breaking it all down for the purposes of clarification has
helpd a lot, as has your input. Thanks a lot.

Cheers
Jon N
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to simulate tar filename substitution across piped subprocess.Popen() calls?

2012-11-12 Thread jkn
Hi Hans

[...]
>
> >         xargsproc.append("test -f %s/{} && md5sum %s/{}" % (mydir,
> > mydir))
>
> This will break if there are spaces in the file name, or other
> characters meaningful to the shell.  If you change if to
>
>         xargsproc.append("test -f '%s/{}' && md5sum '%s/{}'"
>                              % (mydir, mydir))
>
> , then it will only break if there are single quotes in the file name.

Fair point. As it happens, I know that there are no 'unhelpful'
characters in the filenames ... but it's still worth doing.

>
> As I understand, your plan is to rewrite this bit in pure Python, to
> get rid of any and all such problems.

Yep - as mentioned in another reply I wanted first to have something
which duplicated the current action (which has taken longer than I
expected), and then rework in a more pythonic way.

Still, I've learned some things about the subprocess module, and also
about the shell, so it's been far from wasted time.

Regards
Jon N
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to simulate tar filename substitution across piped subprocess.Popen() calls?

2012-11-18 Thread jkn
Hi Hans

[...]
> 
> 
> However, once he does that, it's simpler to cut out xargs and invoke
> 
> "sh" directly.  Or even cut out "sh" and "test" and instead use
> 
> os.path.isfile and then call md5sum directly.  And once he does that,
> 
> he no longer needs to worry about single quotes.
> 

Yes indeed, using os.path.isfile() and them md5sum directly is my plan ... for 
reasons of maintainability (by myself) more than anything else.

> 
> 
> The OP has said, he's going to d all that.  One step at a time.
> 
> That sounds like a sensible plan to me.
> 

Thanks a lot.

J^n
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Brython - Python in the browser

2012-12-19 Thread jkn
Hi Pierre
this looks very interesting, thanks. But I wonder ... do you know of pyjs 
(pyjamas as-was)? http://pyjs.org/

I would be interested in a comparison between (the aims of) Brython and pyjs.

Either way, thanks for the info.

Regards
Jon N
-- 
http://mail.python.org/mailman/listinfo/python-list


pylint or similar to test version-specific language constructs?

2013-01-09 Thread jkn
Hi all
I have to write python code which must run on an old version of
python (v2.4) as well as a newer (v2.7). I am using pylint and would
like to check if is possible to check with pylint the use of operators
etc. which are not present in 2.4; the ternary operator springs to
mind.

I haven't found anything in pylint which indicates it can do this sort
of check; am I missing anything? Other suggestions for this kind of
checking welcome.

Thanks
Jon N
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: pylint or similar to test version-specific language constructs?

2013-01-13 Thread jkn
Hi Dave

On 11 Jan, 15:06, Dave Angel  wrote:
>
> Not sure what you mean by beforehand.  Don't you run all your unit tests
> before putting each revision of your code into production?  So run those
> tests twice, once on 2.7, and once on 2.4.  A unit test that's testing
> code with a ternary operator will fail, without any need for a separate
> test.
>
> if it doesn't, then you've got some coverage gaps in your unit tests.

By 'beforehand' I meant 'before testing on my target 2.4 system;
perhaps I should have been clearer in that I am running 2.7 on my
'development' platform, and 2.4 on my target. It would be painful to
put 2.4 on my target system (although I continue to wonder about
that...). So I was looking to catch such errors before migrating to
the target.

[Steven D'Aprano]
> Decorators work fine in Python 2.4.

Yes, I was just coming up with another example of a language construct
which didn't exist at one point.

> You don't even need tests for the code that includes the ternary
> operator. The module simply won't compile in Python 2.4, you get a
> SyntaxError when you try to import it or run it.

In fact I had a misapprehension about this; for some reason (I thought
I'd tried it) I thought such an error only got caught at runtime, not
'compile-time'. I now see that this is not the case, which means the
athe problem is less of a concern than I thought.

Thanks for the comments.

Jon N
-- 
http://mail.python.org/mailman/listinfo/python-list


multiple namespaces within a single module?

2012-02-09 Thread jkn
Hello there

is it possible to have multiple namespaces within a single python
module?

I have a small app which is in three or four .py files. For various
reasons I would like to (perhaps optionally) combine these into one
file. I was hoping that there might be a simple mechanism that would
let me do this and maintain the namespaces referred to: so that the
'combined' file would look something like

#
# not real python
#

# originally from a.py
with namespace a:
def function():
pass

# ...

# originally from b.py
with namespace b:
def function():
pass

# originally from main module

a.function()
b.function()

etc.

Is there anything like this available?

Thanks
J^n

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


Re: multiple namespaces within a single module?

2012-02-09 Thread jkn
Hi Peter

On Feb 9, 7:33 pm, Peter Otten <[email protected]> wrote:
> jkn wrote:
> >     is it possible to have multiple namespaces within a single python
> > module?
>
> Unless you are abusing classes I don't think so.
>
> > I have a small app which is in three or four .py files. For various
> > reasons I would like to (perhaps optionally) combine these into one
> > file.
>
> Rename your main script into __main__.py, put it into a zip file together
> with the other modules and run that.

Hmm ... thanks for mentioning this feature, I didn't know of it
before. Sounds great, except that I gather it needs Python >2.5? I'm
stuck with v2.4 at the moment unfortunately...

J^n
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: multiple namespaces within a single module?

2012-02-10 Thread jkn
Hi Peter

On Feb 10, 11:10 am, Peter Otten <[email protected]> wrote:

[...]

> > Hmm ... thanks for mentioning this feature, I didn't know of it
> > before. Sounds great, except that I gather it needs Python >2.5? I'm
> > stuck with v2.4 at the moment unfortunately...
>
> You can import and run explicitly,
>
> $ PYTHONPATH mylib.zip python -c'import mainmod; mainmod.main()'
>
> assuming you have a module mainmod.py containing a function main() in
> mylib.zip.

That looks very useful  -thanks for the tip!

J^n
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What's the best way to write this regular expression?

2012-03-09 Thread jkn
Also unrelated to the OP, but a far superior Commnad line interface to
Windows is the (unhelpfully-named) 'console' program:

http://sourceforge.net/projects/console/

This has tabbed windows, preset directory navigation, good copy/paste
facilities, the ability to configure different shells, etc etc.

Well worth a look.

HTH
J^n


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


why can't I pickle a class containing this dispatch dictionary?

2012-04-02 Thread jkn
Hi All
I'm clearly not understanding the 'can't pickle instancemethod
objects' error; can someone help me to understand, & maybe suggest a
workaround, (apart from the obvious if ... elif...).

I'm running Python 2.6 on an embedded system.

== testpickle.py ==
import pickle

class Test(object):
def __init__(self):
self.myDict = {
1: self.tag1,
2: self.tag2
}
def dispatch(self, v):
try:
self.myDict[v]()
except KeyError:
print "No corresponding dictionary entry!"
#
def tag1(self):
print "one"
def tag2(self):
print "two"


t = Test()
t.dispatch(1)
t.dispatch(2)
t.dispatch(0)

fd = open("pickle.out", "w")
pickle.dump(t, fd)
fd.close()
# EOF

$ python testpickle.py
one
two
No corresponding dictionary entry!
Traceback (most recent call last):
  File "ptest.py", line 29, in 
pickle.dump(t, fd)
  File "/usr/lib/python2.6/pickle.py", line 1362, in dump
Pickler(file, protocol).dump(obj)
  File "/usr/lib/python2.6/pickle.py", line 224, in dump
self.save(obj)
  File "/usr/lib/python2.6/pickle.py", line 331, in save
self.save_reduce(obj=obj, *rv)
  File "/usr/lib/python2.6/pickle.py", line 419, in save_reduce
save(state)
  File "/usr/lib/python2.6/pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
  File "/usr/lib/python2.6/pickle.py", line 649, in save_dict
self._batch_setitems(obj.iteritems())
  File "/usr/lib/python2.6/pickle.py", line 663, in _batch_setitems
save(v)
  File "/usr/lib/python2.6/pickle.py", line 286, in save
f(self, obj) # Call unbound method with explicit self
  File "/usr/lib/python2.6/pickle.py", line 649, in save_dict
self._batch_setitems(obj.iteritems())
  File "/usr/lib/python2.6/pickle.py", line 663, in _batch_setitems
save(v)
  File "/usr/lib/python2.6/pickle.py", line 306, in save
rv = reduce(self.proto)
  File "/usr/lib/python2.6/copy_reg.py", line 70, in _reduce_ex
raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle instancemethod objects
$


Thanks
J^n

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


Re: why can't I pickle a class containing this dispatch dictionary?

2012-04-03 Thread jkn
Hi Peter

On Apr 3, 8:54 am, Peter Otten <[email protected]> wrote:
> jkn wrote:
> >     I'm clearly not understanding the 'can't pickle instancemethod
> > objects' error; can someone help me to understand,
>
> I think classes implemented in C need some extra work to make them
> picklable, and that hasn't been done for instance methods.

by 'classes implemented in C', doyou mean new-style classes', or what,
please?


>
> > & maybe suggest a
> > workaround, (apart from the obvious if ... elif...).
>
> You can implement pickling yourself:
>
> [...]

Hmm - interesting, thanks. I'm more trying to understand the issue at
the moment, but it's always nice to learn...

Thanks
J^n
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Recruiting for Python Developer - Perm

2012-05-22 Thread jkn
On May 22, 10:30 am, Python Recruiter  wrote:

> If any one can recommend, I will pay a £100 recom fee for any
> successful placements.

aHaHaHaHaHa...

And what percentage will you be charging your client? 15 percent? 25
percent?

Even if you were to offer 15% of your (say) 15% commission you should
be offering over a grand.

I might well fit your profile, and know & like the Bradford area. I
also use recruitment agencies when hiring. You're certainly off my
list...

Try doing a bit of research beforehand. There is a Python Jobs listing
where you can make your paltry offer.

J^n
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python CPU

2011-04-01 Thread jkn
On Apr 1, 4:38 pm, Brad  wrote:
> Hi All,
>
> I've heard of Java CPUs.

And Forth CPUs as well, I suspect ;-)

> Has anyone implemented a Python CPU in VHDL
> or Verilog?
>

I don't think so - certainly not in recent memory. If you look at the
documentation for the python byte code, for example:

http://docs.python.org/release/2.5.2/lib/bytecodes.html

you can see why. It starts off nicely enough, and then ...

HTH
J^n

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


Re: Literate Programming

2011-04-07 Thread jkn
Without fully answering your question ... I suggest you have a look at
Leo

http://webpages.charter.net/edreamleo/front.html

and ask your question at the (google) groups page devoted to that
editor.

http://groups.google.com/group/leo-editor

HTH
J^n



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


'QMessageBox' object has no attribute 'setCheckBox' on recent pull

2018-01-22 Thread jkn
Hi Edward

Seen after a recent pull:

D:\winapps\leo-editor>python launchLeo.py

can not import leo.plugins.importers.wikimarkup
can not import leo.plugins.importers.wikimarkup
reading settings in D:\winapps\leo-editor\leo\config\leoSettings.leo
reading settings in C:\Users\jnicoll\.leo\myLeoSettings.leo

Note: sys.stdout.encoding is not UTF-8
See: https://stackoverflow.com/questions/14109024

Leo 5.6, build 20180121141749, Sun Jan 21 14:17:49 CST 2018
Git repo info: branch = master, commit = 0a36546f5664
Python 2.7.2, PyQt version 4.8.6
Windows 7 x86 (build 6.1.7601) SP1
** isPython3: False
** caching enabled

reading settings in C:\Users\jnicoll\.leo\workbook.leo
Traceback (most recent call last):
  File "launchLeo.py", line 8, in 
leo.core.runLeo.run()
  File "D:\winapps\leo-editor\leo\core\runLeo.py", line 74, in run
g.app.loadManager.load(fileName, pymacs)
  File "D:\winapps\leo-editor\leo\core\leoApp.py", line 2216, in load
g.app.gui.runMainLoop()
  File "D:\winapps\leo-editor\leo\plugins\qt_gui.py", line 1073, in runMainLoop
g.app.gui.show_tips()
  File "D:\winapps\leo-editor\leo\plugins\qt_gui.py", line 1141, in show_tips
m.setCheckBox(cb)
AttributeError: 'QMessageBox' object has no attribute 'setCheckBox'


QMessageBox::setCheckBox() appears to have been introduced in Qt v5.2. Is this 
a dependancy now? 

http://leoeditor.com/installing.html#dependencies

still says Qt4 or Qt5

Thanks, Jon N

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


Re: 'QMessageBox' object has no attribute 'setCheckBox' on recent pull

2018-01-22 Thread jkn
On Monday, January 22, 2018 at 10:22:36 AM UTC, jkn wrote:

[...]

oops, wrong group, sorry!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: "CPython"

2022-06-21 Thread jkn
On Tuesday, June 21, 2022 at 2:09:27 PM UTC+1, Grant Edwards wrote:
> On 2022-06-21, Chris Angelico  wrote: 
> 
> > Not sure why it's strange. The point is to distinguish "CPython" from 
> > "Jython" or "Brython" or "PyPy" or any of the other implementations. 
> > Yes, CPython has a special place because it's the reference 
> > implementation and the most popular, but the one thing that makes it 
> > distinct from all the others is that it's implemented in C.
> I've been using CPython (and reading this list) for over 20 years, and 
> there's no doubt in my mind that the C in CPython has always been 
> interpreted by 99+ percent of the Python community as meaning the 
> implementation language. 
> 
> Sort of like ckermit  was the original 
> implementation of Kermit written in C. At the time, the other popular 
> implementations (for DOS, IBM, etc.) were written in assembly. 
> 

Same here, on both counts (20+ years on this Usenet group,
 and CPython == "the canonical C implementation of Python")

Actually, on all three counts - I remember ckermit as well ;-)

Fourthly...

J^n
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Resolving Weekday Schedules to Dates

2022-07-21 Thread jkn
On Thursday, July 21, 2022 at 8:19:34 PM UTC+1, rambius wrote:
> Hello, 
> 
> Do you know of a library that resolves schedules like every Wednesday 
> at 3:00pm to absolute time, that is return the datetime of the next 
> occurrence? 
> 
> Regards 
> rambius 
> 
> P.S. 
> 
> -- 
> Tangra Mega Rock: http://www.radiotangra.com

Not exactly, and it's not a library as such; but Andy Valencia's 'mypim'

http://sources.vsta.org:7100/mypim/index

includes a calendar facility, so you can add repeating dates and
query 'what's coming up in the next 30 days' etc.
I haven't looked at this very closely, but it looks like a version of
this might scratch an itch of my own.

you might also look at 'rrule':

https://dateutil.readthedocs.io/en/stable/rrule.html

and also look at iCalendar support in general.

I would be interested to learn if you come across anything to fit your
needs.

Regards, J^n




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


Re: any author you find very good has written a book on Python?

2022-09-06 Thread jkn
On Tuesday, September 6, 2022 at 4:36:38 PM UTC+1, Meredith Montgomery wrote:
> Paul Rubin  writes: 
> 
> > Meredith Montgomery  writes: 
> >> So that's my request --- any author you find very good has written a 
> >> book on Python? 
> > 
> > The ones by David Beazley are great. Same with his non-book writings 
> > about Python. See: http://dabeaz.com/
> Distilled Python is looking really nice, actually. It seems so concise, 
> so it looks like a really nice first read. Thank you for the 
> recommendation.

I concur with Paul's general recommendation of David Beazley's work.
I bought a copy of Python Distilled recently, having 'grown up' with editions
of his earlier 'Python Essential Reference', going back to the first edition
(Python 1.5?)

I confess to being slightly disappointed with 'Python Distilled', but I was
probably expecting something that I shouldn't have. It is basically a relatively
fast-paced introduction to 'modern' python, stripping down some of the fine
detail that the 'Essential Reference' books leave in.

I am not 100% sure how useful it would be for relative beginners; it depends 
what
you are looking for. As a reference to functions and library usage etc., the
essential reference books are (still) great, and cheap via eBay. As a stepping 
stone
from 'fluent beginner', it might well be perfect. As a hand-holding learning 
guide,
maybe not so great.

I'm by no means trying to diss Beazley's work, I think it is great; just trying 
to
indicate what you get for your money, and maybe the target audience.

J^n


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


Re: any author you find very good has written a book on Python?

2022-09-06 Thread jkn
On Tuesday, September 6, 2022 at 9:06:31 PM UTC+1, Thomas Passin wrote:
> Mark Pilgram's "Dive Into Python" was good. Now he's updated it for 
> Python 3: 

like, about ten years ago? (I think Mark Pilgrim dropped off the 'net
many years ago...)


> https://diveintopython3.net
> On 9/6/2022 11:36 AM, Meredith Montgomery wrote: 
> > Paul Rubin  writes: 
> > 
> >> Meredith Montgomery  writes: 
> >>> So that's my request --- any author you find very good has written a 
> >>> book on Python? 
> >> 
> >> The ones by David Beazley are great. Same with his non-book writings 
> >> about Python. See: http://dabeaz.com/ 
> > 
> > Distilled Python is looking really nice, actually. It seems so concise, 
> > so it looks like a really nice first read. Thank you for the 
> > recommendation.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Find the path of a shell command

2022-10-12 Thread jkn
On Wednesday, October 12, 2022 at 6:12:23 AM UTC+1, jak wrote:
> Il 12/10/2022 06:00, Paulo da Silva ha scritto: 
> > Hi! 
> > 
> > The simple question: How do I find the full path of a shell command 
> > (linux), i.e. how do I obtain the corresponding of, for example, 
> > "type rm" in command line? 
> > 
> > The reason: 
> > I have python program that launches a detached rm. It works pretty well 
> > until it is invoked by cron! I suspect that for cron we need to specify 
> > the full path. 
> > Of course I can hardcode /usr/bin/rm. But, is rm always in /usr/bin? 
> > What about other commands? 
> > 
> > Thanks for any comments/responses. 
> > Paulo 
> >
> I'm afraid you will have to look for the command in every path listed in 
> the PATH environment variable.

erm, or try 'which rm' ?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Find the path of a shell command

2022-10-12 Thread jkn
On Wednesday, October 12, 2022 at 12:07:36 PM UTC+1, jak wrote:
> Il 12/10/2022 09:40, jkn ha scritto: 
> > On Wednesday, October 12, 2022 at 6:12:23 AM UTC+1, jak wrote: 
> >> Il 12/10/2022 06:00, Paulo da Silva ha scritto: 
> >>> Hi! 
> >>> 
> >>> The simple question: How do I find the full path of a shell command 
> >>> (linux), i.e. how do I obtain the corresponding of, for example, 
> >>> "type rm" in command line? 
> >>> 
> >>> The reason: 
> >>> I have python program that launches a detached rm. It works pretty well 
> >>> until it is invoked by cron! I suspect that for cron we need to specify 
> >>> the full path. 
> >>> Of course I can hardcode /usr/bin/rm. But, is rm always in /usr/bin? 
> >>> What about other commands? 
> >>> 
> >>> Thanks for any comments/responses. 
> >>> Paulo 
> >>> 
> >> I'm afraid you will have to look for the command in every path listed in 
> >> the PATH environment variable. 
> > 
> > erm, or try 'which rm' ?
> You might but if you don't know where the 'rm' command is, you will have 
> the same difficulty in using 'which' Command. Do not you think?

I don't need to know where the rm command is in order to use the which command.

I *was* (knowingly and deliberately) assuming that you have a semi-reasonably
working system, and that your question meant "given command X, how do I
find where the executable X is on my system?".

Sounds like you want to make less assumptions than that. Fine. but probably
best to be clear about your assumptions up front.

J^n
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ANN: pdfposter 0.8.1 - scale and tile PDF pages to print on multiple sheets

2022-11-04 Thread jkn
On Friday, November 4, 2022 at 6:21:55 PM UTC, Hartmut Goebel wrote:
> I'm pleased to announce pdftools.pdfposter 0.8.1, a tool to scale and 
> tile PDF images/pages to print on multiple pages. 
> 
> :Homepage:  https://pdfposter.readthedocs.io/ 
> :Author:Hartmut Goebel  
> :License:   GNU Public License v3 or later (GPL-3.0-or-later) 
> 
> :Quick Installation: 
> pip install -U pdftools.pdfposter 
> 
> :Tarballs:  https://pypi.org/project/pdftools.pdfposter/#files 
> 
> 
> What is pdfposter? 
>  
> 
> Scale and tile PDF images/pages to print on multiple pages. 
> 
> ``Pdfposter`` can be used to create a large poster by building it from 
> multiple pages and/or printing it on large media. It expects as input a 
> PDF file, normally printing on a single page. The output is again a 
> PDF file, maybe containing multiple pages together building the 
> poster. 
> The input page will be scaled to obtain the desired size. 
> 
> This is much like ``poster`` does for Postscript files, but working 
> with PDF. Since sometimes poster does not like your files converted 
> from PDF. :-) Indeed ``pdfposter`` was inspired by ``poster``. 
> 
> For more information please refer to the manpage or visit 
> the `project homepage `_. 
> 
> 
> What's new in version 0.8.1 
> - 
> 
> * This is a bug-fix release for release 0.8. 
> 
> What's new in version 0.8 
> - 
> 
> * Be less strict when reading PDF files. 
> 
> * Enhance some help messages. 
> 
> * Drop support for Python 2 and Python <= 3.5. Minimum supported 
> versions are 
>   now 3.6 to 3.10. 
> 
> * Internal changes: 
> 
>   - Update required version of `PyPDF` to 2.1.1. 
>   - Enhance code quality. 
> 
> -- 
> Regards 
> Hartmut Goebel 
> 
> | Hartmut Goebel | [email protected] | 
> | www.crazy-compilers.com | compilers which you thought are impossible |

Thanks for this - yes, I remember poster for n-up Postscript files...

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


Re: Windows installer from python source code without access to source code

2023-03-31 Thread jkn
On Friday, March 31, 2023 at 1:09:12 PM UTC+1, Chris Angelico wrote:
> On Fri, 31 Mar 2023 at 23:01, Jim Schwartz  wrote: 
> > 
> > I want a windows installer to install my application that's written in 
> > python, but I don't want the end user to have access to my source code. 
> > 
> > 
> > 
> > Is that possible using python? I was using cx-freeze, but that has the 
> > source code available. So does pyinstaller. I think gcc does, too. 
> > 
> > 
> > 
> > Does anyone know of a way to do this? 
> >
> Fundamentally no, it's not. Python code will always be distributed as 
> some form of bytecode. The only way to make it available without 
> revealing anything is to put it on a server and let people access it 
> without running it themselves. 
> 
> But why is that a problem? Copyright law protects you from people 
> stealing your code and making unauthorized changes to it, and if 
> you're not worried about them making changes, there's no reason to 
> hide the source code (whatever you distribute would be just as 
> copiable). Are you concerned that people will see your bugs? We all 
> have them. 
> 
> ChrisA

The OP is asking for source code not to be available, not bytecode.
There are obfuscating tools like PyArmor you might want to have a look at.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: do ya still use python?

2021-04-20 Thread jkn
On Tuesday, April 20, 2021 at 7:11:41 AM UTC+1, Paul Rubin wrote:
> Jon Ribbens  writes: 
> > Why do you say that? The group seems quite lively to me (and no I'm 
> > not counting spam etc).
> No there is a lot happening in the Python world that never gets 
> mentioned here. Look at the 3.10 and 3.9.x release notes: many new 
> language features that we'd never have heard of if we only got our news 
> from here. These things would have been the topics of endless 
> discussions back in the day. The newsgroup was once a good place to 
> keep track of what was happening Python-wise, but it no longer is. This 
> is sad.

I agree with Paul - sadly this Usenet forum is seriously less valuable
than it used to be. I have been a semi-lurker here for more than 20 years
(pre Python 1.5) and the S/N ration has massively changed since then.

This is as much a reflection of the reduced status of Usenet groups as in
the rise of Python and the associated change in 'demographic'. But as
another Usenet fan I find it disappointing.

You wouldn't see Tim Peters or even Guido here nowadays, and
Steven D'Aprano was IMO forced out for no good reason ... you see
the results here every day...

J^n

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


Re: Sad news: Fredrik Lundh ("Effbot") has passed away

2021-12-11 Thread jkn
On Saturday, December 11, 2021 at 1:37:07 AM UTC, Roel Schroeven wrote:
> Message from Guido van Rossum 
> (https://mail.python.org/archives/list/[email protected]/thread/36Q5QBILL3QIFIA3KHNGFBNJQKXKN7SD/):
>  
> 
> > A former core dev who works at Google just passed the news that 
> > Fredrik Lundh (also known as Effbot) has died. 
> > 
> > Fredrik was an early Python contributor (e.g. Elementtree and the 're' 
> > module) and his enthusiasm for the language and community were 
> > inspiring for all who encountered him or his work. He spent countless 
> > hours on comp.lang.python answering questions from newbies and 
> > advanced users alike. 
> > 
> > He also co-founded an early Python startup, Secret Labs AB, which 
> > among other software released an IDE named PythonWorks. Fredrik also 
> > created the Python Imaging Library (PIL) which is still THE way to 
> > interact with images in Python, now most often through its Pillow 
> > fork. His effbot.org site was a valuable resource for generations of 
> > Python users, especially its Tkinter documentation. 
> > 
> > Fredrik's private Facebook page contains the following message from 
> > November 25 by Ylva Larensson (translated from Swedish): 
> > 
> > """ 
> > 
> > It is with such sorrow and pain that I write this. Fredrik has left us 
> > suddenly. 
> > 
> > """ 
> > 
> > A core dev wrote: "I felt privileged to be able to study Fredrik's 
> > code and to read his writing. He was a huge asset to our community in 
> > the early days. I enjoyed his sense of humor as well. I'm sad that he 
> > passed away." 
> > 
> > We will miss him. 
> > 
> 
> -- 
> "Your scientists were so preoccupied with whether they could, they didn't 
> stop to think if they should" 
> -- Dr. Ian Malcolm

Thanks for passing on this sad news. Effbot was one of the luminaries when
I started writing Python (v1.4/v1.52 times). I still have his 'standard library'
book, as well as being a user of PIL/Pillow.

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


Re: Sad news: Fredrik Lundh ("Effbot") has passed away

2021-12-13 Thread jkn
On Sunday, December 12, 2021 at 2:01:19 PM UTC, Skip Montanaro wrote:
> Like many others, I'm saddened to hear of Fredrik Lundh's passing. I 
> vaguely recall meeting him just once, probably at a Python workshop, 
> before they grew big enough to be called conferences. Effbot.org was 
> my Tkinter, ElemenTree, and PIL reference and cheat sheet. 
> 
> My attention to Python development has waxed and waned over the years. 
> Most of the time, the trip through the Python folder in my mail 
> program was generally pretty quick, hitting the 'd' key far more often 
> than I'd stop to read a message. There are only a few people whose 
> messages I'd always read. Effbot was one. In my opinion, Fredrik ranks 
> up there with Guido, Tim Peters and Barry Warsaw. 
> 
> I went to effbot.org and saw the "on hiatus" message. Searching 
> through The Wayback Machine, it seems it went on hiatus in late 
> November, 2020. The 11 November 2020 snapshot appears to be the last 
> usable version: 
> 
> https://web.archive.org/web/2020145627/http://effbot.org/ 
> 
> Probably worth a bookmark in your browser. 
> 
> Rest easy /F ... 
> 
> Skip

I hadn't realised effbot.org was 'on hiatus'. Yes, definitely worth
bookmarking The Wayback Machine backup - or even (someone?)
making a separate archive?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PermissionError: [Errno 13] Permission denied: 'Abc.xlsx'

2022-02-09 Thread jkn
On Wednesday, February 9, 2022 at 12:46:49 PM UTC, Christian Gollwitzer wrote:
> Am 09.02.22 um 08:46 schrieb NArshad:
> > When I enter data using Tkinter form in an Excel file when the excel file 
> > is closed there is no error but when I enter data using Tkinter form when 
> > the excel is already open following error comes:
> > PermissionError: [Errno 13] Permission denied: 'Abc.xlsx' 
> > 
> > 
> > 
> > What to do to correct this error? I have already searched on google search 
> > many times but no solution was found.
> It's impossible. Excel locks the file deliberately when it is open, so 
> that you can't overwrite it from a different program. Otherwise, the 
> file could become inconsistent. 
> 
> The correct way to handle it in the GUI is to tell the user via a 
> message box that the file is open and can't be written. 
> 
> An alternative to writing the file directly would be that you remote 
> control Excel; I think it provides a DDE API: 
> https://support.microsoft.com/en-us/office/dde-function-79e8b21c-2054-4b48-9ceb-d2cf38dc17f9
>  
> 
DDE? Wow, that takes me back...
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Any ReST aware editors?

2016-09-22 Thread jkn
Hi Steve

On Thursday, September 22, 2016 at 12:13:16 PM UTC+1, Steve D'Aprano wrote:
> I have editors which will use syntax highlighting on .rst files, but I'm
> hoping for something a bit smarter.
> 
> What I'd like is an editor with a split window, one side showing the rst
> that I can edit, the other side showing the formatted text updated as I
> type. (Or at least, updated every thirty seconds or so.)
> 
> Anybody know anything like that?

I am not certain, but I am pretty sure that the Leo 'outlining' editor (written 
in Python) allows you to do just that, via its 'viewrendered' plugin.

Leo is an extremely capable editor which can work in a 'scripts + data' manner; 
you can write 'code as data' and intersperse this with Python code which acts 
on the data. FWIW this brief description barely begins to scratch the 
surface

Leo is cross-platform and open source; its main developer, Ed Ream, is very 
responsive to suggestions and feedback

http://leoeditor.com/

There is also a 'leo-editor' Google Groups

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


Re: [ANN] pdfposter 0.7

2018-06-25 Thread jkn
On Sunday, June 24, 2018 at 10:02:05 PM UTC+1, Hartmut Goebel wrote:
> I'm pleased to announce pdftools.pdfposter 0.7, a tool to scale and
> tile PDF images/pages to print on multiple pages.
> 
> :Homepage: https://pdfposter.readthedocs.io/
> :Author:   Hartmut Goebel 
> :Licence:  GNU Public Licence v3 (GPLv3)
> 
> :Quick Installation:
>     pip install -U pdftools.pdfposter
> 
> :Tarballs:  https://pypi.org/project/pdftools.pdfposter/#files
> 
> 
> What is pdfposter?
> 
> 
> Scale and tile PDF images/pages to print on multiple pages.
> 
> ``Pdfposter`` can be used to create a large poster by building it from
> multiple pages and/or printing it on large media. It expects as input a
> PDF file, normally printing on a single page. The output is again a
> PDF file, maybe containing multiple pages together building the
> poster.
> The input page will be scaled to obtain the desired size.
> 
> This is much like ``poster`` does for Postscript files, but working
> with PDF. Since sometimes poster does not like your files converted
> from PDF. :-) Indeed ``pdfposter`` was inspired by ``poster``.
> 
> For more information please refer to the manpage or visit
> the `project homepage `_.
> 
> 
> What's new in version 0.7
> ---
> 
> * Incompatible change: `DIN lang` and `Envelope No. 10` are now defined as
>   landscape formats.
> 
> * New options ``-f``/``--first`` and ``-l``/``--last`` for specifying the
>   first resp. last page to convert
> 
> * Reduce the size of the output file a lot. Now the output file is
>   nearly the same size as the input file. While this behaviour was
>   intended from the beginning, it was not yet implemented for two
>   reasons: The content was a) copied for each print-page and b) not
>   compressed.
> 
> * Make the content of each page appear only once in the output file.
>   This vastly reduces the size of the output file.
> 
> * Compress page content. Now the output file is nearly the same size
>   as the input file in much more cases. I thought, the underlying
>   library will do this automatically, but it does not.
> 
> * Fix bug in PDF code used for clipping the page content. Many thanks
>   to Johannes Brödel for reporting this bug.
> 
> * Add support for Python 3.
> 
> * Use `PyPFDF2` instead of the unmaintained `pyPDF`.
> 
> -- 
> Regards
> Hartmut Goebel
> 
> | Hartmut Goebel  | [email protected]   |
> | www.crazy-compilers.com | compilers which you thought are impossible |

Thank you, that looks useful to me.

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


Re: Python for beginners or not? [was Re: syntax difference]

2018-06-25 Thread jkn
On Monday, June 25, 2018 at 12:17:29 PM UTC+1, Paul  Moore wrote:
> On 25 June 2018 at 11:53, Steven D'Aprano
>  wrote:
> 
> > And the specific line you reference is *especially* a joke, one which
> > flies past nearly everyone's head:
> >
> > There should be one-- and preferably only one --obvious way to do it.
> >
> >
> > Notice the dashes? There are *two* traditional ways to use an pair of em-
> > dashes for parenthetical asides:
> >
> > 1. With no space--like this--between the parenthetical aside and the text;
> >
> > 2. With a single space on either side -- like this -- between the aside
> > and the rest of the text.
> >
> > Not satisfied with those two ways, Tim invented his own.
> >
> >
> > https://bugs.python.org/issue3364
> >
> >
> > (Good grief, its been nearly ten years since that bug report. I remember
> > it like it was yesterday.)
> 
> Thank you for that bit of history! I never knew that (and indeed had
> missed that part of the joke). Tim's contributions to Python are
> always to be treasured :-)
> 
> Paul

Goodness, I too had missed that particular (admittedly subtle) joke, and I have
an interest in orthography and typesetting etc. (as well as pedanticism ;-o).

Yes, Tim Peters' contribution to python, and this newsgroup in days of yore,
were to be treasured. Luckily the wisdom and measured tone he and other early
pioneers modelled are (mostly) still with us here on comp.lang.python.

Jon N (here since 1999 or so...)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python for beginners or not? [was Re: syntax difference]

2018-06-25 Thread jkn
On Monday, June 25, 2018 at 4:23:57 PM UTC+1, Chris Angelico wrote:
> On Mon, Jun 25, 2018 at 11:15 PM, jkn  wrote:
> > (as well as pedanticism ;-o).
> 
> Pedantry.
> 
> ChrisA
> (You know I can't let that one pass.)

I was chanel[l]ing the TimBot, as any fule kno...
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [ANN] pdfposter 0.7

2018-06-26 Thread jkn
  To: Hartmut Goebel
From: jkn 

On Sunday, June 24, 2018 at 10:02:05 PM UTC+1, Hartmut Goebel wrote:
> I'm pleased to announce pdftools.pdfposter 0.7, a tool to scale and
> tile PDF images/pages to print on multiple pages.
>
> :Homepage: https://pdfposter.readthedocs.io/
> :Author:Γ Γ  Hartmut Goebel 
> :Licence:Γ  GNU Public Licence v3 (GPLv3)
>
> :Quick Installation:
> Γ Γ Γ  pip install -U pdftools.pdfposter
>
> :Tarballs:Γ  https://pypi.org/project/pdftools.pdfposter/#files
>
>
> What is pdfposter?
> 
>
> Scale and tile PDF images/pages to print on multiple pages.
>
> ``Pdfposter`` can be used to create a large poster by building it from
> multiple pages and/or printing it on large media. It expects as input a
> PDF file, normally printing on a single page. The output is again a
> PDF file, maybe containing multiple pages together building the
> poster.
> The input page will be scaled to obtain the desired size.
>
> This is much like ``poster`` does for Postscript files, but working
> with PDF. Since sometimes poster does not like your files converted
> from PDF. :-) Indeed ``pdfposter`` was inspired by ``poster``.
>
> For more information please refer to the manpage or visit
> the `project homepage <https://pdfposter.readthedocs.io/>`_.
>
>
> What's new in version 0.7
> ---
>
> * Incompatible change: `DIN lang` and `Envelope No. 10` are now defined as
> Γ  landscape formats.
>
> * New options ``-f``/``--first`` and ``-l``/``--last`` for specifying the
> Γ  first resp. last page to convert
>
> * Reduce the size of the output file a lot. Now the output file is
> Γ  nearly the same size as the input file. While this behaviour was
> Γ  intended from the beginning, it was not yet implemented for two
> Γ  reasons: The content was a) copied for each print-page and b) not
> Γ  compressed.
>
> * Make the content of each page appear only once in the output file.
> Γ  This vastly reduces the size of the output file.
>
> * Compress page content. Now the output file is nearly the same size
> Γ  as the input file in much more cases. I thought, the underlying
> Γ  library will do this automatically, but it does not.
>
> * Fix bug in PDF code used for clipping the page content. Many thanks
> Γ  to Johannes Br─╢del for reporting this bug.
>
> * Add support for Python 3.
>
> * Use `PyPFDF2` instead of the unmaintained `pyPDF`.
>
> --
> Regards
> Hartmut Goebel
>
> | Hartmut Goebel  | [email protected]   |
> | www.crazy-compilers.com | compilers which you thought are impossible |

Thank you, that looks useful to me.

Jon N

--- BBBS/Li6 v4.10 Toy-3
 * Origin: Prism bbs (1:261/38)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python for beginners or not? [was Re: syntax difference]

2018-06-26 Thread jkn
  To: Paul Moore
From: jkn 

On Monday, June 25, 2018 at 12:17:29 PM UTC+1, Paul  Moore wrote:
> On 25 June 2018 at 11:53, Steven D'Aprano
>  wrote:
>
> > And the specific line you reference is *especially* a joke, one which
> > flies past nearly everyone's head:
> >
> > There should be one-- and preferably only one --obvious way to do it.
> >
> >
> > Notice the dashes? There are *two* traditional ways to use an pair of em-
> > dashes for parenthetical asides:
> >
> > 1. With no space--like this--between the parenthetical aside and the text;
> >
> > 2. With a single space on either side -- like this -- between the aside
> > and the rest of the text.
> >
> > Not satisfied with those two ways, Tim invented his own.
> >
> >
> > https://bugs.python.org/issue3364
> >
> >
> > (Good grief, its been nearly ten years since that bug report. I remember
> > it like it was yesterday.)
>
> Thank you for that bit of history! I never knew that (and indeed had
> missed that part of the joke). Tim's contributions to Python are
> always to be treasured :-)
>
> Paul

Goodness, I too had missed that particular (admittedly subtle) joke, and I have
 an interest in orthography and typesetting etc. (as well as pedanticism ;-o).

Yes, Tim Peters' contribution to python, and this newsgroup in days of yore,
were to be treasured. Luckily the wisdom and measured tone he and other early
pioneers modelled are (mostly) still with us here on comp.lang.python.

Jon N (here since 1999 or so...)

--- BBBS/Li6 v4.10 Toy-3
 * Origin: Prism bbs (1:261/38)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python for beginners or not? [was Re: syntax difference]

2018-06-26 Thread jkn
  To: Chris Angelico
From: jkn 

On Monday, June 25, 2018 at 4:23:57 PM UTC+1, Chris Angelico wrote:
> On Mon, Jun 25, 2018 at 11:15 PM, jkn  wrote:
> > (as well as pedanticism ;-o).
>
> Pedantry.
>
> ChrisA
> (You know I can't let that one pass.)

I was chanel[l]ing the TimBot, as any fule kno...

--- BBBS/Li6 v4.10 Toy-3
 * Origin: Prism bbs (1:261/38)
-- 
https://mail.python.org/mailman/listinfo/python-list


Feasibility of console based (non-Gui) Tkinter app which can accept keypresses?

2018-07-11 Thread jkn
Hi All
This is more of a Tkinter question rather than a python one, I think, but
anyway...

I have a Python simulator program with a Model-View_Controller architecture. I
have written the View part using Tkinter in the first instance; later I plan
to use Qt.

However I also want to be able to offer an alternative of a console-only
operation. So I have a variant View with the beginnings of this.

Naturally I want to keep this as similar as possible to my Tkinter-based view. I
had thought that I had seen a guide somewhere to using Tk/Tkinter in a non-GUI
form. I don't seem to be able to track this down now, but I have at least been
successful in hiding ('withdrawing') the main Frame, and running a main loop.

The bit which I am now stumbling on is trying to bind key events to my view,
and I am wondering if this actually makes any sense. In the absence of a GUI I
want to accept keypresses to control the simulation. But in a console app I will
have no visible or in focus window, and therefore at what level would any
keys be bound? Not at the widget level, nor the frame, and I am not sure if the
the root makes sense either.

So I am looking for confirmation of this, and/or whether there is any way of
running a Tkinter application in 'console' mode, running a main loop and
both outputting data and accepting, and acting on, key presses.

Thanks
J^n




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


Re: Feasibility of console based (non-Gui) Tkinter app which can accept keypresses?

2018-07-12 Thread jkn
Hi All
thanks for the comments and confirmation that this is not really possible 
in a
Tkinter environment.

I had thought of using ncurses but was shying clear of learning about another 
set
of widgets etc. just now. The output of the simulator is simple enough that it
could just accept simple keystrokes for control, and every second or so there 
will
be an output string saying what is happening - a sort of concatenation of the
various output widgets in the Tkinter-based version.

I have hoped to keep this text view so similar to the Tkinter one that it was
using the same mechanisms (after(), Tk keyevents etc). Instead I think I will
just write a simple mainloop() which is 'inspired by' Tkinter. I could then
look at adding ncurses as a third alternative.

Thanks again
J^n
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: So apparently I've been banned from this list

2018-10-01 Thread jkn
On Monday, October 1, 2018 at 6:57:30 PM UTC+1, Ethan Furman wrote:
> On 09/30/2018 09:30 AM, Steven D'Aprano wrote:
> 
> > Notwithstanding Ethan's comment about having posted the suspension notice
> > on the list, I see no sign that he actually did so.
> 
> My apologies to you and the list.  I did indeed only send the notice to 
> the other moderators.
> 
> Contrary to what you and others may believe, banning/suspending people 
> is not a gleeful, stress-free activity.  None of us like to do it.  Also 
> contrary to what you and others seem to believe, I did not make those 
> decisions by myself.
> 
> As far as challenging the ban, I think the first step would be talking 
> to the CoC working group:
> 
>conduct-wg at python.org
> 
> If you don't like that answer, the next (and final, as far as I'm aware) 
> stop would be the PSF.
> 
> I have updated the filter that should be catching your posts, so 
> hopefully the suspension is now working properly.  Since you did choose 
> to ignore the ban, the two-month period restarts now.
> 
> --
> ~Ethan~
> Python List Moderator

As a reader of /occasional contributor to, this newsgroup (via GG, admittedly)
since around the year 2000, I for one am mightily unimpressed with this.
There's a lot of heavy-handedness going around.

And then ... you make a mistake, and then restart the ban?? Sheesh, where has
happened to the the grown-up behaviour that c.l.python has always had?
That has been one of its hallmarks for the past nearly twenty years.

I'm not going to go as far as to agree with anything RR says on the matter - 
but c'mon guys, lighten up.

Jon N 


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


Re: real time FM synthesizer

2016-04-13 Thread jkn
Hi Irmen

On Wednesday, April 13, 2016 at 12:22:25 AM UTC+1, Irmen de Jong wrote:
> It seems that Python is fast enough [1] to create a real time FM music 
> synthesizer
> (think Yamaha DX-7). I made one that you can see here:
>   https://github.com/irmen/synthesizer
> 
> The synthesizer can create various waveforms (sine, sawtooth, pulse etc.) and 
> lets you
> modify them in various ways. You can apply FM (frequency modulation), PWM 
> (pulse-width
> modulation), volume envelopes, vibrato, and reverb/echo. It is primarily 
> based around
> oscillators that are represented as generator functions in the code.
> A GUI is provided that gives access to most of the features interactively, 
> and lets you
> play a tune with your created FM instrument on a piano keyboard.
> 
> You will need Python 3.x and pyaudio to be able to hear sound, and matplotlib 
> if you
> want to see graphical diagrams of generated waveforms.
> 
> I can't create nice music myself but this was a fun project to build and to 
> learn how FM
> synthesizers work internally :)
> 
> 
> 
> Irmen
> 
> 
> [1]: meaning it can generate and play fairly complex waveforms based on 
> multiple
> oscillators and filters in real time in one 44.1 kHz audio channel. That is 
> on a 3.2 ghz
> machine.  With enough oscillator/filters combined however it starts to 
> stutter and
> cannot do it anymore in real time. However you can still generate those 
> waveforms and
> save them to a .wav on disk to play afterwards.  The code only uses one CPU 
> core though
> so maybe there's room for improvement.

This looks fantastic - I am sure I can have a lot of fun with this. Thanks for 
publicising.

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


what considerations for changing height of replacement radiator?

2019-01-30 Thread jkn
Hi all
I'm looking at changing a radiator in a bedroom shortly and wondering about
my options re. sizing.

The current radiator is 900mm W x 600mm H, and is single panel, no convector. So
looking at some representative specs, let's say 550W output.

I would be replacing this with a single panel, single convector radiator. From
looking at the spec again, the same sized radiator gives around 50% greater
output - 900W.

I am wondering about fitting a 900mm W x 450mm H single panel, single convector,
which would then reduce the output again to 700W or so, similar to the original.

My reason for doing this would simply be 'neater appearance' of the smaller
radiator, but it wouldn't be a problem if the replacement was the same size as
the original. I am wondering if there is anything else (apart from power output)
that I should be considering here?

The radiator will be under a window and the CH is an olde school 'plan C', I
think. I would probably fit a TRV in any case. There is no need to heat the room
any better than currently...

Thanks for any advice.

Cheers
Jon N
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: what considerations for changing height of replacement radiator?

2019-01-30 Thread jkn
All very droll, thanks for the replies guys. I spotted my posting error 0.0001 
secs after pressing the button...

uk.d-i-y-is-that-way-ly yours
J^n
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there an archive of this list with permanent URLs to each message?

2019-06-18 Thread jkn
On Monday, June 17, 2019 at 10:28:44 AM UTC+1, Luciano Ramalho wrote:
> Hello! When I wrote Fluent Python a few years ago I provided my
> readers with hundreds of links to my sources, including several links
> to messages in the python-list archive.
> 
> Now as I prepare the 2nd edition I notice all my links to this list
> are broken. Apparently mailman rebuilds the archives and changes the
> ids of the messages.
> 
> Is there an archive of python-list that preserves each message with a
> permanent URL?
> 
> Thanks!
> 
> Luciano
> 
> PS. For the curious, here is an instance of the problem. The message
> currently at:
> 
> https://mail.python.org/pipermail/python-list/2009-February/525280.html
> 
> Used to be at this URL:
> 
> https://mail.python.org/pipermail/python-list/2009-February/538048.html
> 
> 
> 
> -- 
> Luciano Ramalho
> |  Author of Fluent Python (O'Reilly, 2015)
> | http://shop.oreilly.com/product/0636920032519.do
> |  Technical Principal at ThoughtWorks
> |  Twitter: @ramalhoorg

A second edition? Curses, just after I recently bought a copy of the first 
edition ;-o ...

(It's a very good book BTW - thanks!)

J^n
-- 
https://mail.python.org/mailman/listinfo/python-list


Suggestions on mechanism or existing code - maintain persistence of file download history

2020-01-29 Thread jkn
Hi all
I'm almost embarrassed to ask this as it's "so simple", but thought I'd give
it a go...

I want to be a able to use a simple 'download manager' which I was going to 
write
(in Python), but then wondered if there was something suitable already out 
there.
I haven't found it, but thought people here might have some ideas for existing 
work, or approaches.

The situation is this - I have a long list of file URLs and want to download 
these
as a 'background task'. I want this to process to be 'crudely persistent' - you
can CTRL-C out, and next time you run things it will pick up where it left off.

The download part is not difficult. Is is the persistence bit I am thinking 
about.
It is not easy to tell the name of the downloaded file from the URL.

I could have a file with all the URLs listed and work through each line in turn.
But then I would have to rewrite the file (say, with the previously-successful
lines commented out) as I go.

I also thought of having the actual URLs as filenames (of zero length) in a
'source' directory. The process would then look at each filename in turn, and
download the appropriate URL. Then the 'filename file' would either be moved to
a 'done' directory, or perhaps renamed to something that the process wouldn't
subsequently pick up.

But I would have thought that some utility to do this kind of this exists 
already. Any pointers? Or any comments on the above suggested methods?

Thanks
J^n

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


Re: Suggestions on mechanism or existing code - maintain persistence of file download history

2020-01-29 Thread jkn
On Wednesday, January 29, 2020 at 8:27:03 PM UTC, Chris Angelico wrote:
> On Thu, Jan 30, 2020 at 7:06 AM jkn  wrote:
> >
> > Hi all
> > I'm almost embarrassed to ask this as it's "so simple", but thought I'd 
> > give
> > it a go...
> 
> Hey, nothing wrong with that!
> 
> > I want to be a able to use a simple 'download manager' which I was going to 
> > write
> > (in Python), but then wondered if there was something suitable already out 
> > there.
> > I haven't found it, but thought people here might have some ideas for 
> > existing work, or approaches.
> >
> > The situation is this - I have a long list of file URLs and want to 
> > download these
> > as a 'background task'. I want this to process to be 'crudely persistent' - 
> > you
> > can CTRL-C out, and next time you run things it will pick up where it left 
> > off.
> 
> A decent project. I've done this before but in restricted ways.
> 
> > The download part is not difficult. Is is the persistence bit I am thinking 
> > about.
> > It is not easy to tell the name of the downloaded file from the URL.
> >
> > I could have a file with all the URLs listed and work through each line in 
> > turn.
> > But then I would have to rewrite the file (say, with the 
> > previously-successful
> > lines commented out) as I go.
> >
> 
> Hmm. The easiest way would be to have something from the URL in the
> file name. For instance, you could hash the URL and put the first few
> digits of the hash in the file name, so
> http://some.domain.example/some/path/filename.html might get saved
> into "a39321604c - filename.html". That way, if you want to know if
> it's been downloaded already, you just hash the URL and see if any
> file begins with those digits.
> 
> Would that kind of idea work?
> 
> ChrisA

Hi Chris
Thanks for the idea. I should perhaps have said more clearly that it is not
easy (though perhaps not impossible) to infer the name of the downloaded data
from the URL - it is not a 'simple' file URL, more of a tag.

However I guess your scheme would work if I just hashed the URL and created
a marker file - "a39321604c.downloaded" once downloaded. The downloaded content
would be separately (and somewhat opaquely) named, but that doesn't matter.

MRAB's scheme does have the disadvantages to me that Chris has pointed out.

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


Re: Suggestions on mechanism or existing code - maintain persistence of file download history

2020-01-30 Thread jkn
Err, well, thanks for that discussion gents...

As it happens I do know how to use a database, but I regard it as overkill for
what I am trying to do here. I think a combination of hashing the URL,
and using a suffix to indicate the result of previous downloaded attempts, will
work adequately for my needs.

Thanks again
Jon N

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


Re: Suggestions on mechanism or existing code - maintain persistence of file download history

2020-01-31 Thread jkn
On Friday, January 31, 2020 at 9:41:32 AM UTC, R.Wieser wrote:
> jkn,
> 
> > I think a combination of hashing the URL,
> 
> I hope you're not thinking of saving the hash (into the "done" list) instead 
> if the URL itself.   While hash collisions do not happen often (especially 
> not in a small list), you cannot rule them out.  And when that happens that 
> would mean you would be skipping downloads ...
> 
> Regards,
> Rudy Wieser

I'm happy to consider the risk and choose (eg.) the hash function accordingly, 
thanks.

Jon N

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


Re: Suggestions on mechanism or existing code - maintain persistence of file download history

2020-01-31 Thread jkn
On Friday, January 31, 2020 at 9:41:32 AM UTC, R.Wieser wrote:
> jkn,
> 
> > I think a combination of hashing the URL,
> 
> I hope you're not thinking of saving the hash (into the "done" list) instead 
> if the URL itself.   While hash collisions do not happen often (especially 
> not in a small list), you cannot rule them out.  And when that happens that 
> would mean you would be skipping downloads ...
> 
> Regards,
> Rudy Wieser

Hi Rudy

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


Re: Could anyone write a small program to log the Signal-to-Noise figures for a Netgear DG834 router?

2005-07-19 Thread jkn
Hi Chris

> Could anyone write a small program to log the Signal-to-Noise figures
> for a Netgear DG834 router?
>

many people could, I'm sure, if not quite _anyone_

> I have been getting very variable SNR readings - and I would like to
> collect some evidence to analyse.

I see.

>
> What is needed is a program that logs into the router's html page every
> minute, and then extracts the time and the SNR figure, and writes a line
> of a text file.

Good, you've got the 'top level' of what you need. How would you break
that down into smaller steps?

>
> I reckon it would be useful to many people.

great - thanks!

Jon N

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


Re: Parallel port programming on windows XP/2000?

2005-08-03 Thread jkn

Novice Experl wrote:
> I'd like to write a simple application that interfaces with the parallel 
> port, and changes the data on it according to keyboard input. I hope I can 
> get it to run under windows xp and / or windows 2000.
>
> How can I do this? What do I need to know? It doesn't look like the standard 
> library (the one under my pillow) has that feature. In addition, I've heard 
> that with newer versions of windows don't let you communicate with the port 
> directly, instead requiring interfacing with some driver?
>
> I came across this:
> http://pyserial.sourceforge.net/pyparallel.html
> but it seems to only be used for direct access (would it work with XP?), and 
> hasn't been updated for a couple of years. In addition, it requires something 
> called  "Java Communications" (JavaComm) extension for Java/Jython, doesn't 
> provide a link to it, and when I google it - google returns the page I came 
> from!
>
> To add to the confusion, I hope I can provide a py2exe executable of my 
> script instead of forcing a complete installation.
>
>
> --=  Posted using GrabIt  =
> --=  Binary Usenet downloading made easy =-
> -=  Get GrabIt for free from http://www.shemes.com/  =-

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


How to pickling VT_DATE values?

2005-03-23 Thread jkn
Hi all
this is my first go at pickling and I'm having trouble with
variables of type VT_DATE returned from a COM application.

I don't seem to be successfully pickling/depickling to the the same
value. I think this may be due to a strange return value. The VT_DATE
seems to be a floating point number 'days.(hours, seconds) since
midnight 30 December 1899'. in some cases I get a value (probably 0.0?)
which is printed as

'12/30/0/ 00:00:00'

and I wonder if this strange value is causing the depickling to fail.
Haven't yet followed this to ground...

Anyway, I'm sure someone out there has successfully pickled such values
and wondered how it was done. FWIW my current code is:


import pywintypes
import pythoncom

import copy_reg
def picklePyTime(o):
return unpicklePyTime, (float(o),)

def unpicklePyTime(po):
return pywintypes.Time(po)

copy_reg.pickle(pythoncom.PyTimeType, picklePyTime)



Thanks
jon N

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


Re: The Spirit of Python

2013-11-14 Thread jkn
On Thursday, November 14, 2013 6:11:08 PM UTC, Roy Smith wrote:
> https://twitter.com/dabeaz/status/400813245532876800/photo/1
> 
> 
> "Now THIS is a Python book I should get.  I'm guessing it's about design 
> patterns. Or maybe just the GIL. "
> 

Excellent, thanks fro the link. And is that a book by Ethan Furman next to it??

J^n

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


Re: Oh look, another language (ceylon)

2013-11-17 Thread jkn
Hi Stephen

On Sunday, 17 November 2013 05:48:58 UTC, Steven D'Aprano  wrote:

> [...]

> 
> > It's just a pity they based the syntax on C rather than something more
> > enlightened. (Why do people keep doing that when they design languages?)
> 
> 
> When the only tool you've used is a hammer, every tool you design ends up 
> looking like a hammer.
> 
> 

true, and yet ... if [I] were to design a hammer, would you be justified in 
assuming that that is the only tool I know about?

J^n
-- 
https://mail.python.org/mailman/listinfo/python-list


use Python and an outlook: protocol URL to bring up a specific email

2016-01-12 Thread jkn
Hi all
a little OS/windows specific, I'm afraid:

In Windows, there exists a part-supported 'outlook protocol' to obtain and use
email references within Outlook as URL. You have to go through various 
shenanagins to enable this and to get Outlook to give you access to the URLs - 
see for instance:

http://www.slipstick.com/problems/outlook-missing-outlook-protocol/
http://superuser.com/questions/834019/using-outlook-protocol-open-current-instance-of-outlook-not-new-instance
http://www.davidtan.org/create-hyperlinks-to-outlook-messages-folders-contacts-events/

Having gone through all of this I get a refernce URL on my clipboard or 
whatever:

"outlook:BB1BBDFACA3A4D41A98037A1D85A8DA50700E6FBFC004227134D97632785EE69C220003C0208DEA1DAC09B3B9C648E4597BE2A013A6E8B8426F87CCA"

(This refers to a particular email in Outlook)

What I want to do is then use Python to invoke this URL to cause Outlook to
bring up the referenced email. I'm stumbling here; I've tried urllib.urlopen(),
and os.startfile(), but I am getting errors from urllib in either case:

def open_unknown(self, fullurl, data=None):
"""Overridable interface to open unknown URL type."""
type, url = splittype(fullurl)
raise IOError, ('url error', 'unknown url type', type)

ie. the 'outlook' protocol is unknown. 

I happy to carve some code without using urllib, but I am not clear what I
actually need to do to 'open' such a URL using this protocol. FWIW I can paste
this URL into Windows Explorer and I get the referenced email popping up ;-)

Thanks for any pointers

Regards
Jon N

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


Re: use Python and an outlook: protocol URL to bring up a specific email

2016-01-12 Thread jkn
Hi Chris

On Tuesday, January 12, 2016 at 5:11:18 PM UTC, Chris Angelico wrote:
> On Wed, Jan 13, 2016 at 3:51 AM, jkn  wrote:
> > I happy to carve some code without using urllib, but I am not clear what I
> > actually need to do to 'open' such a URL using this protocol. FWIW I can 
> > paste
> > this URL into Windows Explorer and I get the referenced email popping up ;-)
> >
> 
> What happens if you invoke the 'start' command using subprocess?
> 
> subprocess.check_call(["start", url])
> 
> In theory, that should be equivalent to pasting it into Explorer. In theory.
> 
> ChrisA

I'll try that, but (typically!) I found some things that worked shortly after
posting... 

These both work:

PROTOCOL = "outlook:"
TEST_URL = "BB1BBDFACA3A... 8426F87CCA" # elided for example

import os
os.startfile(PROTOCOL + TEST_URL, 'open')   # second parameter not needed

# and
import win32api
win32api.ShellExecute(0, 'open', PROTOCOL + TEST_URL, "", "", 0)


I thought I had already tried the first one, not sure what happened.

Sorry for the noise...

Cheers
Jon N



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


FYI: Micro Python running on kickstarter pyBoard project, now shipping

2014-10-23 Thread jkn
Hi all
I haven't heard in mentioned here, but since I saw one of the boards today 
thought I'd pass on the news:

The Kickstarter 'MicroPython' project, which has a tiny 'pyboard' (only a 
couple of sq.inches in size) with a processor running 'a complete re-write of 
the Python (version 3.4) programming language so that it fits and runs on a 
microcontroller' is now shipping.

https://micropython.org/

Looks nice; I have no connection but will be getting one myself to play with...

Cheers
J^n
-- 
https://mail.python.org/mailman/listinfo/python-list


OTish: using short-term TCP connections to send to multiple slaves

2014-11-16 Thread jkn
Hi all
This is a little bit OT for this newsgroup, but I intend to use python 
for prototyping at least, and I know there are a lot of knowledgeable 
people using Python in a Network context here...

I have a use case of a single 'master' machine which will need to 
periodically 'push' data to a variety of 'slave' devices on a small local 
subnet, over Ethernet. We are talking perhaps a dozen devices in all with 
comms occurring perhaps once very few seconds, to much less often - once per 
half an hour, or less. There is probably an upper bound of 64KB or so of 
data that is likely to be sent on each occasion.

Previous similar systems have attempted to do this by maintaining multiple 
long-term TCP connections from the master to all the slave devices. The 
Master is the server and the slaves periodically check the master to see 
what has changed. Although this ... works ..., we have had trouble 
maintaining the connection, for reasons ... I am not yet fully aware of.

We are now considering an alternative approach where the master maintains a 
list of slave devices and acts as a client. Each device is a server from the 
point of view of data transfer. We would then use a short-lived TCP 
connection when data is available; the Master would connect to each slave 
which needed the data, send it, and close the connection.

I should also add that we desire our system to be 'robust' in the face of 
situations such as cable unplugging, device power cycles, etc.

Although this might get round some of our current problems, I can see that 
we might end up with new problems to deal with. I am wondering if this 
scenario rings bells with anyone, and seeking pointers to what has been done 
elsewhere. As I say, I am expecting to prototype it in Python so any 
specifics also welcome!

(suggestions as to a better forum to ask for previous experience also 
gratefully received)

Thanks al lot for any thoughts/suggestions

Jon N

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


Re: OTish: using short-term TCP connections to send to multiple slaves

2014-11-16 Thread jkn
Hi All
Thanks for the various and interesting responses so far. A bit of 
fleshing out in a few areas:

The problems of maintaining the long-term TCP connection is something I'd 
like to leave to one side, for now at least. There are some non-technical 
project issues here which is why I am considering some alternatives. It may 
be that this gets revisited at a later date.

It is possible that the final deployment will, like the prototype, be 
written in Python; again, non-technical issues come into play here.

I use the term 'devices' a bit loosely; some of the 'slave' machines are 
fully-fledged and relatively powerful embedded machines running linux; some 
of them are simpler embedded machines running a scheduler-based system and a 
simple TCP/IP stack. The capability of the latter may be a consideration in 
the final design; they won't be running Python, for instance.

When a 'slave' (not necessarily acting in the client role, AFAICT) is 
unavailable, the behaviour should be that the data is lost, but that it 
should sync up to the next 'block' of data as soon as possible after 
(physical) reconnection, power up etc. An analogy might be with a master and 
multiple slave devices sharing a serial RS-485 bus,.

I have control over the format of the data to be send, so there can and 
should be some indication of the beginning and end of a data 'block'. In 
actual fact the data is very likely to be in JSON.

UDP has been mentioned but I am expecting the comms to be TCP-based, I 
think. The 65KB block size is indicative but I am reluctant to say that this 
is a hard limit.

Chris asks why the slave devices can't periodically connect to the master 
and request data. The reason is that it is unknown when data destined for a 
given slave will be available. The devices would need to connect perhaps 
once a second to get sufficient time resolution, and this seems over-
complicated to me at the moment.

(FWIW there will also have to be some (UDP?) transmission from the slaves to 
the master, for purposes of device discovery)

Thanks for the mention of SCTP; I was aware that there were other protocols 
to consider but haven't yet looked hard at them. One likely issue here is 
that our simpler devices won't be able to support such protocols 
straightforwardly.

I hope this gives sufficient background info to progress the discussion...

Cheers
Jon N
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Future of Pypy?

2015-02-22 Thread jkn
On Sunday, 22 February 2015 12:45:15 UTC, Dave Farrance  wrote:
> As an engineer, I can quickly knock together behavioural models of
> electronic circuits,  complete units, and control systems in Python, then
> annoyingly in a few recent cases, have to re-write in C for speed.
> 
> I've tried PyPy, the just-in-time compiler for Python, and that is
> impressively, hugely fast in comparison, but it's no good making these
> models if I can't display the results in a useful way, and at the moment
> PyPy just doesn't have the huge range of useful time-saving libraries that
> CPython has.  It's still quicker to do a re-write in the more cumbersome C
> than try to work with PyPy because C, like CPython, also has many useful
> libraries.
> 
> A few years back, I recall people saying that PyPy was going to be the
> future of Python, but it seems to me that CPython still has the lion's
> share of the momentum, is developing faster and has ever more libraries,
> while PyPy is struggling to get enough workers to even get Numpy
> completed.
> 
> Maybe there's not enough people like me that have really felt the need for
> the speed.  Or maybe it's simply the accident of the historical
> development path that's set-in-stone an interpreter rather than a JIT.
> Anybody got a useful perspective on this?

I'm curious what ...behavioural... models you are creating quickly in Python 
that then need rewriting in C for speed. SPICE? some other CAD? Might be 
interesting to learn more about what and how you are actually doing.

How about running your front end (simulation) work in PyPy, and the backend 
display work on CPython, if there are some missing features in PyPy that you 
need. This may be more or less easy depending on your requirements and any 
intermediate format you have.

Or you could offer to assist in the PyPy porting? Or express an interest in 
specific libraries being ported?

Cheers
Jon N

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


Re: Standard

2015-02-23 Thread jkn
On Sunday, 22 February 2015 14:11:54 UTC, Mark Lawrence  wrote:
> On 19/02/2015 16:27, Phillip Fleming wrote:
> > In my opinion, Python will not take off like C/C++ if there is no ANSI
> > standard.
> >
> 
> Python has already taken off because it doesn't have a standard as such.
> 

Bjarne Stroustrup, in 'The Design and Evolution of C++', says about the early 
days of C++ (or possibly, C with Classes), something to the effect that he knw 
that:

"C++ had to be a weed, that you left it for a year and came back and found it 
in twenty new places, rather than a rose that needed tending"

IMO Python has done very well being a similar kind of (very well behaved!) 
weed...

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


Re: which async framework?

2014-03-11 Thread jkn
Hi Grant

On Tuesday, 11 March 2014 16:52:18 UTC, Grant Edwards  wrote:

[...]
> 
> And don't bother with device drivers for the network adapters either.
> Just map their PCI regions in to user-space and twiddle the reigisters
> directly!  ;)
> 
> [I do that when testing PCI boards with C code, and one of these days
> I'm going to figure out how to do it with Python.]

Heh - just about the first 'real' thing I did in Python, back around 2001
or so, was to write a 'Device Driver' library to allow direct access to
memory-mapped I/O via Python. It compiled under both Windows and Linux
and I proved it using an ISA I/O board with loads of 8255s and LEDs
hanging off it.

As well as a learning exercise it was sort-of intended as a first step
toward robotic control using Python. I hopen to rework it for similar
PCI-based I/O boards (to do the sort of thing you mention), but never got
a round tuit...

Cheers
jon N
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: wil anyone ressurect medusa and pypersist?

2013-10-04 Thread jkn
On Thursday, 3 October 2013 21:48:35 UTC+1, [email protected]  wrote:
> On Thursday, May 16, 2013 11:15:45 AM UTC-7, [email protected] wrote:
> 
> > www.prevayler.org in python = pypersist
> 
> > 
> 
> > 
> 
> > 
> 
> > medusa = python epoll web server and ftp server eventy and async
> 
> 
> 
> wow interesting
> 
> 
> 
> sprevayler ??
> 
> 
> 
> cl-prevalence

Hmm - FWIW this looks a lot like it's from 'gavino', a troll-like entity on 
c.l.forth.

J^n
-- 
https://mail.python.org/mailman/listinfo/python-list


ePIPE exception received when other end can't send an RST - how come?

2013-10-09 Thread jkn
Hello there
I am experimenting with a simple python script which establishes a TCP 
connection, over GPRS, to a server. It then periodically sends a small block of 
data (60 bytes or so) to the server.

I then disconnect the GPRS antenna on this client machine (I am actually 
investigating the behaviour of an independant bit of C++ code; the python is 
really being used as a test bench).

What I then see is that the number of bytes in the socket's output buffer 
builds up, and I then get a ePIPE exception (~SIGPIPE signal) in my script.

Now my copy of Richard Steven's 'Unix Network programming' says:

‘when a process writes to a socket that has received an RST, the SIGPIPE signal 
is sent to the process’

My python code is very simple: something like:

{{{
# setup

gSock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
gSock.connect((IP_ADDR, IP_PORT))

p = MyPacket()
while 1:
try:
gSock.send(p)
except socket.error, e:
# display exception
except IOError, e
# ePIPE exception encountered here - but why?

time.sleep(15)

}}}

I am trying to understand how the ePIPE exception can occur, given my scenario, 
and whether it is due to my using Python, or might also be applicable to my C++ 
code. Surely, if I have disconnected the antenna, the server will have had no 
opportunity to send an RST? Is there another mechanism that might be causing 
the ePIPE?

I'm running Python 2.7.4 under x86 Kubuntu Linux, and python 2.4 on an embedded 
ARM Linux.

Thanks for any thoughts.

J^n



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


Re: Micropython?

2015-03-14 Thread jkn
On Saturday, 14 March 2015 06:43:18 UTC, Paul Rubin  wrote:
> http://www.micropython.org/
> 
> Has anyone used this?  Know anything about it?  I don't remember seeing
> any mention of it here.  I remember there was a stripped down Python
> some years back that didn't work very well, but I think this is
> different.  I just came across it by accident.  Thanks.

I started a short thread on it last year; search for "FYI: Micro Python running 
on kickstarter pyBoard project, now shipping"

Our Tech Support department have a few of the boards and seem happy with them. 
I don't know much about what they are being used for though. I'd like to have 
the time...

   J^n
-- 
https://mail.python.org/mailman/listinfo/python-list


Slightly OT: Seeking (python-based) project diary tool, or framework to write one

2015-05-19 Thread jkn
Hi All
as in the title, this is a little bit OT - but since ideally I'd like a
tool written in Python, and I know readers here have wide experience of
development/collaborative workflows etc ...

A few jobs ago the company I was with used a 'Project Diary' tool which I found
very useful. It was written in-house (in VB, I believe ;-o). I am looking for a
more widely available tool that gives similar features. 

It created and read a database which contained a series of projects. In this
context, a project was a discrete unit of development effort (eg. for a single
customer, say), and lasting from a couple of weeks to a year or more.

For each project you have a main view window which listed the 'items' in that
project. You could create a new item which was one of a large-ish number of
types. When you created a new item you were given the ability to edit a variety
of parameters, appropriate to the item type:

- info item:freeform text/HTML
- contact item: a form with email, telephone number fields
- datasheet item:   maybe a link to a PDF
- diary itemdated freeform
- task item had title & fields like 'completion date', 'completion
 percentage, etc.
- query item
- document refrence
- etc. etc.

(items could also be updated once created)

As a project develops, more and more items are added. There were sorting and
searchinf facilities to allow you to quickly find a particular item, and you
could generate custom reports based on seleted items, or date ranges,and so on.

I found this very useful and would like to find something similar, or create
something similar for my own purposes. I currently use an Excel spreadsheet
but this is a bit clunky. I am a moderately experienced Python programmer
(command line, Linux interfacing) but less experienced on the
Gui/framework/database side.

I would be interested in either pointers to something like this which might
already exists, or suggestions as to a framework that I might be able to use to
create something like this.

Other nice-to-haves for a possibly already-existing tool:

-   multiplatform
-   free, open source
-   written in Python
-   web-based probably OK.
-   extendible
-   etc. etc.

Thanks for your thoughts and any suggestions

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


Re: Slightly OT: Seeking (python-based) project diary tool, or framework to write one

2015-05-19 Thread jkn
Hi Rustom

On Tuesday, May 19, 2015 at 5:50:11 PM UTC+1, Rustom Mody wrote:
> On Tuesday, May 19, 2015 at 9:59:16 PM UTC+5:30, jkn wrote:
> > Hi All
> > as in the title, this is a little bit OT - but since ideally I'd like a
> > tool written in Python, and I know readers here have wide experience of
> > development/collaborative workflows etc ...
> 
> Occasionally the author of leo posts announcements out here
> http://leoeditor.com/
> 
> [Thats about as much as I know of it]

Thanks - actually, I'm pretty familiar with Leo, and it _might_ be bent a bit
to suit my needs ... but I am thinking of something a bit more 'traditional'
in appearance, at least.

Cheers
Jon N
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Slightly OT: Seeking (python-based) project diary tool, or framework to write one

2015-05-20 Thread jkn
Hi Frank

On Wednesday, 20 May 2015 06:33:33 UTC+1, Frank Millman  wrote:
> "jkn"  wrote in message 
> news:[email protected]...
> > Hi All
> >as in the title, this is a little bit OT - but since ideally I'd like a
> > tool written in Python, and I know readers here have wide experience of
> > development/collaborative workflows etc ...
> >
> 
> Have you looked at this one? -
> 
> http://taskcoach.org/
> 
> >From their home page -
> 
> "Task Coach is a simple open source todo manager to keep track of personal 
> tasks and todo lists. It is designed for composite tasks, and also offers 
> effort tracking, categories, notes and more."
> 
> 
> 
> There seems to be at least some overlap with your requirements, so it may be 
> worth a look.
> 
> 
> It uses wxPython. According to their download page it only works with Python 
> 2.x, but as wxPython for Python3 is getting closer, hopefully it is on their 
> roadmap to target Python3 as well.
> 
> Frank Millman

Yeah, I know about TaskCoach as well ;-/ (sorry, should have posted some of
these ... ). It is much more oriented towards _execution_ of projects than
tracking information about projects.

Having said that, it's a while since I looked at TaskCoach, and perhaps it has
changed or can be configured closer to what I have in mind. Thanks for the
reminder.

Cheers
Jon N
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python handles globals badly.

2015-09-10 Thread jkn
On Thursday, 10 September 2015 13:18:39 UTC+1, Steven D'Aprano  wrote:
> On Thu, 10 Sep 2015 05:18 am, Chris Angelico wrote:
> 
> > On Thu, Sep 10, 2015 at 5:14 AM, Laura Creighton  wrote:
> >> In a message of Thu, 10 Sep 2015 05:00:22 +1000, Chris Angelico writes:
> >>>To get started, you need some other sort of kick.
> >>
> >> Having Brian Kernighan write a really nice book about you, helps a lot.
> > 
> > It kinda does. And of course, it also helps to have a time machine, so
> > you can launch your language when there are less languages around.
> > Today, you compete for attention with myriad languages that simply
> > didn't exist when C was introduced to an unsuspecting world.
> 
> I don't think that's quite right. I think, if anything, there were more
> languages in the 1970s than now, it's just that they tended to be
> proprietary, maybe only running on a single vendor's machine. But even if
> I'm mistaken, I think that there is near-universal agreement that the
> single biggest factor in C's popularity and growth during the 1970s and 80s
> is that it was tied so intimately to Unix, and Unix was taking over from
> mainframes, VAX, etc.
> 
> 
> 
> -- 
> Steven

In 'The Design and Evolution of C++', Bjarne Stroustrup writes about a 
principle that was applied to C with classes (an early embodiment of C++):

"C with Classes has to be a weed like C or Fortran because we cannot afford to
take care of a rose like Algol68 or Simula. If we deliver an implementation and
go away for a year, we want to find several systems running when we come back.
That will not happen if complicated maintenance is needed or if a simple port
to a new machine takes longer than a week". (pp. 37)

I think the 'C is a weed' observation one is a good one to explain the
proliferation. I say this as a good thing, and as a programmer in C, C++ and 
Python.

Jon N



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


Re: Get named groups from a regular expression

2014-07-01 Thread jkn
On Tuesday, 1 July 2014 16:12:34 UTC+1, Florian Lindner  wrote:
> Hello,
> 
> 
> 
> Is there a way I can extract the named groups from a regular expression? 
> 
> e.g. given "(?P\d)" I want to get something like ["testgrp"].
> 
> 
> 
> OR
> 
> 
> 
> Can I make the match object to return default values for named groups, even 
> 
> if no match was produced?
> 
> 
> 
> Thanks,
> 
> Florian

If you can, my approach would to have a class which you use both to create
the regex (using group names), and return the names of the groups in the
regex you have created.

As I say, this might not be possible in your case though.

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


Re: This Python script cannot open by a editor?

2014-07-04 Thread jkn
Hi there
the script is 'actually' a python script compressed, with a short header 
(see the '#!/usr/bin/python' right at the front? I'm guessing that if you make 
it executable, and run it, then it will either create a .py file that you can 
edit, or just run the hdlmake function that you want.

This is not very well explained on the wiki page that you link to... you might 
also try downloading the alternative distributions on the download page.

HTH
jon N


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


Re: Keepin constants, configuration values, etc. in Python - dedicated module or what?

2014-09-30 Thread jkn
might this be of interest (though old)?

https://wiki.python.org/moin/ConfigParserShootout

Cheers
Jon N

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


Re: Language Enhancement Idea to help with multi-processing (your opinions please)

2011-10-13 Thread jkn
FWIW, this looks rather like the 'PAR' construct of Occam to me.

http://en.wikipedia.org/wiki/Occam_%28programming_language%29

J^n
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: First attempt at a Python prog (Chess)

2013-02-14 Thread jkn
Hi Chris

On Wednesday, 13 February 2013 23:25:09 UTC, Chris Hinsley  wrote:
> New to Python, which I really like BTW.

Welcome aboard! But aren't you supposed to be writing Forth? ;-)

Cheers
Jon N
 

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


Re: Python tools for managing static websites?

2006-10-31 Thread jkn
Hi there

I used cheetah (cheetahtemplate) and a makefile for something similar
;-). It worked pretty well for me. I only have a dozen or so pages
though.

I'm currently converting this to Jinja, which is a similar templating
system compatible with Django. I plan to later migrate to dynamic pages
under Django.

http://www.cheetahtemplate.org
http://wsgiarea.pocoo.org/jinja/

HTH
Jon N

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


Re: Is python for me?

2006-11-13 Thread jkn
Hi Carsten
>
> I'll run the risk of being nitpicky, but the full phrase is "Jack of all
> trades, master of none," which doesn't do Python justice. Python is a
> master of all trades!
>
FYI that's only *one* version of 'the full phrase'. I, for instance, am
a 'Jack of all trades, master of many'. I regard Python in the same
light ;-).

jon N

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


Tiddlywiki type project in Python?

2006-06-14 Thread jkn
Hi all
I'm trying out, and in general finding really useful, the various
TiddlyWiki variants that I guess many people here know about, for
organising my activities in a GTD way. One mild annoyance is in the
speed of the Javascript applications. I fancy having a go at writing
something like this for myself, where update speed would be a higher
priority.

I don't know Javascript (although it looks moderately simple from a
brief peruse, and I know enough languages to know I'll be able to pick
it up); however I do know and use Python, although not nuch in a
web-oriented way. Since unlike JS, python is at least pre-compiled, I
have hopes that this would make things quicker. I do appreciate that JS
is built into the browser, which might make my Python approach slower.
I'm not sure of the 'architectural' approach to this; any suggestions,
and maybe pointers to previous work?

Thanks in advance
Jon N

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


Re: Tiddlywiki type project in Python?

2006-06-14 Thread jkn
Hi Bruno

[...]
> >
> > I don't know Javascript (although it looks moderately simple from a
> > brief peruse,
>
> It's not as simple as it may seem at first look. There are some real
> gotchas. But if you want a more pythonic javascript, you should have a
> look at mochikit.

OK, thanks for the pointer

[...]

>
> > and I know enough languages to know I'll be able to pick
> > it up); however I do know and use Python, although not nuch in a
> > web-oriented way. Since unlike JS, python is at least pre-compiled, I
> > have hopes that this would make things quicker. I do appreciate that JS
> > is built into the browser, which might make my Python approach slower.
> > I'm not sure of the 'architectural' approach to this; any suggestions,
> > and maybe pointers to previous work?
>
> I don't really understand what you're after here, since TiddlyWikiLikes
> can *not* work without javascript.

Well, that may be an/the answer, since another form of my question
would be 'how can I write a TiddlyWikiLike using Python instead of JS'
;-). I appreciate that it might involve, for instance, a local server.
Does the idea of embedding python in a browser instead of Javascript
make any sense at all?

>
> Anyway, there's at least a Zope-based TiddlyWikiLike, so you may want to
> have a look here:
> http://ziddlywiki.org/
>

Thanks again

jon N

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


Re: Tiddlywiki type project in Python?

2006-06-15 Thread jkn
Hi Rick

R. P. Dillon wrote:
> I've been doing some work on a didiwiki-like program written in Python.
>   Since Python is [_not_] embedded in browsers, the didwiki approach make 
> sense:
> write the server in your language of choice (didwiki uses C), and lay
> the necessary (simple) wiki code on top of the server.  Roll the entire
> thing into a single executable, and you have a personal wiki.  The catch
> is that you must run the executable before you can access your wiki, but
> it is a small price to pay IMHO.
>
> Anyway, I'll either GPL or public-domain my code when I'm finished with
> it and I'll post it here.  My hope is it will be as fast on a reasonably
> modern computer as didiwiki is.
>
> Rick

That sounds interesting ... thanks. I'd never heard of didiwiki and
from a brief browse it seems similar to what I have in mind. I will
download it and have a proper look at it ... & will be glad to hear
more of your project.

Regards
Jon N

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


new wooden door step - fixing and finishing

2006-02-22 Thread jkn
Hi all
I'm considering having a go at replacing the wooden door step to
our back door. The original is loose and rotting.

I'm sure some of this will be clearer when I remove the (metal) door
frame - how is such a step fixed? Vertical frame fixings?

Also, any suggestions for treating/finishing such an item, subject to
heavy use, to prevent future rot? I was wondering about treating it
wilth liberal amounts of Teak Oil or similar...

Thanks
Jon N

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


Re: Erlang style processes for Python

2007-05-10 Thread jkn
Have you seen Candygram?

http://candygram.sourceforge.net/


jon N

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


Re: Generating HTML

2007-09-12 Thread jkn
I used to use Cheetah, but have switched recently to Jinja:

http://jinja.pocoo.org/

Mainly this is because the syntax is similar to Django's templates,
and eventually I plan on migrating to Django.

jon N

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


Re: Communicating with a DLL under Linux

2007-03-13 Thread jkn
Hi Mikael
It is probably worth you finding out more about the specific
Hardware that Velleman use for this kit. Depending on the chip
manufacturer, there may be more or less support already available. For
instance, I have recently been communicating with the FTDI USB chips
under windows. There is a PyUSB module which might help you do
something similar, and the FTDI website has quite a lot of
information.

As it turns out, I didn't use PyUSB - for reasons connected with the
version number of Python and annoying things like that (aside - has
anyone got PyUSB compiled for 2.5?). I developed my own pure python
interface to the FTDI chips DLL, using ctypes. So yes, this can be
done. I think you'd be on quite a learning curve for this, from what
you say, but don't let that put you off! Unfortunately I can't share
my code with you, but just knowing that it can be done is sometimes a
help...

FTDI make some evaluation boards for their USB chips and you might
consider going that route... http://www.ftdichip.com BTW. No
connection, just a customer/developer.

HTH
jon N

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


Re: clean up html document created by Word

2007-03-30 Thread jkn
IIUC, the original poster is asking about 'cleaning up' in the sense
of removing the swathes of unnecessary and/or redundant 'cruft' that
Word puts in there, rather than making valid HTML out of invalid HTML.
Again, IIUC, HTMLtidy does not do this.

If Beautiful Soup does, then I'm intererested!

jon N

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


Re: Indentation for code readability

2007-03-31 Thread jkn
If I wanted to mark out stack depth stuff like this in python, I'd do
it
with some form of stylised comment, like this:

# LEVEL 0

pushMatrix():
# LEVEL 1

drawstuff()
pushMatrix()
# LEVEL 2

drawSomeOtherStuff()
popMatrix()
# LEVEL 1

popMatrix()
# LEVEL 0

(there's probably a better comment form for your specific
requirement).

Any decent modern editor should be capable of being set up to
highlight such lines in a colour/style of your choice, and you then
set your eyeball filter to look for those lines when you want to be
sure of where you are.

jon N

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


Re: How to communicate via USB "port"

2007-04-18 Thread jkn
Have a look for PyUSB - there are (confusingly) two different packages
called pyUSB. one interfaces to FTDI chips connected to a USB port:

http://bleyer.org/pyusb/

The other uses libusb to interface to devices generally under windows:

http://pyusb.berlios.de/


HTH
jon N

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


Re: c++ for python programmers

2007-02-14 Thread jkn
Hi Thomas

On Feb 12, 6:00 pm, "Thomas Nelson" <[EMAIL PROTECTED]> wrote:
> I realize I'm approaching this backwards from the direction most
> people go, but does anyone know of a good c/c++ introduction for
> python programmers?
>

They are not particularly aimed at Python programmers, but Bruce
Eckel's "Thinking in C++" books are (a) excellent, and (b) freely
downloadable, as well as purchasable in book form:

http://www.mindview.net/

Bruce is a python fan FWIW ;-)

HTH
Jon N

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


Re: How to Teach Python "Variables"

2007-11-26 Thread jkn
On Nov 25, 10:36 pm, Ben Finney <[EMAIL PROTECTED]>
wrote:
>
> In addition to the good answers you've had already, I highly recommend
> David Goodger's "Code like a Pythonista" page
> http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html>,
> which contains a very good "cardboard boxes versus paper tags" analogy
> of the topic you're asking about.
>

or even Ben's own version of this, which I liked:

http://groups.google.com/group/comp.lang.python/browse_frm/thread/
56e7d62bf66a435c/ab62283cde9e4c63#ab62283cde9e4c63>

J^n
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OTish: convince the team to drop VBScript

2009-03-02 Thread jkn
On Feb 28, 8:19 pm, [email protected] wrote:
[...]
>
> IMO the first thing you ought to do is dig in, really listen, and find
> out what his issue is with module distribution.
>
> Listening well is your most powerful asset.  Overcome your own prejudices
> first, and his may follow :)

I agree with this. Find out what troubles him ... leave aside for now
whether it's a true, or false, picture of reality as you understand
it.

This then leads to you painting a picture for him:

"So ... if I could demonstrate for you a way in which Python [X Y
Z ...], how would that be for you?"

Keep refining this until his answer (in words or otherwise) is
"Fantastic, great, super!".

Find out what will allow him to buy into it for himself, and then
build/demonstrate that.

HTH
J^n
--
http://mail.python.org/mailman/listinfo/python-list


Re: How to find "in" in the documentation

2009-03-14 Thread jkn
On Mar 14, 7:00 am, Tim Golden  wrote:
> Well, this may not solve the OP's problem, but the current
> (2.7a0) .chm file has a much better index for operators and
> keywords. And "in" is in there. If you're interested in
> comparing, there's a copy here:
>
>  http://timgolden.me.uk/python/downloads/snapshots/trunk/Python27a0.chm

Thanks for the link (should be a lowercase 'p' - python27a0.chm -
BTW). But having had a look at this file (under kchmviewer rather than
the Windows help viewer) 

Ye Gods - it's almost unreadable. Not because of the content, but
because of the page style. I'm getting black text on a sort of slate
blue background. Is this the expected appearance?

Jon N

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


Re: Time.sleep(0.0125) not available within Linux

2008-09-26 Thread jkn
On Sep 26, 9:26 am, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Fri, 26 Sep 2008 19:46:10 +1200, Lawrence D'Oliveiro wrote:
> > In message <[EMAIL PROTECTED]>, Steven D'Aprano
> > wrote:
>
> >> On Wed, 24 Sep 2008 22:18:05 +1200, Lawrence D'Oliveiro wrote:
>
> >>> Just a thought, your minimum sleep time is probably limited by the
> >>> resolution of the system "HZ" clock. Type
>
> >>> less /proc/config.gz
>
> >> $ less /proc/config.gz
> >> /proc/config.gz: No such file or directory
>
> >> What OS are you using?
>
> > The one named in the subject line?
>
> Are you asking me or telling me?
>
> I've tried on five different Linux machines I have access to, and there
> is no such /proc/config.gz on any of them:
>

/proc/config.gz is not directly connected with a specific linux
distribution; it's a function of the kernel build configuration. If
the appropriate setting is enabled, then /proc/config.gz will show
(via eg. zcat) the equivalent of the .config file used to build the
kernel you are actually running. It's a useful feature in all linuces,
going back quite a way IIRC.

J^n
--
http://mail.python.org/mailman/listinfo/python-list


Re: Hubris connects Ruby to Haskell, will there be such a connection between Python and Haskell?

2010-02-17 Thread jkn
On Feb 17, 2:04 am, Carl Banks  wrote:

> > Hubris connects Ruby to Haskell, will there be such a connection
> > between Python and Haskell?
>
> I would have expected Hubris to link Ada and Common Lisp together.
>
> Carl Banks

;-)

J^n
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Karrigell 3.0.4 published

2010-02-27 Thread jkn
Hi Pierre

> Oops ! wrong group, sorry. It's for c.l.p.announce

Well, I for one was happy to learn of this release here - thanks

J^n

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


Re: Reverse engineering CRC?

2010-03-15 Thread jkn
Hi Greg
Just to say thanks for taking the time to write up your work on
this interesting topic.

Cheers
J^n

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


Re: Python database of plain text editable by notepad or vi

2010-03-25 Thread jkn
Kirbybase is one possibility.

http://pypi.python.org/pypi/KirbyBase/1.9


J^n

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


Re: Making Line Graphs

2011-02-19 Thread jkn
Graphviz?

http://www.graphviz.org/

HTH
Jon N
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Making the case for repeat

2009-06-08 Thread jkn
On Jun 8, 9:30 am, Ben Finney  wrote:

[...]
>
> As originally defined by Martin Fowler, re-factoring always means the
> external behaviour is unchanged http://refactoring.com/>.
>
> So, there's no such thing as a re-factoring that changes the API.
> Anything that changes an external attribute of the code is a different
> kind of transformation, not a re-factoring.

... and Steven was not calling the two things by the same name. He,
and Raymond, were distinguishing between refactoring, and API design.
That was their point, I think.


Jon N
-- 
http://mail.python.org/mailman/listinfo/python-list


  1   2   >