In <[EMAIL PROTECTED]>, lee wrote:
> what are the things that we can do with import from future usage.i
> heard its very interesting..thanks
Here's how to find out yourself (done with a 2.4 release):
In [2]: import __future__
In [3]: dir(__future__)
Out[3]:
['CO_FUTURE_DIVISION',
'CO_
what are the things that we can do with import from future usage.i
heard its very interesting..thanks
--
http://mail.python.org/mailman/listinfo/python-list
Nitin wrote:
> I am trying to subclass an extension type in Python and add attributes
> to the new class but I keep getting errors.
>
> cdef class Spam:
>
> cdef int amount
>
> def __new__(self):
> self.amount = 0
>
> I get an error "TypeError: 'name2' is an
> invalid keyword argument
Robert Kern wrote:
> Steven Bethard wrote:
>> How do I get distutils to include my testing module in just the "sdist"
>> distribution?
>
> Use a MANIFEST.
Thanks again to Robert Kern for all the help. For the record, in the
end all I did was add a MANIFEST.in file with the single line:
i
Robert Kern wrote:
> Steven Bethard wrote:
>> Robert Kern wrote:
>
>>> Are you sure that you don't have changes left over in your setup.py when you
>>> tested that?
>> Yep. (Though I still cleared everything out and tried it again.)
>> Here's what I got using an unmodified setup.py and the MANIF
Steven Bethard wrote:
> Robert Kern wrote:
>> Are you sure that you don't have changes left over in your setup.py when you
>> tested that?
>
> Yep. (Though I still cleared everything out and tried it again.)
> Here's what I got using an unmodified setup.py and the MANIFEST.in you
> suggested.
Robert Kern wrote:
> Steven Bethard wrote:
>> Robert Kern wrote:
>>> Steven Bethard wrote:
How do I get distutils to include my testing module in just the "sdist"
distribution?
>>> Use a MANIFEST.
>>>
>>> http://docs.python.org/dist/source-dist.html
>
> Also, I just noted this tidbit:
(Reposting to supply the URL that I forgot to include.:-()
I have released a small update to Plex to fix the
problem of assignment to None causing syntax warnings
or errors in Python 2.3 and later.
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Plex
What is Plex?
Plex is a Python module for
I need to parse a log file using python and I need some advice/wisdom
on the best way to go about it:
The log file entries will consist of something like this:
ID=8688 IID=98889998 execute begin - 01.21.2007 status enabled
locked working.lock
status running
status complet
Here're three sample 3-6 min videos showing off Python to math
teachers
thinking about using a computer language instead of just calculators:
http://controlroom.blogspot.com/2007/01/python-for-math-teachers.html
Higher resolution versions are available to teachers enrolling in our
program.
Ki
On Sat, 27 Jan 2007 19:29:06 -0800, Carl Banks wrote:
> On Jan 27, 6:51 pm, Steven D'Aprano
> <[EMAIL PROTECTED]> wrote:
>> On Sat, 27 Jan 2007 06:58:04 -0800, Carl Banks wrote:
>> >> I find that when I detect invalid parameters overtly, I spend less time
>> >> debugging.
>>
>> > If it helps go a
On Jan 27, 6:51 pm, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Sat, 27 Jan 2007 06:58:04 -0800, Carl Banks wrote:
> >> I find that when I detect invalid parameters overtly, I spend less time
> >> debugging.
>
> > If it helps go ahead an use them. The world won't end if you use an
> > asser
Steven Bethard wrote:
> Robert Kern wrote:
>> Steven Bethard wrote:
>>> How do I get distutils to include my testing module in just the "sdist"
>>> distribution?
>> Use a MANIFEST.
>>
>> http://docs.python.org/dist/source-dist.html
Also, I just noted this tidbit:
"""If you don't supply an expl
Robert Kern wrote:
> Steven Bethard wrote:
>> How do I get distutils to include my testing module in just the "sdist"
>> distribution?
>
> Use a MANIFEST.
>
> http://docs.python.org/dist/source-dist.html
>
>> I want test_argparse.py to be available in the source distribution, but
>> I don't
Thank you, I tried again and I figured it out.
That's something with beautiful soup, I worked with it a year ago also
dealing with Chinese html pages and nothing error happened. I read the
old code and I find the difference. Change the page to unicode before
feeding to beautiful soup, then every
Hello,
In moving from 2.4 to 2.5 I find that some of my unit tests are now
failing. I've worked out that the problem relates to the set update
method. In 2.4 I could update a set with an iterable type derived from
dict as the argument. I now find that the set is updated with the hash
values
AKA gray asphalt wrote:
> "John Nagle" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
>>AKA gray asphalt wrote:
>>
>>>I downloaded Blender but there was no link for python. Am I on the right
>>>track?
>>
>> Blender doesn't require Python, but if you have Python, you can
>>writ
"John Nagle" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> AKA gray asphalt wrote:
>> I downloaded Blender but there was no link for python. Am I on the right
>> track?
>
>Blender doesn't require Python, but if you have Python, you can
> write plug-ins for Blender. Get "The
"John Nagle" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> AKA gray asphalt wrote:
>> I downloaded Blender but there was no link for python. Am I on the right
>> track?
>
>Blender doesn't require Python, but if you have Python, you can
> write plug-ins for Blender. Get "The
"Alan Isaac" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> Please note that this post has subject
> "stop script w/o exiting interpreter".
> Note that I can just put the undefined name ``stop`` on any line
> I want, and the script will stop execucting at that line and will
>
On Sat, 27 Jan 2007 06:58:04 -0800, Carl Banks wrote:
>> I find that when I detect invalid parameters overtly, I spend less time
>> debugging.
>
> If it helps go ahead an use them. The world won't end if you use an
> assertion in a less than ideal situation. And, after all, if someone
> doesn
Please note that this post has subject
"stop script w/o exiting interpreter".
The object is to work at the *interactive* interpreter,
without leaving it.
Here is an example goal:
start a Python shell,
execfile a script,
exit the script at line 25,
and return to the Python shell.
E.g., some langu
I would definitely suggest checking out the documentation at http://
www.python.org/doc/. Also, you can check out the free book Dive into
Python at http://www.diveintopython.org. It provides a great overview
starting at the very beginning. I found it great and hope to buy it
soon to support t
Hi,
I need to implement ppp client connection in my program ... found chestnut
dialer so far ...
any other resource in mind ?
Thanks
hg
--
http://mail.python.org/mailman/listinfo/python-list
Steven Bethard wrote:
> How do I get distutils to include my testing module in just the "sdist"
> distribution?
Use a MANIFEST.
http://docs.python.org/dist/source-dist.html
> I want test_argparse.py to be available in the source distribution, but
> I don't think it should be included in the
Version 0.8 of Crunchy has been released. It is available on
http://code.google.com/p/crunchy/
Crunchy, the Interactive Python Tutorial Maker, is an application that
transforms an ordinary html-based Python tutorial into an interactive
session within a web browser. Currently, only Firefox is sup
After looking at the pyparsing results, I think I see the problem with
your original code. You are selecting only the characters after the
rightmost "-" character, but you really want to select everything to
the right of "- -". In some of the titles, the encoded Chinese
includes a "-" charac
On Jan 27, 5:18 am, "Frank Potter" <[EMAIL PROTECTED]> wrote:
> There are ten web pages I want to deal with.
> fromhttp://www.af.shejis.com/new_lw/html/125926.shtml
> to http://www.af.shejis.com/new_lw/html/125936.shtml
>
> Each of them uses the charset of Chinese "gb2312", and firefox
> displ
"Johny" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> How can I find server's IP address?
>>From console I can use ping, for example:
>
> C:\RobotP\cgi-bin>ping www.google.com
> Pinging www.google.com [209.85.129.147] with 32 bytes of data:
> [...]
> But how can I find it di
"Johny" <[EMAIL PROTECTED]> writes:
> So I know that www.google.com has 209.85.129.147 IP address.
> But how can I find it directly from Python script?
>>> import socket
>>> print socket.gethostbyname('www.google.com')
66.102.7.147
>>>
--
http://mail.python.org/mailman/listinfo/python-list
How do I get distutils to include my testing module in just the "sdist"
distribution? My current call to setup() looks like::
distutils.core.setup(
...
py_modules=['argparse'],
)
If change this to::
distutils.core.setup(
...
py_modules=['argpa
How can I find server's IP address?
>From console I can use ping, for example:
C:\RobotP\cgi-bin>ping www.google.com
Pinging www.google.com [209.85.129.147] with 32 bytes of data:
Reply from 209.85.129.147: bytes=32 time=30ms TTL=244
Reply from 209.85.129.147: bytes=32 time=30ms TTL=244
..
..
So
Pyrex 0.9.5 is now available:
http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/
Warning Elimination
Extensive changes have been made in this version in an
effort to eliminate most of the C compiler warnings that
used to occur when compiling with distutils.
There are also numerous other en
I have released a small update to Plex to fix the
problem of assignment to None causing syntax warnings
or errors in Python 2.3 and later.
What is Plex?
Plex is a Python module for lexical analysis that
provides similar functionality to Lex and Flex.
--
Greg
--
http://mail.python.org/mailman/li
ftputil 2.2.1 is now available from
http://ftputil.sschwarzer.net/download .
Changes since version 2.2
-
This bugfix release checks and ignores status code 451 when FTPFiles
are closed (thanks go to Alexander Holyapin). Upgrading is recommended.
What is ftputil?
-
"Martin P. Hellwig" <[EMAIL PROTECTED]> writes:
> I assume that this is not a problem, but since assuming something
> gives a lot of room for screw-ups I rather ask beforehand if I should
> except all kinds of troubles when multiple threads update 'at the same
> time' a dictionary or that I should
Frank Potter wrote:
> r=re.compile(ur"//[^\r\n]+$", re.UNICODE|re.VERBOSE)
> f_new=r.sub(ur"",f)
>From the documentation:
re.MULTILINE
When specified [...] the pattern character "$" matches at the
end of the string and at the end of each line (immediately
preceding each ne
Hi all,
I'm thinking to speed up a process, I like to use multiple threads to
get data fractions from multiple servers and place those data fragments
into a local dictionary for further processing, the dictionary will look
like this:
self.dic = {'thread_a':dict(),
'thread_b':dict()
On Jan 27, 5:37 am, [EMAIL PROTECTED] wrote:
> Hey Everyone
>
> Let me tell you all a little bit about my programming background so
> you can get an idea of my capability, or lack of, dealing with p.l;
> so far i've learned some visual basic when i was doing my a-levels
> and thats about it l
I'm trying to write a simple commandline wrapper: a script that runs
another program as a child and relays unbuffered stdin and stdout
to/from the child process, possibly filtering it.
The usefulness of such a program lies in the filtering stage, in a
possible integration with readline, or in othe
> I am trying to get pyzeroconf (http://sourceforge.net/projects/pyzeroconf)
> running on my machine but having trouble... Running the Zeroconf.py file
> seems to register the service, but is unable to find it.
You should be running avahi.. it also comes python support.
Here's an example that re
On Jan 25, 11:54 am, Matthew Wilson <[EMAIL PROTECTED]> wrote:
> Lately, I've been writing functions like this:
>
> def f(a, b):
>
> assert a in [1, 2, 3]
> assert b in [4, 5, 6]
>
> The point is that I'm checking the type and the values of the
> parameters.
>
> I'm curious how this does
On Jan 25, 11:26 pm, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> Note also that for real code, a bare assert like that is uselessly
> uninformative:
>
> >>> x = 1
> >>> assert x == 3Traceback (most recent call last):
> File "", line 1, in ?
> AssertionError
In real code, a traceback usually
Thanks Steve.
On Jan 27, 8:01 pm, "Steve" <[EMAIL PROTECTED]> wrote:
> use wx.Timer - you bind a method to a timer event and define the
> timer's interval when you start it
>
> timer = wx.Timer(self, -1)
> self.Bind(wx.EVT_TIMER, self.timerMethod, timer)
> timer.Start(500)
>
> On Jan 27, 5:56 pm,
Hey Everyone
Let me tell you all a little bit about my programming background so
you can get an idea of my capability, or lack of, dealing with p.l;
so far i've learned some visual basic when i was doing my a-levels
and thats about it lol.
Basically i like the sound of python and its eas
Fabrice DELENTE <[EMAIL PROTECTED]> wrote:
> My system is Linux, and the distribution is Slackware 10.1.
> I have
> /lib/libncurses.so.5.4
> /lib/libncursesw.so.5.4
> so I even have the wide-chars version available. Any hint on the python
> configuration? I didn't find any function that would al
Matthew Woodcraft <[EMAIL PROTECTED]> wrote:
> I have a question for you. Consider this function:
>
> def f(n):
> """Return the largest natural power of 2 which does not exceed n."""
> if n < 1:
> raise ValueError
> i = 1
> while i <= n:
> j = i
> i
On Jan 27, 6:11 am, Jeff Rush <[EMAIL PROTECTED]> wrote:
> While I have a reasonable understanding of the differences in new-style versus
> old-style classes, tonight while working a C extension module I realized I
> don't know how to indicate which style my C extension module should appear as.
>
>
It's solved, it was a locale problem: I put
import locale
locale.setlocale(locale.LC_ALL,"fr_FR.iso8859-1")
at the beginning of the script, and now the 8-bit-chars show up correctly.
Thanks all for your help.
--
Fabrice DELENTE
--
http://mail.python.org/mailman/listinfo/python-list
Jeff Rush schrieb:
> from cextension import Context
>
> class MyContext(Context):
>
> def __init__(self):
> super(Context, self).__init__()
>
> repeatedly and reliably failed with a corrupted C data structure, while
> this:
>
> class MyContext(Context):
>
> def __init__(self):
Duncan Booth:
> def nsplit(s, sep, n):
> return (s.split(sep) + [""]*n)[:n]
Another version, longer:
from itertools import repeat
def nsplit(text, sep, n):
"""
>>> nsplit("bcsn; 101; 1456", ";", 3)
['bcsn', ' 101', ' 1456']
>>> nsplit("bcsn; 101", ";", 3)
['bc
There are ten web pages I want to deal with.
from http://www.af.shejis.com/new_lw/html/125926.shtml
to http://www.af.shejis.com/new_lw/html/125936.shtml
Each of them uses the charset of Chinese "gb2312", and firefox
displays all of them in the right form, that's readable Chinese.
My job is,
While I have a reasonable understanding of the differences in new-style versus
old-style classes, tonight while working a C extension module I realized I
don't know how to indicate which style my C extension module should appear as.
I'm following the Python docs for extended modules, but it does
"Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote:
> Hendrik van Rooyen wrote:
> > "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote:
8< ---
> >
> Yea, I do some of that too. I use that with conditional print
> statements to stderr when i'm doing
use wx.Timer - you bind a method to a timer event and define the
timer's interval when you start it
timer = wx.Timer(self, -1)
self.Bind(wx.EVT_TIMER, self.timerMethod, timer)
timer.Start(500)
On Jan 27, 5:56 pm, "dudds" <[EMAIL PROTECTED]> wrote:
> Hi I really haven't used wxPython before and I
In <[EMAIL PROTECTED]>, Fabrice DELENTE wrote:
> As support for 8-bit (and even unicode) is important for my script, is there
> any hope? Should I switch to slang instead of curses?
Take a look at urwid:
http://excess.org/urwid/
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.or
On Jan 27, 9:18 am, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> On 2007-01-27, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > How can I convert a string to a char list?
> > for example
>
> > "hello" --> ['h','e','l','l','o']
>
> > I have been searching but I can't find my answers
> list("hello")
> Try "export LINES COLUMNS" to set them as environment variables.
Thanks, it works. Didn't know that.
--
Fabrice DELENTE
--
http://mail.python.org/mailman/listinfo/python-list
See, if the python list mail server was written in Lisp Paul Graham
would already have been able to write up a spam filter to ban this
guy.
Seriously though, shouldn't Thermate be banned by now.
Cheers,
Bryan Rasmussen
On 26 Jan 2007 10:56:44 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
On 27 Jan 2007 07:43:59 GMT, Fabrice DELENTE wrote
> Incidentally, I noticed something about the environment: in my
> script, I use the LINES and COLUMNS environment vars that are set in
> my shell:
>
> columns=int(os.environ.get("COLUMNS"))
> lines=int(os.environ.get("LINES"))
>
> In the shell
60 matches
Mail list logo