Re: Using Python on a fork-less POSIX-like OS

2018-07-29 Thread Jan Claeys
On Fri, 2018-07-27 at 19:13 +0200, Barath Aron wrote:
> I intend to cross-compile Python v3.6.6 to Threos ( https://threos.io
>  ) operating system. Threos is supports a quite large set from 
> POSIX and C89/C99. Unfortunately, Threos lacks fork(2), but
> provides posix_spawn(3) instead. I already made some local changes
> in posixmodule.c to compile due to some features are detected 
> as present but actually not supported, like HAVE_FORK -- I blame
> autotools for this :-). I don't know, however, whether the Python
> shall cross-compile without issues.
> 
> My question is that the _posixsubprocess.c can be prepared to
> use posix_spawn(3) instead of fork(2)? Maybe the UNIX/Linux version
> can also benefit from it, see: https://salsa.debian.org/ruby-
> team/ruby-posix-spawn

You might want to ask this on the python-dev mailing list.


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


Re: Non-GUI, single processort inter process massaging - how?

2018-07-22 Thread Jan Claeys
On Sat, 2018-07-21 at 11:50 -0400, Dennis Lee Bieber wrote:
> Each client would use the urllib (various names between v2
> and v3) to submit requests to the server, and process the returned
> "page".

Or the client could even be a bash script using curl, or any other HTTP
client...

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


Re: An assessment of the Unicode standard

2009-09-10 Thread Jan Claeys
Op Sun, 30 Aug 2009 15:28:55 -0700, schreef r:

> I said it before and i will say it again. I DON"T CARE WHAT LANGUAGE WE
> USE AS LONG AS IT IS A MODERN LANGUAGE FOUNDED ON IDEALS OF
> SIMPLICITY

Maybe we should use a language that has a Turing-complete grammar, so 
that even computers can understand & speak it "easily"?

http://www.economicexpert.com/a/Panini:scholar.htm
(with thanks to Anna Ravenscroft for pointing me to this some time ago)

When used by everyone, it would allow us to write programs in the 
language all of us speak...  *Maybe*...  :P


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


Re: Python embedding question.

2008-07-15 Thread Jan Claeys
Op Tue, 15 Jul 2008 11:51:47 +0200, schreef Thomas Troeger:

> I want to embed a Python application on a device with limited
> resources, esp. storage limitations. Is there a way to reduce the Python
> interpreter to a set of modules that's urgently needed?

You might want to have a look at how the OpenWRT people do it.

In general: have a look at embeded linux projects, several of them have 
python packages...  ;-)


> Additionally, is there a Python module that contains all the stuff
> needed for an embedded application like graphics, sound etc. or do I
> have to use the various bindings to libraries like cairo, Qt or similar?

I'd say that PyGame could be a solution.

Or otherwise you could do your own audio/graphics programming (you don't 
tell us which OS you use, but there exist python modules that allow you 
to do barebones graphics & sound programming on linux...).


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


Re: Python internals

2008-07-15 Thread Jan Claeys
Op Tue, 15 Jul 2008 09:29:58 -0500, schreef Larry Bates:

> Names are pointers in Python that point to values in memory.

But "pointers" doesn't have the same meaning as in "C" here.

Memory in Python is not (necessarily) an "array of bytes"; how & where 
the values are stored in "physical memory" at any time during the 
lifetime of an object is an implementation detail.

Maybe you can compare it to how a (university) library works: you ask a 
librarian for a book named "The Taste Of Man by Slavenka Draculić" and 
they fetch it for you, using whatever internal classification/retrieval 
system they use.


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

Re: Python 2.5.2 on Ubuntu Hardy Utf-8-Euro error

2008-06-07 Thread Jan Claeys
Op Fri, 30 May 2008 22:37:14 +0200, schreef M.-A. Lemburg:

> On 2008-05-30 17:41, Peter Otten wrote:
>> Josep wrote:

>>> My Python version is 2.5.2, Ubuntu Hardy .deb package.

>> Python might get confused by an @EURO suffix in the locale:

> Right, that's what's happening.
> 
> The locale module uses a locale aliasing table that help map environment
> locale settings to C local names.
> 
> That table was last updated in 2004 and since then a lot more locale
> variable strings have made their way into the Linux distros.
> 
> I guess we need to update the table...

Ubuntu doesn't use @EURO suffixes...?

$ grep EURO /usr/share/i18n/SUPPORTED
$


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


Re: definition of a highlevel language?

2008-06-07 Thread Jan Claeys
Op Mon, 26 May 2008 15:49:33 -0400, schreef Dan Upton:

> The point about them looking very little like x86/ARM/etc chips is the
> important part though--IIRC, part of the failure of Java machines was
> lousy support for preexisting code, due to the optimizations for Java
> bytecode, and I expect the same would be true of a Python
> bytecode-optimized processor.

AFAIK "Java processors" are mostly used as coprocessors next to an ARM 
core (or similar), allowing you to run Java applications at a reasonable 
speed on otherwise relatively slow mobile phone CPUs and the like.

In theory, it's possible to design a processor that can run some form of 
Python-oriented bytecode quite efficiëntly, but I fear that nobody really 
wants to invest the money to do so at the moment?


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

Re: Python is slow

2008-06-06 Thread Jan Claeys
Op Fri, 23 May 2008 14:00:33 -0700, schreef [EMAIL PROTECTED]:

> Now this I can tell is false. The problem is not that it's difficult to
> "make a native compiler for" dynamic languages, the problem is that it's
> difficult to write native compiler for dynamic languages that generates
> code that beats the VM/byte-code interpreter/whatever you name it to be
> wotrh the effort.

Well, it would be much easier if there would be hardware that was 
designed for object oriented & dynamic programming...  ;-)

(Most current hardware is designed for use with C & similar languages, or 
sometimes for massively parrallel computing (e.g. GPUs), but the last 
tries to design hardware to fit something like Python date back to the 
1980s AFAIK...)


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


Re: downloading a link with javascript in it..

2008-05-16 Thread Jan Claeys
Op Mon, 12 May 2008 22:06:28 +0200, schreef Diez B. Roggisch:

> There is no way to interpret the JS in Python,

There is at least one way:



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


Re: pop langs website ranking

2008-04-25 Thread Jan Claeys
Op Wed, 23 Apr 2008 04:07:31 +, schreef Roedy Green:

> The weakness of this approach is it is unusual group of people who will
> voluntarily submit to having their usage spied on.  These are not a
> typical group or a large group.

Hello, planet Earth calling?

I guess around 90% of internet users don't care, mostly because they 
don't know this is happening (how many people do you think read EULAs?).

Alexa's & Google's & other (often less legal) profiling tools come with 
lots of pseudo-freeware applications these days...


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


Re: Python in High School

2008-04-21 Thread Jan Claeys
Op Thu, 03 Apr 2008 00:06:34 -0700, schreef Dennis Lee Bieber:

> On Thu, 03 Apr 2008 03:37:43 GMT, Jan Claeys <[EMAIL PROTECTED]> declaimed
> the following in comp.lang.python:
> 
>> Later I learned C (and even later C++), and I've always been wondering
>> why those languages were making simple things so complicated...
> 
>   Could it be that they are closer to being high-level assembly
> languages meant to get close to the hardware (especially of the PDP
> series that C originated on), whereas Pascal was designed to just be a
> language meant for teaching algorithms and programming, not originally
> intended for production efforts?

Pointers in Borland's Pascal (and FreePascal) are bare machine pointers, 
with optional typing for the referenced value; I've never seen anything 
you could do with C pointers that you couldn't do with Borland Pascal 
pointers.  (And I think the reason why pointers in C looked complicated 
is that the C syntax for pointers is inconsistent...)


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


Re: Python in High School

2008-04-02 Thread Jan Claeys
Op Wed, 02 Apr 2008 17:02:45 -0400, schreef Dan Upton:
> Side rant:  I think Java's just fine, as long as it's taught properly.
>  I'd done a little bit of C and C++ programming when I was in high
> school, trying to teach myself from a book, but I never really got
> pointers or objects.  Going back to it after Java, it made so much more
> sense, even though people will tell you "Java doesn't make you learn
> about pointers."

I learned about pointers while learning Pascal (and later embedded 
assembler) using Borland's tools.

Later I learned C (and even later C++), and I've always been wondering why 
those languages were making simple things so complicated...


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


Re: License of Python

2008-04-02 Thread Jan Claeys
Op Sun, 30 Mar 2008 08:16:39 -0700, schreef iu2:

> Due to Competitors... I don't want to expost the language I use

If they are clever, they already know that you want to use python by now, 
after you posted this on a public mailing list / newsgroup...


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


Re: Python in High School

2008-04-02 Thread Jan Claeys
Op Tue, 01 Apr 2008 10:27:18 -0700, schreef sprad:

> I'm a high school computer teacher, and I'm starting a series of
> programming courses next year (disguised as "game development" classes
> to capture more interest). The first year will be a gentle introduction
> to programming, leading to two more years of advanced topics.
> [...]
> So -- would Python be a good fit for these classes?

There are at least 3 books about game programming in python:






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


Re: Python's great, in a word

2008-01-15 Thread Jan Claeys
Op Mon, 07 Jan 2008 05:09:15 -0800, schreef MartinRinehart:

> Would you Python old-timers try to agree on a word or two that
> completes:
> 
> The best thing about Python is ___.
> 
> Please, no laundry lists, just a word or two. I'm thinking "fluid" or
> "grace" but I'm not sure I've done enough to choose.

The best thing about Python is how it tries to find the "perfect" balance 
between elegance, practicality & clarity.


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


Re: Counter-spam: Change the subject

2007-12-26 Thread Jan Claeys
Op Tue, 11 Dec 2007 14:19:20 -0800, schreef Paul McGuire:

> My ISP's news server only works for me when I am connected locally, not
> when I am travelling.

Gmane ?


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


Re: Best way to protect my new commercial software.

2007-12-18 Thread Jan Claeys
Op Fri, 14 Dec 2007 16:54:35 +, schreef Grant Edwards:

> Uh what?  I don't know what country you're in, but in the US, it doesn't
> take any time at all to copyright something.  The mere act of writing
> something copyrights it.  I thought it was the same in Europe as well.

No, it's only copyrighted when you _publish_ it.


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


Re: DNS servers in Python - which ones are a good base for work?

2007-12-17 Thread Jan Claeys
Op Tue, 11 Dec 2007 11:10:52 -0800, schreef John Nagle:

> I need to do a non-standard DNS server in Python.  This is for a spam
> blacklist type DNS server, not for IP lookup. "dnspython" seems to be
> client side only.  Oak DNS is deprecated.  Suggestions?

$ wajig search python-twisted-names 
python-twisted-names - A DNS protocol implementation with client and server

(There might be other solutions too, and I have no experience using it.)


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


Re: Newbie edit/compile/run cycle question

2007-12-17 Thread Jan Claeys
Op Mon, 10 Dec 2007 16:00:04 -0800, schreef Matimus:

> better written:
> 
> python -mpy_compile FILENAME

The -m option doesn't work in all versions of cpython (I think since 
v2.4, or maybe 2.3?).


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


Re: Newbie edit/compile/run cycle question

2007-12-09 Thread Jan Claeys
Op Sun, 09 Dec 2007 01:11:28 +, schreef Jeremy C B Nicoll:

> What command (in XP) does one need to issue to syntax check a saved
> python script without running it?
> 
> Does a syntax check report all syntax errors or just the first one
> found?

python -c "import py_compile; py_compile.compile(r'FILENAME')"

... where FILENAME is the filename of the python script you want to check.

What this does in practice is (trying to) compile the source, and any 
errors or warnings will be reported.


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


Re: Distinguishing attributes and methods

2007-12-09 Thread Jan Claeys
Op Sun, 09 Dec 2007 12:44:46 -0800, schreef MonkeeSage:

> The point is that just because the attributes are "looked up the same
> way" or whatever, doesn't make them the same *kind* of attribute. To say
> that all attributes are the same in python muddies the water. They are
> the same in a generic sense that they are attributes, but not in their
> particular qualities. Like saying "all humans are the same" -- yes, in a
> general sense of being human. But to leave it at that is not very
> helpful.

Well, I guess Python is a language for human being...  ;-)


To conclude this discussion:

 * in Python, methods are attributes
 * in Ruby, attributes are methods


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


Re: "Python" is not a good name, should rename to "Athon"

2007-12-08 Thread Jan Claeys
Op Mon, 03 Dec 2007 14:20:52 +1300, schreef greg:

> If you want a really appropriate name for a programming language, I'd
> suggest Babbage. (not for Python, though!)

Konrad Zuse wrote the first high-level programming language, so I think 
his name would be a better candidate...


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


Re: How to display unicode with the CGI module?

2007-11-25 Thread Jan Claeys
Op Sun, 25 Nov 2007 13:02:26 -0800, schreef coldpizza:

> It is funny that encode() and decode() omit the name of the other
> encoding (Unicode ucs2?), which makes it far less readable than a
> s.recode('ucs2','utf8').

The internal encoding/representation of a "string" of Unicode characters 
is considered an implementation detail and is in fact not always the same 
(e.g. a cpython build parameter selects UCS2 or UCS4, and it might be 
something else in other implementations).

See the 'Py_UNICODE' paragraph in:



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


Re: Python web frameworks

2007-11-25 Thread Jan Claeys
Op Fri, 23 Nov 2007 09:29:38 -0800, schreef BartlebyScrivener:

> I'm just learning Django and feeling my way through all of this server
> terminology. Where does Django's memcached feature fit into all of this?
> When you all speak of start up costs and memory intensive loading for
> each requests, doesn't the caching feature eliminate most of that
> overhead?

It helps a lot for data or content that is dynamically generated from 
database queries, but doesn't change too frequently.

> http://www.djangoproject.com/documentation/cache/
> 
> I'm probably mixing appliances and oragutans but just curious about how
> you experts feel about Django's caching.

I'm not an "expert", but I think Django's caching framework and the 
caching middleware are great.  :)


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


Re: import pysqlite2 or import sqlite3?

2007-11-22 Thread Jan Claeys
Op Wed, 21 Nov 2007 21:11:59 +0100, schreef Hertha Steck:

> After a second look at the error message: when I installed Gentoo,
> Python 2.4 was installed, I got the new version a little later. And I
> think I installed Pysqlite 2.3.5 separately.
> 
> Python 2.5 comes with pysqlite - should I uninstall my version?

Some older software might still try to use the "external" pysqlite, so 
maybe you want to check that first before removing anything.

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