Salman Malik writes:
> I am sort of a newbie to Python ( have just started to use pdb).
> My problem is that I am debugging an application that uses greenlets and when
> I encounter something in code that spawns the coroutines or wait for an event,
> I lose control over the application (I mean th
On Tue, 12 Jun 2012 12:36:36 +0200, Gilles wrote:
> I enjoy writing scripts in Python much more than PHP, but with so many
> sites written in PHP, I need to know what major benefits there are in
> choosing Python (or Ruby, ie. not PHP).
The main benefit is that they are not PHP.
http://me.veekun
multiprocessing just mimicks the threading module here, see
http://bugs.python.org/issue1230540 . Why do you need excepthook in the
first place?
You can perfectly simulate it by wrapping the root method (target in
your example) in a try .. catch:
import multiprocessing
import sys
def printErrors
On 06/13/2012 11:00 AM, Dave Cook wrote:
> Originally, I was trying to send formatted
> tracebacks back to the main process on a queue.
You can still do that:
import multiprocessing
import sys
def queueErrors(q):
def decorator(func):
def wrapped(*args, **kwargs):
try:
On Wed, 13 Jun 2012 10:19:29 +1000, Chris Angelico
wrote:
>It's far simpler to manage, it retains running state, and is easily
>enough encapsulated. It's the non-magic way of doing things. Also, it
>plays very nicely with the MUD style of process, which is something I
>do a lot with Pike. Plus, if
On 13 Jun 2012 08:29:05 GMT, Steven D'Aprano
wrote:
>http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
>
>and especially lack PHP's security vulnerabilities.
Thanks for the link.
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 12 Jun 2012 16:48:27 +0200, Matej Cepl
wrote:
>I don't think it is a proper description of the situation (please,
>somebody correct my mistakes, I am not 100% sure about it myself). WSGI
>applications (which is basically all web applications in Python) could
>run in the hosted servers (
On Wed, Jun 13, 2012 at 7:25 PM, Gilles wrote:
> I have a couple more questions:
>
> 1. Today what is the recommended way to connect a long-running Python
> web application with a web server running in the front? FastCGI? WSGI?
> Other?
>
> 2. Which solid web server is recommended to connect to Py
On Wed, 13 Jun 2012 19:41:41 +1000, Chris Angelico
wrote:
>For high-availability servers, I can't speak for Python, as I've never
>done that there; but it seems likely that there's good facilities. My
>personal preference is Pike, but that's off-topic for this list. :)
>But the simple answer for s
On Wed, Jun 13, 2012 at 7:49 PM, Gilles wrote:
> On Wed, 13 Jun 2012 19:41:41 +1000, Chris Angelico
> wrote:
>>For high-availability servers, I can't speak for Python, as I've never
>>done that there; but it seems likely that there's good facilities. My
>>personal preference is Pike, but that's o
Hello Python friends, I have to validate some xml files against some xsd
schema files, but I can't use any cool library as libxml unfortunately.
A Python-only validator might be also fine, but all the projects I've
seen are partial or seem dead..
So since we define the schema ourselves, I was all
On Wed, 13 Jun 2012 20:00:59 +1000, Chris Angelico
wrote:
>Most high level languages probably have some sort of HTTP server
>available. Some make it trivially easy to plug some code in and start
>serving. Python is advertised as "batteries included", and one of its
>packets of batteries is a fairl
Hey
I was surprised not to find any way to list all protocol names listed in
/etc/protocols in Python
We have
socket.getprotobyname(NAME)
But there's no way to get the list of names
Any ideas if this is available in the stdlib somehwere ?
Thx
Tarek
--
http://mail.python.org/mailman/listinf
> > * Domain experts in fact who would need to implement loads of
> > software to help them get their work done but can't. And since
> > there's no budget for external developers, nothing get's ever done
> > about this.
> Well, typically or at least very often sooner or later something
> gets done
> > Tkinter is imho honestly the very best "argument" if you want to
> > make potential new users turn their backs away from Python for
> > good. Just show them one GUI implemented with it and, hey, wait,
> > where are you running to...
>
> Yes, Tkinter GUI's are very ugly.
>
> http://www.codebyk
> No matter how cool it may seem to create simple GUIs manually or to
> write business letters using LaTeX: just try to persuade people to
> move from Word to LaTeX for business letters...
Good example.
I have done nearly exactly this* - but it was only possible thanks to
LyX.
Sincerely,
Wolfga
Tarek,
There doesn't appear to be a function in stdlib to cover that particular case.
Doug Hellman has a nice section on finding service info here:
http://www.doughellmann.com/PyMOTW/socket/addressing.html
It wouldn't be "built-in", but it looks like it would be pretty simple to get
the in
Christian Tismer wrote on monday, 11.06.2012 at 19:01:
...
> Stackless Python has a New Website
...
> Due to a great effort of the Nagare people:
>
> http://www.nagare.org/
>
> and namely by the tremendous work of Alain Pourier,
>
> Stackless Python has now a new website!
>
> This is no lon
On 6/13/12, John Sutterfield wrote:
>
> Tarek,
>
> There doesn't appear to be a function in stdlib to cover that particular
> case.
>
> Doug Hellman has a nice section on finding service info here:
>
> http://www.doughellmann.com/PyMOTW/socket/addressing.html
>
> It wouldn't be "built-in", but it
Am 13.06.2012 13:41, schrieb Tarek Ziadé:
> Hey
>
> I was surprised not to find any way to list all protocol names listed in
> /etc/protocols in Python
>
> We have
>
> socket.getprotobyname(NAME)
>
> But there's no way to get the list of names
>
> Any ideas if this is available in the stdlib s
Am 12.06.2012 11:39, schrieb Gilles:
> I notice that Python-based solutions are usually built as long-running
> processes with their own web server (or can run in the back with eg.
> Nginx and be reached through eg. FastCGI/WSGI ) while PHP is simply a
> language to write scripts and requires a web
Well not really! does not work with '☃.net'
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.6/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.6/urllib2.py", line 391, in open
response = self._open(req, da
My bad, it worked; need to avoid http:// along with snowman, before encode.
On Wed, Jun 13, 2012 at 9:02 PM, Hemanth H.M wrote:
> Well not really! does not work with '☃.net'
>
> Traceback (most recent call last):
> File "", line 1, in
> File "/usr/lib/python2.6/urllib2.py", line 126, in url
So as far as I understood what I should do is the following.
Go through my own XML keeping track of the full path of everything for
example
and so on, then for every entry found in this iteration, check the schema
to make sure that that particular construct is allowed
on that level of the tree
andrea crotti writes:
> Hello Python friends, I have to validate some xml files against some xsd
> schema files, but I can't use any cool library as libxml unfortunately.
Why?
It seems not very rational to implement a complex task (such as
XML-Schema validation) when there are ready solutions ar
> I think this is the wave of the furture for deploying simple programs
> to many users. It is almost 100% cross platform (can be used on
> desktop, smartphone, tablet, windows, linux, mac etc) and is very easy
> to do, even for casual "non-programmers" who do a little programming
> (such as many e
andrea crotti, 13.06.2012 12:06:
> Hello Python friends, I have to validate some xml files against some xsd
> schema files, but I can't use any cool library as libxml unfortunately.
Any reason for that? Because the canonical answer to your question would be
lxml, which uses libxml2.
Stefan
--
h
On 2012-06-13, Steven D'Aprano wrote:
> On Tue, 12 Jun 2012 12:36:36 +0200, Gilles wrote:
>
>> I enjoy writing scripts in Python much more than PHP, but with so many
>> sites written in PHP, I need to know what major benefits there are in
>> choosing Python (or Ruby, ie. not PHP).
>
> The main ben
> Thanks for the longer explanation. With so many frameworks, I'd like
> to know what benefits they offer as compared to writing an application
> from scratch, and if they do offer obvious benefits, which one to pick
I am going to state up front that I have never tried any of the
frameworks so ta
On Tue, 12 Jun 2012, Tim Johnson wrote:
> I concur, I worked in C and C++ for 12 years. I added C++ later in
> my programming life. I don't recommend C++ for single programmers.
> - that is to say - 1 coder for 1 codebase. One can do good enough
> OOP in ansi C believe it or not, I learned
Am 13.06.2012 16:56, schrieb Christian Heimes:
> Am 13.06.2012 13:41, schrieb Tarek Ziadé:
>> Hey
>>
>> I was surprised not to find any way to list all protocol names listed in
>> /etc/protocols in Python
>>
>> We have
>>
>> socket.getprotobyname(NAME)
>>
>> But there's no way to get the list of na
On 6/13/12 8:33 PM, Christian Heimes wrote:
Am 13.06.2012 16:56, schrieb Christian Heimes:
Am 13.06.2012 13:41, schrieb Tarek Ziadé:
Hey
I was surprised not to find any way to list all protocol names listed in
/etc/protocols in Python
We have
socket.getprotobyname(NAME)
But there's no way t
On Wed, 13 Jun 2012 18:01:23 +, "Prasad, Ramit"
wrote:
>Maybe this article will help you
>http://www.infoworld.com/d/application-development/pillars-python-six-python-web-frameworks-compared-169442
>The comments on /. should round out anything missing from the article (I hope)
>http://develop
On Wed, 13 Jun 2012 17:27:21 +0200, Christian Heimes
wrote:
>A long running process has lots of benefits that makes design and
>development easier and makes your app faster.
Thanks much for the infos. Makes you wonder why commercial companies
still choose PHP to write their web site.
--
http://m
Hi!
I'm trying to get a handle on pytz (http://pytz.sourceforge.net/). I don't have
root on the system I'll be running my script on, so I need to go for a local
installation. I copied pytz into a folder in my sys.path and am importing from
there. That part seems to work. I downloaded the tarbal
Am 13.06.2012 22:48, schrieb Gilles:
> On Wed, 13 Jun 2012 17:27:21 +0200, Christian Heimes
> wrote:
>> A long running process has lots of benefits that makes design and
>> development easier and makes your app faster.
>
> Thanks much for the infos. Makes you wonder why commercial companies
> sti
On 6/13/2012 4:55 PM, bri...@gmail.com wrote:
Hi!
I'm trying to get a handle on pytz (http://pytz.sourceforge.net/). I don't have
root on the system I'll be running my script on, so I need to go for a local
installation. I copied pytz into a folder in my sys.path and am importing from
there.
Thanks Terry!
There indeed seems to be something wrong with my installation of pytz. I had a
look around the zoneinfo dir, which is where build_tzinfo polls its info from,
and a whole bunch of files are 0 bytes. Whenever I try to instantiate a
timezone whose corresponding file is 0 bytes I get
On Wed, 13 Jun 2012 12:17:12 +0200, Gilles wrote:
> Thanks for the longer explanation. With so many frameworks, I'd like to
> know what benefits they offer as compared to writing an application from
> scratch
Surely the obvious answer is that a framework offers the benefit that you
don't have to
> There indeed seems to be something wrong with my installation of pytz. I had a
> look around the zoneinfo dir, which is where build_tzinfo polls its info from,
> and a whole bunch of files are 0 bytes. Whenever I try to instantiate a
> timezone whose corresponding file is 0 bytes I get that error
I made a cipher app but to make easy, I want to make it Windows
rightclick menu can execute it
I found the way with dealing with Registry
[HKEY_CLASSES_ROOT\Directory\Background\shell\app]
[HKEY_CLASSES_ROOT\Directory\Background\shell\app\command]
@="C;\myapp filelocation"
but I don't know ho
On 13 Jun 2012 22:16:51 GMT, Steven D'Aprano
wrote:
>Surely the obvious answer is that a framework offers the benefit that you
>don't have to write the application from scratch.
Yes, but between receiving the query and sending the response, what
features do frameworks offer that I'd have to writ
On Wed, 13 Jun 2012 23:16:31 +0200, Christian Heimes
wrote:
>PHP was developed for non-developers. (see
>http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ ).
>It's much easier and also cheaper to find bad coders and non-developers
>than code people. The outcome is bad performance a
> >PHP was developed for non-developers. (see
> >http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ ).
> >It's much easier and also cheaper to find bad coders and non-developers
> >than code people. The outcome is bad performance and lots of security
> >issues.
>
> And as to why Fac
> I made a cipher app but to make easy, I want to make it Windows
> rightclick menu can execute it
> I found the way with dealing with Registry
>
>
> [HKEY_CLASSES_ROOT\Directory\Background\shell\app]
> [HKEY_CLASSES_ROOT\Directory\Background\shell\app\command]
> @="C;\myapp filelocation"
>
>
On Wed, 13 Jun 2012 23:12:37 +, "Prasad, Ramit"
wrote:
>You are not Facebook (at least yet).
Indeed, but with so much criticism about PHP, it's odd that they would
still choose it.
Anyway, thanks much for the infos. I'll look at the web frameworks and
how to connect the Python app to a front
Let say,I have a conjugated cyclic polygon and its nodes are given
by the list:
list_p=[a,b,c,d,e,f,g,a,a,b,d,d,d,d,d,c,c,e,e,a,d,d,g]. If X & Y
are any elements in
a list_p except d, and Z is also an element of list_p but has
value only d, i.e,
Z=d. Now,I want to compute the number of
On Thu, 14 Jun 2012 00:44:23 +0200, Gilles wrote:
> On 13 Jun 2012 22:16:51 GMT, Steven D'Aprano
> wrote:
>>Surely the obvious answer is that a framework offers the benefit that
>>you don't have to write the application from scratch.
>
> Yes, but between receiving the query and sending the respo
> Indeed, but with so much criticism about PHP, it's odd that they would
> still choose it.
Could be a familiarity/ease issue as it was originally started by a
college student (and college students seldom have meaningful real
world experience) before it exploded in size. Also do not forget
that
The windows box is my development box, it's not where the script will be
running in the end. It'll be running on a Linux box where I don't have root so
python setup.py install isn't an option (to my understanding).
So what happened is that 7zip didn't unzip the .tar.gz2 properly, but it does
fi
On 06/13/12 17:44, Gilles wrote:
> On 13 Jun 2012 22:16:51 GMT, Steven D'Aprano
> wrote:
>> Surely the obvious answer is that a framework offers the benefit that you
>> don't have to write the application from scratch.
>
> Yes, but between receiving the query and sending the response, what
> fea
n Wed, Jun 13, 2012 at 7:29 PM, bruce g wrote:
> What is the best way to parse a CSV string to a list?
Use the `csv` module:
http://docs.python.org/library/csv.html
http://www.doughellmann.com/PyMOTW/csv/
The `StringIO` module can be used to wrap your string as a file-like
object for consumption
On 6/13/2012 6:45 PM, Gilles wrote:
On Wed, 13 Jun 2012 23:16:31 +0200, Christian Heimes
wrote:
PHP was developed for non-developers. (see
http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ ).
It's much easier and also cheaper to find bad coders and non-developers
than code peop
string.split(',') will give you an array.
Example:
'AAA,",,",EEE,FFF,GGG '.split(',')
['AAA', '"', '', '"', 'EEE', 'FFF', 'GGG']
On Wed, Jun 13, 2012 at 10:53 PM, Chris Rebert wrote:
> n Wed, Jun 13, 2012 at 7:29 PM, bruce g wrote:
> > What is the best way to parse a
On 6/12/2012 11:42 PM, Andrew Berg wrote:
On 6/13/2012 1:17 AM, John Nagle wrote:
What does "urllib2" want? Percent escapes? Punycode?
Looks like Punycode is the correct answer:
https://en.wikipedia.org/wiki/Internationalized_domain_name#ToASCII_and_ToUnicode
I haven't tried it, though.
On Wed, Jun 13, 2012 at 10:06 PM, Jose H. Martinez
wrote:
> string.split(',') will give you an array.
>
> Example:
>
> 'AAA,",,",EEE,FFF,GGG '.split(',')
>
> ['AAA', '"', '', '"', 'EEE', 'FFF', 'GGG']
But it incorrectly splits the quoted part. A proper CSV parser (like
th
On Thu, Jun 14, 2012 at 6:35 AM, Daniel Klein wrote:
> The windows box is my development box, it's not where the script will be
> running in the end. It'll be running on a Linux box where I don't have root
> so python setup.py install isn't an option (to my understanding).
>
You might want to u
57 matches
Mail list logo