On 07/16/2010 10:21 PM, Peng Yu wrote:
> On Fri, Jul 16, 2010 at 3:10 PM, MRAB wrote:
>> Peng Yu wrote:
>>>
>>> Hi,
>>>
>>> I see that there are help topics that are capitalized, which I think
>>> in general are related with languages syntax. I want to see the
>>> complete list of such help topics
On Jul 17, 12:34 am, candide wrote:
> I don't understand why some parts of the Python language (or the Python
> standard library too) are implemented in C while some other parts are
> implemented in the Python language itself. For instance, lists and
> dictionnaries are implemented in C but sets a
On 07/17/2010 10:03 AM, Steven D'Aprano wrote:
> On Fri, 16 Jul 2010 21:23:09 -0500, Tim Chase wrote:
>
>>> Is anyone /still/ using Python 2.x? ;-)
>>
>> 2.x?! You were lucky. We lived for three months with Python 1.x in a
>> septic tank. We used to have to get up at six in the morning, write our
On 07/17/2010 06:21 PM, raj wrote:
> Hi,
>
> I am using 64 bit Python on an x86_64 platform (Fedora 13). I have
> some code that uses the python marshal module to serialize some
> objects to files. However, in moving the code to python 3 I have come
> across a situation where, if more than one ob
On 07/17/2010 06:38 PM, Gary Herron wrote:
> On 07/17/2010 01:03 AM, Steven D'Aprano wrote:
>> On Fri, 16 Jul 2010 21:23:09 -0500, Tim Chase wrote:
>>
>>
Is anyone /still/ using Python 2.x? ;-)
> http://xkcd.com/353/
There we have the most important difference between Python 2 and 3:
On 07/17/2010 04:59 AM, pyt...@bdurham.com wrote:
> Tim,
>
>> 2.x?! You were lucky. We lived for three months with Python 1.x in a septic
>> tank. We used to have to get up at six in the morning, write our 1.x code
>> using ed, eat a crust of stale bread, go to work down in machine language,
>>
On 07/18/2010 01:18 PM, News123 wrote:
> Mark Lawrence wrote:
>> On 17/07/2010 23:17, MRAB wrote:
>>> Chris Rebert wrote:
On Fri, Jul 16, 2010 at 10:27 AM, MRAB
wrote:
> Jason Friedman wrote:
It's a pity that str.strip() doesn't actually take a set() of length-1
string
On 07/18/2010 05:52 PM, Reid Kleckner wrote:
> Usual disclaimer: python-dev is for the development *of* python, not
> *with*. See python-list, etc.
Moving to python-list. Please keep discussion there.
>
> That said, def declares new functions or methods, so you can't put
> arbitrary expressions
On 07/19/2010 07:28 PM, Scott McCarty wrote:
> All, I just want to understand the C/Python piece better because I am
> writing a tutorial on signals and I am using python to demonstrate. I
> thought it would be fun to show that the SIGKILL is never processed, but
> instead python errors out. There
On 07/21/2010 05:29 PM, Holger brunck wrote:
>
>>> Something like the "file" utility for linux would be very helpfull.
>>>
>>> Any help is appreciated.
>
>> You're going to have to describe in detail what's in the file before
>> anybody can help.
>
> We are creating inside our buildsystem for an
On 07/21/2010 03:38 PM, kak...@gmail.com wrote:
> On Jul 21, 9:04 am, "kak...@gmail.com" wrote:
>> On Jul 21, 8:58 am, Stefan Behnel wrote:
>>
>>
>>
>>> kak...@gmail.com, 21.07.2010 14:36:
>>
From the subject of my message it's clear that i get an xml message
from a socket,
>>
>>> Not a
lt)
else:
raise Exception('Too many EAGAIN on write %s %s' % (cmd, exc),
exc_info=True)
Thomas
--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de
--
http://mail.python.org/mailman/listinfo/python-list
On 07/23/2010 12:56 PM, dirknbr wrote:
> To give a bit of context. I am using twython which is a wrapper for
> the JSON API
>
>
> search=twitter.searchTwitter(s,rpp=100,page=str(it),result_type='recent',lang='en')
> for u in search[u'results']:
> ids.append(u[u'id'])
>
hell yeah"
>>> (a, b, id(a), id(b))
('this was a', 'this was b, hell yeah', 32417752, 32418144)
>>> tpl = (a, b, id(a), id(b))
>>> tpl
('this was a', 'this was b, hell yeah', 32417752, 32418144)
>>> swap(a, b)
>>>
On 07/23/2010 07:13 PM, Thomas Jollans wrote:
> On 07/23/2010 12:34 AM, wheres pythonmonks wrote:
>> 2. Is there a better way to loopup by id? I'm not very familiar with
>> sys.exc_info, but creating the id->name hash each time seems like
>> overkill.
>
>
On 07/23/2010 10:35 PM, pyt...@bdurham.com wrote:
> 1. Use an existing version control utility. There are lots of options
> here(!), any recommendations on a light weight, open source one that
> xcopy installs under Windows with lots of command line options?
You could just go with Mercurial, you k
On 07/23/2010 11:46 PM, Nobody wrote:
> On Fri, 23 Jul 2010 10:42:26 +, Steven D'Aprano wrote:
>
>> Don't write bare excepts, always catch the error you want and nothing
>> else.
>
> That advice would make more sense if it was possible to know which
> exceptions could be raised. In practice,
On 07/24/2010 02:45 PM, francogrex wrote:
> Hi, I'm not a Python programmer but I'm
> interested in it and I found this table from
> Norvig that dates for some years (I re-posted
> it temporarily on my site below to take it out
> of context a little). I'm not interested in
> any comparisons on
On 07/24/2010 03:48 PM, Brian Quinlan wrote:
>
> On 24 Jul 2010, at 23:19, Thomas Jollans wrote:
>>> "Support heterogeneous lists" ==> "Yes (array)"
>>
>> This is nonsense, and has always been.
>> Python lists (not arrays) have always been h
On 07/24/2010 04:20 PM, be.krul wrote:
> On Jul 17, 10:09 pm, Chris Rebert wrote:
>> On Sat, Jul 17, 2010 at 10:01 PM, be.krul wrote:
>>> why is this group being spammed?
>>
>> Because that's what happens in unmoderated USENET newsgroups.
>>
>> Cheers,
>> Chris
>
> I thought this group can be mo
On 07/25/2010 01:43 AM, Navkirat Singh wrote:
> I want to kill Zombiesso first I have to create them...simple law of
> nature
You can't kill a zombie. That's why we call them zombies, as opposed to,
say, daemons.
>
>
> On 25-Jul-2010, at 5:08 AM, Chris Rebert wrote:
>
>> On Sat, Jul 2
On 07/25/2010 02:46 PM, Edward Diener wrote:
> The problem with this is that you forget that a script can invoke Python
> internally. So whether one uses the console or file association method
> of invoking Python externally, any already written script can use either
> internally.
Maybe it's just
On 07/25/2010 05:41 PM, Karsten Wutzke wrote:
> What's wrong with:
>
> class Enum(RootFragment):
> __jpaTypes = {
> # complete!
> 'CascadeType': Enum("javax.persistence.CascadeType"),
> 'DiscriminatorType':
> Enum("javax.persistence.DiscriminatorType"),
> 'EnumT
On 07/25/2010 09:12 PM, Edward Diener wrote:
> On 7/25/2010 1:51 PM, Joel Goldstick wrote:
>> There is this:
>> http://pypi.python.org/pypi/virtualenv
>
> It appears to be only for Linux.
I don't know where you get that impression from. I don't know how well
it works on which platforms, but the f
On 07/25/2010 09:19 PM, Edward Diener wrote:
> On 7/25/2010 10:03 AM, Thomas Jollans wrote:
>> On 07/25/2010 02:46 PM, Edward Diener wrote:
>>> The problem with this is that you forget that a script can invoke Python
>>> internally. So whether one uses the console or fil
On 07/25/2010 09:39 PM, Christian Heimes wrote:
> Am 25.07.2010 21:32, schrieb Thomas Jollans:
>> If a script uses sys.executable instead of "python", there is no
>> problem, at all.
>
> It's true that sys.executable is the best way if you have to start
On 07/25/2010 10:04 PM, News123 wrote:
> sOn 07/25/2010 09:39 PM, Christian Heimes wrote:
>> Am 25.07.2010 21:32, schrieb Thomas Jollans:
>>> If a script uses sys.executable instead of "python", there is no
>>> problem, at all.
>
>
> sys.executab
On 07/25/2010 11:10 PM, Edward Diener wrote:
> On 7/25/2010 3:39 PM, Christian Heimes wrote:
>> Am 25.07.2010 21:32, schrieb Thomas Jollans:
>>> If a script uses sys.executable instead of "python", there is no
>>> problem, at all.
>>
>> It's t
John Nagle wrote:
> On 7/23/2010 1:45 AM, Thomas Guettler wrote:
>> Hi,
>>
>> I use non-blocking io to check for timeouts. Sometimes I get EAGAIN
>> (Resource temporarily unavailable)
>> on write(). My working code looks like this. But I am unsure how many
>>
On 07/26/2010 06:36 AM, Edward Diener wrote:
> On 7/25/2010 10:42 PM, David Robinow wrote:
>> On Sun, Jul 25, 2010 at 8:40 PM, Edward Diener
>> wrote:
>>> On 7/25/2010 5:57 PM, Thomas Jollans wrote:
>>> So if a standard library module ( or distributed library ) e
On 07/26/2010 07:24 PM, alberttresens wrote:
>
> Hi, thanks for the reply.
Alas, you didn't actually read it:
>
> But what i am more concerned about, as I am trying to correlate logs, is
> what is the timestamp:
> 1279620166 mean?
> Is it seconds since the epoch or the ISO time in seconds?
>
>
On 07/27/2010 12:20 AM, Peng Yu wrote:
> This webpage http://www.python.org/dev/peps/pep-0008/ recommends the
> following. It looks to me that both styles are fine. Could anybody let
> me know what the rationale is behind this recommendation?
Beauty is in the eye of the beholder, even when we call
On 07/26/2010 11:52 PM, Peng Yu wrote:
> Hi
>
> I'm still kind of confused about the terminology on classes in python.
>
> Could you please let me know what the equivalent terms for the
> following C++ terms?
>
> constructor
constructor.
This consists of the class constructor method, __new__,
On 07/25/2010 11:02 AM, francogrex wrote:
> Terry Reedy wrote:
>> As other have said, mostly, but I would change the following...
>
> Thanks for all those who replied. I know these are not all the features but
> some of them and again this is not a comparison but a little taste of what
> python
On 07/28/2010 06:01 PM, Jonathan Hartley wrote:
>
> Oh, plus, while we're on this subject:
>
> Am I right that curses in Python stdlib doesn't work on Windows, and
> there is currently no simple way to fix this?
>
> Also, is it crazy to imagine that if colorama was pushed through to
> completion
On 07/28/2010 07:02 PM, Jonathan Hartley wrote:
> On Jul 28, 5:47 pm, Thomas Jollans wrote:
>> On 07/28/2010 06:01 PM, Jonathan Hartley wrote:
>>
>>
>>
>>> Oh, plus, while we're on this subject:
>>
>>> Am I right that curses in Python stdli
On 07/28/2010 08:32 PM, Joe Goldthwaite wrote:
> Hi,
>
> I've got an Ascii file with some latin characters. Specifically \xe1 and
> \xfc. I'm trying to import it into a Postgresql database that's running in
> Unicode mode. The Unicode converter chokes on those two characters.
>
> I could just ma
On 07/28/2010 09:29 PM, John Nagle wrote:
> for rawline in input :
> unicodeline = unicode(line,'latin1')# Latin-1 to Unicode
> output.write(unicodeline.encode('utf-8')) # Unicode to as UTF-8
you got your blocks wrong.
--
http://mail.python.org/mailman/listinfo/python-list
On 07/31/2010 12:15 PM, Lawrence D'Oliveiro wrote:
>reduce(lambda a, b : a + b, (y * y for y in V), 0))
>
This is a lot more verbose than it has to be, and probably slower too.
firstly:
(lambda a,b: a+b) is equivalent to operator.add.
==>
reduce(operator.add, (y*y for y in V), 0)
However - re
On 08/01/2010 03:41 AM, Lawrence D'Oliveiro wrote:
> In message <87sk2zhpcj@dpt-info.u-strasbg.fr>, Alain Ketterlin wrote:
>
>> Lawrence D'Oliveiro writes:
>>
>>> V = tuple \
>>> (
>>> x
>>> /
>>> l
>>>for x in V
>>>for l in
>>>
On 08/02/2010 04:42 PM, Grant Edwards wrote:
> On 2010-08-02, Christian Heimes wrote:
>
>> In your opinion what would Python gain from a C++ implementation?
>
> Greater buzzword-compliance -- an important characteristic highly
> prized by Human-Resources poeple and mid-level managers here in the
On 08/02/2010 09:33 PM, Chris Hare wrote:
> I am having a problem getting around this variable namespace thing.
>
> Consider these code bits
>
> File a.py
> from Tkinter import *
> import a1
>
> def doAgain():
> x = a1.Net()
> x.show("Again!")
>
> root = Tk()
> root.title("test")
>
On 08/02/2010 09:41 PM, John Nagle wrote:
> On 8/2/2010 11:02 AM, MRAB wrote:
>> John Nagle wrote:
>>> The regular expression "split" behaves slightly differently than
>>> string split:
> occurrences of pattern", which is not too helpful.
>>>
>> It's the plain str.split() which is unusual in that:
On 08/02/2010 04:20 AM, Νίκος wrote:
> Also my greek print appear in funny encoding although i do use # -*-
> coding: utf-8 -*-
That's because you never told the web browser which encoding you're using.
Content-Type: text/html; charset=UTF-8
--
http://mail.python.org/mailman/listinfo/python-list
On 08/02/2010 10:13 PM, Νίκος wrote:
> Hello, any ideas?!
That's no way to treat a friendly volunteer mailing list like this one!
On 08/02/2010 02:32 PM, Νίκος wrote:
> As for the encoding Notepad++, which is what i use for an editor say
> its UTF-8 without BOM.
>
> Isn't this what i'm supposed
On 08/02/2010 11:22 PM, John Nagle wrote:
>> [ s in rexp.split(long_s) if s ]
>
>Of course I can discard the blank strings afterward, but
> is there some way to do it in the "split" operation? If
> not, then the default case for "split()" is too non-standard.
>
>(Also, "if s" won't work;
On 08/03/2010 10:17 PM, wheres pythonmonks wrote:
> I did the google search... I must be blind as I don't see any hits...
>
> None is negative in Python? (v2.6)
>
> http://www.google.com/search?ie=UTF-8&q=%22none+is+negative%22+python
>
if None < -999.99: print "hi"
>
> hi
>
>>>
On 08/06/2010 04:37 PM, alejandro wrote:
>
>> # the last tuple is the background color
>> img = Image.new("RGBA",(300, 50), (0, 0, 0, 0))
> Thank you for this
>
>> # I think that the PIL can cope with unicode, so add a u-prefix here:
>> text = u"proba test ¾æèð¹"
>> draw.text((20,8), text ,fo
On 08/07/2010 02:45 AM, dmtr wrote:
> I'm running into some performance / memory bottlenecks on large lists.
> Is there any easy way to minimize/optimize memory usage?
>
> Simple str() and unicode objects() [Python 2.6.4/Linux/x86]:
sys.getsizeof('') 24 bytes
sys.getsizeof('0')2
On 08/07/2010 01:10 PM, Shambhu Sharma wrote:
> Hi,
>
> I am new to Python. I was trying to use os.unlink function in
> windows. But i am getting error:
> OSError: [Errno 2] No such file or directory:
> 'C:\\SHAMBHU\\tmp\\text_delete.txt'
>
> Input file to os.unlink is: 'C:\SHAMBHU\tmp\te
On 08/07/2010 05:05 AM, Default User wrote:
>>From "the emperor's new clothes" department:
>
> 1) Why do Python lists start with element [0], instead of element [1]?
> "Common sense" would seem to suggest that lists should start with [1].
As others have pointed out, there is a nice argument to
On 08/07/2010 09:44 AM, Gabriel Genellina wrote:
> En Sat, 07 Aug 2010 04:04:06 -0300, Stefan Schwarzer
> escribió:
>> On 2010-08-07 00:28, Steven D'Aprano wrote:
>
>>> Actually, yes, equality is implemented with a short-cut
> that checks for
>>> identity first. That makes something like:
>>> [..
On 08/07/2010 03:38 PM, Steven D'Aprano wrote:
> On Sat, 07 Aug 2010 14:00:59 +0200, Thomas Jollans wrote:
>
>> On 08/07/2010 05:05 AM, Default User wrote:
>>> >From "the emperor's new clothes" department:
>>>
>>> 1) Why do Python lis
On 08/07/2010 08:51 PM, Νίκος wrote:
> On 7 Αύγ, 21:24, MRAB wrote:
>
>> Use group capture:
>>
>> found = re.match(r'', firstline).group(1)
>> print(page_id)
>
> Worked like a charm! Thanks a lot!
>
> So match method here not only searched for the string representation
> of the number
On 08/07/2010 09:36 PM, Νίκος wrote:
> cookie.has_key('visitor') != 'nikos'
This is always True. has_key returns a bool, which is never equal to any
string, even 'nikos'.
--
http://mail.python.org/mailman/listinfo/python-list
On 08/08/2010 03:10 AM, W. eWatson wrote:
> I think I posted the errors my partner got above. Let me look. Yes,
> here's the copy.
> He gets
>
> Traceback (most recent call last):
> File "C:\Documents and
> Settings\HP_Administrator.DavesDesktop\Desktop\NC-FireballReport20100729.py",
> line 40,
On 08/08/2010 10:35 AM, blur959 wrote:
> On Aug 8, 4:15 pm, Chris Rebert wrote:
>> On Sun, Aug 8, 2010 at 1:02 AM, blur959 wrote:
>>> Hi, all, I am writing a program that renames files inside OS
>>> directories the user provides. I am at the early stage of writing it
>>> and I encountered some pr
On 08/08/2010 04:46 AM, rantingrick wrote:
> *facepalm*! I really must stop Usenet-ing whilst consuming large
> volumes of alcoholic beverages.
THAT explains a lot.
Cheers
--
http://mail.python.org/mailman/listinfo/python-list
On 08/08/2010 11:21 AM, Νίκος wrote:
> Please help me adjust it, if need extra modification for more php tags
> replacing.
Have you tried it ? I haven't, but I see no immediate reason why it
wouldn't work with multiple PHP blocks.
> #!/usr/bin/python
>
> import cgitb; cgitb.enable()
> import cgi
On 08/07/2010 07:53 PM, Gelonida wrote:
> Hi,
>
> I'm using g?vim and its c-scope plugin for browsing C-code.
>
> What would be a good way of navigating larger python projects with vim?
>
>
> thanks for any suggestions
>
http://pypi.python.org/pypi/pycscope/0.2
Looks like an option
--
http
On 08/08/2010 12:23 PM, blur959 wrote:
> On Aug 8, 6:05 pm, Thomas Jollans wrote:
>> On 08/08/2010 10:35 AM, blur959 wrote:
>>
>>
>>
>>> On Aug 8, 4:15 pm, Chris Rebert wrote:
>>>> On Sun, Aug 8, 2010 at 1:02 AM, blur959 wrote:
>>>>&g
On 08/08/2010 01:41 PM, Shambhu wrote:
> Hi Thomas,
>
>I checked, file is present. Here is my sample script:
> import os
> filename = "C:\SHAMBHU\tmp\text_delete.txt"
> os.unlink(filename)
>
> File "C:\SHAMBHU\tmp\text_delete.txt&
On 08/08/2010 01:41 PM, Νίκος wrote:
> I was so dizzy and confused yesterday that i forgot to metnion that
> not only i need removal of php openign and closing tags but whaevers
> data lurks inside those tags as well ebcause now with the 'counter.py'
> script i wrote the html fiels would open ftm t
On 08/08/2010 02:35 PM, blur959 wrote:
> Sorry, This is my first time using the os commands in python, Ok,
> firstly, I entered "C:\" inside raw_input and stored it inside
> fileroot. When i print repr(fileroot), my result was '"C:\\"' . And
> when I run os.listdir with fileroot, I got that error.
On 08/08/2010 04:06 PM, Νίκος wrote:
> On 8 Αύγ, 15:40, Thomas Jollans wrote:
>> On 08/08/2010 01:41 PM, Νίκος wrote:
>>
>>> I was so dizzy and confused yesterday that i forgot to metnion that
>>> not only i need removal of php openign and closing tags but wha
scoping) is less well-suited for this than PHP or
Ruby, and it's better to keep logic and presentation separate anyway.
"The" standard for using Python on the web is WSGI -- it's a very simple, low-
level interface between Python and the web server. There are a number of
higher-lev
On 2010-08-08 05:18, Dennis Lee Bieber wrote:
> Was it this thread where I commented that many early BASICs would
> allocate an eleven element array on
>
> DIM A(10)
VB.net does this -- to cater for the classic VB programmer who is used
to being able to index the number in brackets, and the .
On Friday 06 August 2010, it occurred to James Mills to exclaim:
> Quick question for you Python enthusiasts that also
> happen to know Perl quite well...
Few and far between ...
--
http://mail.python.org/mailman/listinfo/python-list
On Monday 09 August 2010, it occurred to genxtech to exclaim:
> I am trying to learn regular expressions in python3 and have an issue
> with one of the examples I'm working with.
> The code is:
>
> #! /usr/bin/env python3
>
> import re
>
> search_string = "[^aeiou]y$"
To translate this expressi
On Monday 09 August 2010, it occurred to Νίκος to exclaim:
> On 9 Αύγ, 19:21, Peter Otten <__pete...@web.de> wrote:
> > Νίκος wrote:
> > > Please tell me that no matter what weird charhs has inside ic an still
> > > open thosie fiels and make the neccessary replacements.
> >
> > Go back to 2.6 for
On Wednesday 11 August 2010, it occurred to John Nagle to exclaim:
> This is especially useful for FTP sites.
It sounds like you're trying to use HTTP to something a lot more easily done
with FTP, without any reason not to use FTP.
http://docs.python.org/library/ftplib.html#ftplib.FTP.dir
--
ht
On Wednesday 11 August 2010, it occurred to Back9 to exclaim:
> Hi,
>
> Does anyone know of what is the most popular gui framework for python
> application?
I'd guess at Tkinter - it's part of the standard library.
Another quite popular option is PyGtk. Other good ones include wxPython, PyQt,
an
On Wednesday 11 August 2010, it occurred to Eric J. Van der Velden to exclaim:
> Hello,
>
> I have these types,
>
> class A:
> def __init__(s):
> super().__init__()
> print("A")
> class B(A):
> def __init__(s):
> super().__init__()
>
On Wednesday 11 August 2010, it occurred to Baba to exclaim:
> level: beginner
>
> exercise: given that packs of McNuggets can only be bought in 6, 9 or
> 20 packs, write an exhaustive search to find the largest number of
> McNuggets that cannot be bought in exact quantity.
The MacDonald's at Nur
On Thursday 12 August 2010, it occurred to wheres pythonmonks to exclaim:
> try:
>f = n / d
> except:
>f = float("nan")
A catch-all except clause. Never a good idea. It's not as bad in this case, as
there is only one expression, but there are still a couple of other exceptions
that have
On Thursday 12 August 2010, it occurred to wheres pythonmonks to exclaim:
> [I just hate function call overhead for this.]
I think you've got your priorities wrong. If you want to avoid unnecessary
overhead, avoid exceptions more than functions.
--
http://mail.python.org/mailman/listinfo/python
On Thursday 12 August 2010, it occurred to Dlanor Slegov to exclaim:
> Hi,
>
> I am dealing with very large text files (a few million lines) and would
> like to check and modify them according to a well defined format. The
> format requires ONLY ONE NEWLINE (followed by some sort of text) on top o
On Thursday 12 August 2010, it occurred to RG to exclaim:
> %%% /&%%%
>
> If this were a properly unicode-enabled newsreader you would see a
> yin-yang symbol in the middle of s2.
Are you sure about that? Now maybe the mailing list gateway is messing things
up, but I rather suspect your newsread
On Tuesday 10 August 2010, it occurred to kj to exclaim:
> I'm looking for a module that implements "persistent lists": objects
> that behave like lists except that all their elements are stored
> on disk. IOW, the equivalent of "shelves", but for lists rather
> than a dictionaries.
>
> Does anyo
On Thursday 12 August 2010, it occurred to Bradley Hintze to exclaim:
> Hi all.
>
> Is there a way I can keep my floating point number as I typed it? For
> example, I want 34.52 to be 34.52 and NOT 34.520002.
The conversion from decimal to binary and vice versa is inexact -- but they're
the
On Thursday 12 August 2010, it occurred to John Nagle to exclaim:
> (Repost with better indentation)
Good, good.
>
> def readurl(url) :
> if url.endswith(".gz") :
The file name could be anything. You should be checking the reponse Content-
Type header -- that's what it's for.
> n
On 2010-08-13 13:22, Mikael Liljeroth wrote:
> Hi, this is my first contact with the python community so I hope this
> is the right place for my two questions.
> They are both related to embedding and extending python.
>
> I'm writing a program that dynamically loads c++ modules that extend
> the f
On 2010-08-13 17:27, Den wrote:
> There may be loads of reasons for it, but don't throw common sense
> around as one of them.
>
It's a good thing then that I didn't:
>> ... However, the killer reason is: "it's what everybody
>> else does.
>>
>
"Where it all started" is that 0-based index
On 2010-08-13 19:00, zaur wrote:
> All greetings!
>
> How to make portable distribution of python 2.6?
>
I don't know, but what you're looking for probably already exists.
Do you mean "portable" as in portable, i.e. "take this and build it for
your system, it should work if your OS is supported
On 2010-08-13 12:40, Srikanth N wrote:
> *1. How do we execute CGI Scripts in Windows?
> *
You'll need a web server.
> *2. How do i configure the Server?(If i use WAMP,XAMPP)
> *
For CGI, you just need your server configured for CGI, nothing
Python-specific. It would surprise me if XAMPP didn't se
On 2010-08-13 12:40, Srikanth N wrote:
> *2. How do i configure the Server?(If i use WAMP,XAMPP)
> *
Sorry, I forgot to link you to
http://www.editrocket.com/articles/python_apache_windows.html
Hope this helps.
--
http://mail.python.org/mailman/listinfo/python-list
On Saturday 14 August 2010, it occurred to Steven D'Aprano to exclaim:
> On Fri, 13 Aug 2010 18:25:46 -0400, Terry Reedy wrote:
> > A short background to MRAB's answer which I will try to get right.
> >
> > The byte-order-mark was invented for UTF-16 encodings so the reader
> > could determine whe
On Saturday 14 August 2010, it occurred to Frederick Williams to exclaim:
> I am learning Python from Hammond & Robinson's _Python Programming on
> Win32_, January 2000 edition. This
>
>print "Sleeping for 10 seconds"
>
> which appears in some example code, fails to... um... Compile?
> Inter
On Saturday 14 August 2010, it occurred to GZ to exclaim:
> Hi All,
>
> I am writing a little program that reads the minidom tree built from
> an xml file. I would like to print out the line number of the xml file
> on the parts of the tree that are not valid. But I do not seem to find
> a way to
On Saturday 14 August 2010, it occurred to GZ to exclaim:
> On Aug 14, 12:07 pm, Thomas Jollans wrote:
> > On Saturday 14 August 2010, it occurred to GZ to exclaim:
> > > Hi All,
> > >
> > > I am writing a little program that reads the minidom tree built fro
nge stuff in the foo.py module since it's part of
> an existing program. But, if I must, I suppose I could. I'd prefer to
> just short-circuit this if possible.
Exceptions. Simple. In the end, all system.exit does is raise a SystemExit
exception...
- Thomas
--
http://mail.python.org/mailman/listinfo/python-list
On Sunday 15 August 2010, it occurred to Jerrad Genson to exclaim:
> Hello,
>
> I'm learning Tkinter, and I have an issue that I'd appreciate help
> with. I have a program that initializes a GUI (I'll call this the "GUI
> process"), then spawns another process that listens on a network via
> the T
On Sunday 15 August 2010, it occurred to f...@kokkinizita.net to exclaim:
> Hello all,
>
> The documentation on execfile() and locals() makes it clear that code
> executed from execfile() can not modify local variables in the function
> from wich execfile() was called. Two questions about this:
>
On Monday 16 August 2010, it occurred to Jacky to exclaim:
> Hi there,
>
> Recently I'm facing a problem to convert 4 bytes on an bytearray into
> an 32-bit integer. So far as I can see, there're 3 ways:
> a) using struct module,
Yes, that's what it's for, and that's what you should be using.
On Monday 16 August 2010, it occurred to Jacky to exclaim:
> Hi Thomas,
>
> Thanks for your comments! Please check mine inline.
>
> On Aug 17, 1:50 am, Thomas Jollans wrote:
> > On Monday 16 August 2010, it occurred to Jacky to exclaim:
> > > Hi there,
>
On Tuesday 17 August 2010, it occurred to Rodrick Brown to exclaim:
> I have a fairly large file 1-2GB in size that I need to process line by
> line but I first need to convert the file to text using a 3rd party tool
> that prints the records also line by line.
>
> I've tried using Popen to do thi
On Tuesday 17 August 2010, it occurred to ata.jaf to exclaim:
> I am developing a little program in Mac with wxPython.
> But I have problems with the characters that are not in ASCII. Like
> some special characters in French or Turkish.
> So I am looking for a way to solve this. Like an encoding st
t the backslash, then why on earth did you put it there? You
have to be careful with backslashes, they bite ;-)
Anyway, you can simply do the formatting after the match.
>>> re.sub('(/)word(/)', r'\1%d\2', test) % 1000
'/my/1000/whats/wrong'
>>>
Or work with match objects to construct the resulting string by hand.
- Thomas
--
http://mail.python.org/mailman/listinfo/python-list
On Wednesday 18 August 2010, it occurred to John Nagle to exclaim:
> On 8/18/2010 11:24 AM, ernest wrote:
> > Hi,
> >
> > In this code:
> >
> > if set(a).union(b) == set(a): pass
> >
> > Does Python compute set(a) twice?
>
> CPython does. Shed Skin might optimize. Don't know
> about Iron
On Thursday 19 August 2010, it occurred to Dodo to exclaim:
> Hi all,
> I followed the tutorial but at page 4 I can't get rid of CSRF errors,
> even though I followed everything in this page :
> http://docs.djangoproject.com/en/dev/ref/contrib/csrf/
>
what kind of errors? Any exception tracebacks
2901 - 3000 of 3800 matches
Mail list logo