subhabangal...@gmail.com wrote:
> Dear Group,
>
> I was trying to convert the list to a set, with the following code:
>
> set1=set(list1)
>
> the code was running fine, but all on a sudden started to give the
> following error,
>
> set1=set(list1)
> TypeError: unhashable type: 'list'
>
> plea
Thomas Kaufmann wrote:
> I send from a client file content to my server (as bytes). So far so good.
> The server receives this content complete. Ok. Then I want to write this
> content to a new file. It works too. But in the new file are only the
> first part of the whole content.
>
> What's the
Vikas Kumar Choudhary wrote:
> let me know if someone has tried to implement (grep and PIPE) shell
> commands in python `lspci | grep Q | grep "$isp_str1" | grep "$isp_str2"
> | cut -c1-7'
>
> I tried to use python subprocess and OS.Popen modules.
subprocess is the way to go.
> I was trying
Rita wrote:
> I recently inherented a large python process and everything is lovely. As
> a learning experience I would like to optimize the code so I ran it thru
> the profiler
>
> python -m cProfile myscript.py
>
> It seems majority of the time is taking in the deep copy but that seems to
> co
o available in call-compatible Lua version:
http://www.pjb.com.au/comp/lua/MIDI.html
and is closely related to the Perl CPAN module.
You could consider posting Pyknon to comp.music.midi ;
it's very low traffic, but some real gurus lurk there.
All the best with your music,
Peter
--
Pet
danielashi...@googlemail.com wrote:
> This error has been bugging me for days. I know it's minor, but it's
> really getting in the way of my programming. I'm programming a data
> analysis programme for a psychology experiment which takes pickled data
> from the experiment and produces averages. Fo
Ethan Furman wrote:
> SQLite has a neat feature where if you give it a the file-name of
> ':memory:' the resulting table is in memory and not on disk. I thought
> it was a cool feature, but expanded it slightly: any name surrounded by
> colons results in an in-memory table.
>
> I'm looking at th
Gelonida N wrote:
> Is this possible.
>
> let's say I'd like to know whether I could import the module
> 'mypackage.mymodule', meaning,
> whther this module is located somewhere in sys.path
>
> i tried to use
>
> imp.find_module(), but
> it didn't find any module name containing a '.'
You coul
Helmut Jarausch wrote:
> I'd like to request adding the module
>
> http://pypi.python.org/pypi/regex
>
> to Python's standard library in the (near) future or to even replace the
> current 're' module by it.
>
> Personally I'm in need for fuzzy regular expressions and I don't see how
> to do thi
Helmut Jarausch wrote:
> On Tue, 07 Aug 2012 13:15:29 +0200, Peter Otten wrote:
>
>> I don't think that will help. From PEP 408:
>>
>> """
>> As part of the same announcement, Guido explicitly accepted Matthew
>> Barnett's 'rege
Thomas Draper wrote:
> I want to use with..as in a "reversible circuit generator". However, it
> seems that @contextmanager changes the expected nature of the class. I
> tried to distill the problem down to a simple example.
>
> import contextlib
>
> class SymList:
The problem you experience ha
lipska the kat wrote:
> If there isn't how does one go about
> contributing to the documentation.
http://docs.python.org/dev/py3k/bugs.html
A similar link should be right there in the footer of the socketserver
documentation.
--
http://mail.python.org/mailman/listinfo/python-list
Mok-Kong Shen wrote:
>
> In an earlier question about lists, I was told about the issue of
> creation of local names in a function. However, I still can't
> understand why the program below outputs:
>
> [999] sss
> [999]
>
> and not two identical lines of output. For both operators "+=" should
Simon Cropper wrote:
> Hi Everyone,
>
> I just had a great idea for a new python module. I haven't bothered
> googling it or doing any research.
>
> I need help putting together some code; today preferably, my boss is on
> my back. Can someone please contribute a functioning module showing me
>
Simon Cropper wrote:
> Anyone willing to contribute money to help with the compilation of the
> code will get a portion of the profits. Just send me your account
> details, name and address; and I will ensure, once I have been paid,
> that I will send you your cut! :)
This is starting to look lik
Virgil Stokes wrote:
>>> def testFunc(startingList):
>>>xOnlyList = []; j = -1
>>>for xl in startingList:
>>>if (xl[0] == 'x'):
>> That's going to fail in the starting list contains an empty string. Use
>> xl.startswith('x') instead.
> Yes, but this was by design (tacitly assumed that startingList
nepaul wrote:
> ===case1==:
> import sqlalchemy
> test1 = "631f2f68-8731-4561-889b-88ab1ae7c95a"
> cmdTest1 = "select * from analyseresult where uid = " + test1
> engine =
>
sqlalchemy.create_engine("mssql+pyodbc://DumpResult:123456@localhost/DumpRe
Frank Koshti wrote:
> I need to match, process and replace $foo(x=3), knowing that (x=3) is
> optional, and the token might appear simply as $foo.
>
> To do this, I decided to use:
>
> re.compile('\$\w*\(?.*?\)').findall(mystring)
>
> the issue with this is it doesn't match $foo by itself, and
Steven D'Aprano wrote:
> On Sat, 18 Aug 2012 19:34:50 +0100, MRAB wrote:
>
>> "a" will be stored as 1 byte/codepoint.
>>
>> Adding "é", it will still be stored as 1 byte/codepoint.
>
> Wrong. It will be 2 bytes, just like it already is in Python 3.2.
>
> I don't know where people are getting t
Steven D'Aprano wrote:
> On Sun, 19 Aug 2012 09:43:13 +0200, Peter Otten wrote:
>
>> Steven D'Aprano wrote:
>
>>> I don't know where people are getting this myth that PEP 393 uses
>>> Latin-1 internally, it does not. Read the PEP, it explicitly
crispy wrote:
> Thanks, i've finally came to solution.
>
> Here it is -> http://codepad.org/Q70eGkO8
>
> def pairwiseScore(seqA, seqB):
>
> score = 0
> bars = [str(' ') for x in seqA] # ...
> length = len(seqA)
> similarity = []
>
> for x in xrange(length):
>
> if
John Nagle wrote:
> On 8/20/2012 2:50 PM, Emile van Sebille wrote:
>> On 8/20/2012 1:55 PM Walter Hurry said...
>>> On Mon, 20 Aug 2012 12:19:23 -0700, Emile van Sebille wrote:
>>>
Package dependencies. If the OP intends to install a package that
doesn't support other than 2.6, you inst
wxjmfa...@gmail.com wrote:
> By chance and luckily, first attempt.
> c:\python32\python -m timeit "('€'*100+'€'*100).replace('€'
> , 'œ')"
> 100 loops, best of 3: 1.48 usec per loop
> c:\python33\python -m timeit "('€'*100+'€'*100).replace('€'
> , 'œ')"
> 10 loops, best of 3: 7.62 usec p
Kevin Zhang wrote:
> I want to sort the order of the unittest cases to be run, but found such
> statement in Python doc,
> "Note that the order in which the various test cases will be run is
> determined by sorting the test function names with respect to the built-in
> ordering for strings."
>
>
shaun wrote:
> I'm having an issue its my first time using python and i set up a class
> one of the methods is supposed to return a string but instead returns:
>
> 389E0>>
>
> Im very new to python and the object orientated feature doesnt seem to be
> as well put together as Java.
It's defini
William R. Wing (Bill Wing) wrote:
> In the middle of a longer program that reads and plots data from a log
> file, I have added the following five lines (rtt_data is fully qualified
> file name):
>
> wd = open(rtt_data, 'w')
> stat = wd.write(str(i))
> stat = wd.writelines(str(x_dates[:i]))
> st
Mark Carter wrote:
> Suppose I want to define a function "safe", which returns the argument
> passed if there is no error, and 42 if there is one. So the setup is
> something like:
>
> def safe(x):
># WHAT WOULD DEFINE HERE?
>
> print safe(666) # prints 666
> print safe(1/0) # prints 42
>
>
Laszlo Nagy wrote:
> def safe(deferred, default=42, exception=Exception):
>> ... try:
>> ... return deferred()
>> ... except exception:
>> ... return default
>
> What a beautiful solution! I was wondering if the following would be
> possible:
>
>
> def test(t
Lucretiel wrote:
> So I've started using unittest, and I love it. I use testdiscovery (python
> -m unittest discover) so that I can distribute my tests and don't have to
> manage them all manually. I wanted to start publishing my test results to
> xml, though. I found xmlrunner by googling around,
Kwpolska wrote:
> I am using argparse in my project. I want to localize it, but it
> seems to be impossible to change some things. See this, for example:
>
> usage: trash [-h] [-V] [-e] [-l] [-r] [-v] [-w] [PLIK [PLIK ...]]
>
> Trashman — menedżer śmietnika XDG w Pythonie.
>
> positional argu
mikcec82 wrote:
> Il giorno lunedì 27 agosto 2012 12:59:02 UTC+2, mikcec82 ha scritto:
>> Hallo,
>>
>>
>>
>> I have an html file on my pc and I want to read it to extract some text.
>>
>> Can you help on which libs I have to use and how can I do it?
>>
>>
>>
>> thank you so much.
>>
>>
>>
Ben Finney wrote:
> I have written a context manager to save and restore a name binding::
>
> import contextlib
>
> @contextlib.contextmanager
> def preserve_value(namespace, name):
> """ A context manager to preserve, then restore, the specified
> binding.
>
>
contro opinion wrote:
locale.setlocale(locale.LC_ALL, 'gbk')
> Traceback (most recent call last):
> File "", line 1, in
> File "/usr/lib/python2.6/locale.py", line 513, in setlocale
> return _setlocale(category, locale)
> locale.Error: unsupported locale setting
Try picking one of t
Tim Chase wrote:
> On 08/31/12 22:41, contro opinion wrote:
>>> u"english".encode("utf-8")
'english'
>>> u"english".encode("ascii")
'english'
how can i get 656e676c697368 in encode method?
>>>
>>> At least in 2.x, you can do:
>>>
>>> >>> u"english".encode("hex")
>>> '
Arnaud Delobelle wrote:
> On Friday, 31 August 2012, Dennis Lee Bieber wrote:
>
>> On Fri, 31 Aug 2012 15:41:01 GMT, Alister
>>
>> >
>> declaimed the following in gmane.comp.python.general:
>>
>> > I agree that it is unexpected in a single line entry box but isn't the
>> 1st
>> > rule of user in
Ian Kelly wrote:
> Rewriting the example to use locale.strcoll instead:
sorted(li, key=functools.cmp_to_key(locale.strcoll))
There is also locale.strxfrm() which you can use directly:
sorted(li, key=locale.strxfrm)
--
http://mail.python.org/mailman/listinfo/python-list
Token Type wrote:
> I wrote codes to add 'like' at the end of every 3 word in a nltk text as
follows:
>
> >>> text = nltk.corpus.brown.words(categories = 'news')
> >>> def hedge(text):
> for i in range(3,len(text),4):
> new_text = text.insert(i, 'like')
> return n
wxjmfa...@gmail.com wrote:
> Le dimanche 2 septembre 2012 14:01:18 UTC+2, Serhiy Storchaka a écrit :
>> Hmm, and with locale.strxfrm Python 3.3 20% slower than 3.2.
>
> With a memory gain = 0 since my text contains non-latin-1 characters!
I can't confirm this. At least users of wide builds will
Chris Angelico wrote:
> You may also be needlessly reinventing the wheel. Aren't there already
> several million basic contact databases around? Why roll your own?
To learn a thing or two, and to stick it to the defeatists ;)
--
http://mail.python.org/mailman/listinfo/python-list
Roy Smith wrote:
> There's been a bunch of threads lately about string implementations, and
> that got me thinking (which is often a dangerous thing).
>
> Let's assume you're testing two strings for equality. You've already
> done the obvious quick tests (i.e they're the same length), and you're
Chris Angelico wrote:
> On Wed, Sep 5, 2012 at 6:29 PM, Peter Otten <__pete...@web.de> wrote:
>> comparing every pair in a sample of 1000 8-char words
>> taken from '/usr/share/dict/words'
>>
>> head
>> 1: 477222
BobAalsma wrote:
> I'm trying to understand the HTMLParser so I've copied some code from
http://docs.python.org/library/htmlparser.html?highlight=html#HTMLParser and
tried that on my LinkedIn page.
> No errors, but some of the tags seem to go missing for no apparent reason
- any advice?
> I hav
charvigro...@gmail.com wrote:
> Finally I have decided to put best interview question and answers.
>
> Please visit http://***/web/CorePython/ for core python
> and http://***/web/PythonAdvanced/ for advanced python
Hm, are you a reformed PHP programmer who has never heard of sql injection
atta
Oscar Benjamin wrote:
> On 5 September 2012 10:48, Peter Otten <__pete...@web.de> wrote:
>> def count_common(a, b):
[sorry for seriously broken implementation]
> This function will return 1 if the first character differs. It does not
> count the number of common character
Levi Nie wrote:
> how can i register the non-default browser with the webbrowser module?
>
> the case:
> i want open a site such as "google.com" in ie8 with the python.But my
> default is chrome.
> so i want to register a ie8 controller with the
> webbrowser.register(*name*, *constructor*[, *inst
BobAalsma wrote:
> [Didn't understand the bit about the kittens, though. How about that?]
>
> Oops, sorry, found that bit about logging in - asked too soon; still
> wonder about the kittens ;)
I just wanted to tell you not to mark the end of an if-suite with an "# end
if" comment. As soon as yo
shaun wrote:
> I have a class which I create an object from in a different script but
when its run I get an error at the last part of this method:
> def databasebatchcall(self,tid, bid):
> con=cx_Oracle.connect(
> 'user/user...@odb4.dcc.company/ODB4TEST.COMPANY.COM')
> c
月忧茗 wrote:
> HI, I have some test code:
>
>
> def num(num):
> def deco(func):
> def wrap(*args, **kwargs):
> inputed_num = num
> return func(*args, **kwargs)
> return wrap
> return deco
>
>
> @num(5)
> def test(a):
> return a + inputed_num
>
MRAB wrote:
> On 12/09/2012 19:04, Alister wrote:
>> On Wed, 12 Sep 2012 18:56:46 +0200, Jabba Laci wrote:
>>
For example:
def install_java():
pass
def install_tomcat():
pass
>>>
>>> Thanks for the answers. I decided to use numbers in the name of the
>>> fu
Νικόλαος Κούρας wrote:
> Τη Σάββατο, 15 Σεπτεμβρίου 2012 4:38:51 μ.μ. UTC+3, ο χρήστης Chris
> Angelico έγραψε:
>> On Sat, Sep 15, 2012 at 11:28 PM, Νικόλαος Κούρας
>> wrote:
>>
>> > Iam not using frameworks just plain python code written in Notepad++
>>
>> >
>>
>> > Can you please tell me how
Santosh Kumar wrote:
> I have a script that takes an which basically takes a command line
> argument and prints after processing. If I don't give the argument to
> the script, it gives me a ValueError:
>
> ValueError: need more than 1 value to unpack
>
> I was trying to utilizing this space, if
Dwight Hutto wrote:
>>> Alan Gauld quotes, "Putting on my moderator's hat", sometimes.
>>>
is as you describe, a monarchy whose head but seldom exercises power;
>>>
>>>
>>> I think it's Rossenbom(or whoever the creator of the interpreter
>>> written in C is), "who says benevolent dictator for
Neal Becker wrote:
> I have a list of dictionaries. They all have the same keys. I want to
> find the set of keys where all the dictionaries have the same values.
Suggestions?
>>> items = [
... {1:2, 2:2},
... {1:1, 2:2},
... ]
>>> first = items[0].items()
>>> [key for key, value in first if
Dwight Hutto wrote:
>> I have a list of dictionaries. They all have the same keys. I want to
>> find the
>> set of keys where all the dictionaries have the same values.
>> Suggestions?
>
> Here is my solution:
>
>
> a = {}
> a['dict'] = 1
>
> b = {}
> b['dict'] = 2
>
> c = {}
> c['dict'] =
Makoto Kuwata wrote:
> Is it possible to run code object with local variables specified?
> I'm trying the following code but not work:
>
> def fn():
>x = 1
>y = 2
> localvars = {'x': 0}
> exec(fn.func_code, globals(), localvars)
> print(localvars)
> ## what I e
Makoto Kuwata wrote:
> On Thu, Sep 20, 2012 at 10:15 PM, Peter Otten <__pete...@web.de> wrote:
>>
>>>>> loc = {}
>>>>> exec("x = 1; y = 2", globals(), loc)
>>>>> loc
>> {'y': 2, 'x': 1}
>>
>&
echo.hp...@gmail.com wrote:
> may i know how to shift the bits using only looping and branching??
import time
data = """\
xx
.x..x.
..xx..
..xx..
.x..x.
xx
""".splitlines()
data = [line * 12 for line in data] # optional
while True:
print "\x1b[2J\x1b[0;0H" # optional
for i, li
BobAalsma wrote:
> Hmm, from the previous posts I get the impression that I could best solve
> this by asking the user for the specific combination of username, password
> and URL + promising not to keep any of that...
>
> OK, that does sound doable - thank you all
Hmm, promising seems doable, b
Ismael Farfán wrote:
> 2012/9/21 Peter Otten <__pete...@web.de>:
>> echo.hp...@gmail.com wrote:
>>
>> print "\x1b[2J\x1b[0;0H" # optional
>
> Nice code : )
>
> Could you dissect that weird string for us?
>
> It isn't returning t
Νίκος Γκρεεκ wrote:
> One webpage of mine, http://www.varsa.gr/ has been *hacked* 15 mins ago.
> Please visit my web page varsa.gr and view the source code and maybe you
> can tell me what has happened.
Do you use a password that was exposed in the other thread,
http://mail.python.org/pipermail
tinn...@isbd.co.uk wrote:
> I have a python script which uses the dateutil module with the
> following:-
>
> import sys
> import datetime
> import icalendar
> from dateutil.relativedelta import relativedelta
>
> The section of code which uses relativedelta is as follows:-
>
>
Jayden wrote:
> In the Python Tutorial, Section 9.4, it is said that
>
> "Data attributes override method attributes with the same name."
The tutorial is wrong here. That should be
"Instance attributes override class attributes with the same name."
As methods are usually defined in the class a
alex23 wrote:
> On Sep 26, 12:08 am, Peter Otten <__pete...@web.de> wrote:
>> Jayden wrote:
>> > In the Python Tutorial, Section 9.4, it is said that
>>
>> > "Data attributes override method attributes with the same name."
>>
>&g
Vincent Vande Vyvre wrote:
> In my application I import a module and I want to set the same logging
> level as the main app to this module.
Isn't that the default? If you set the logging level with basicConfig() that
level should be applied to all messages.
--
http://mail.python.org/mailman/
iMath wrote:
> I only know the dollar sign ($) will match a pattern from the
> end of a string,but which method does it work with ,re.match() or
> re.search() ?
Why not try it out in the interactive interpreter? Here's the "deluxe
version":
>>> def demo(pattern="mid$", texts=["start mid end",
Neal Becker wrote:
> I know this should be a fairly basic question, but I'm drawing a blank.
>
> I have code that looks like:
>
> for s0 in xrange (n_syms):
> for s1 in xrange (n_syms):
> for s2 in xrange (n_syms):
> for s3 in xrange (n_syms):
>
On Fri, 28 Sep 2012 09:49:36 -0600, Ian Kelly wrote:
>
> levels = 6
> for combination in itertools.product(xrange(n_syms), levels):
> # do stuff
>>> n_syms = 3
>>> levels = 6
>>> for combination in itertools.product(xrange(n_syms), levels):
... print combination
...
Traceback (most recent
s not callable
What am I doing wrong?
Thanks!
Peter Farrell
San Mateo, CA
--
http://mail.python.org/mailman/listinfo/python-list
ath teacher/tutor who's trying to teach my
students to understand math through using something real like Python. I'll keep
you posted on my progress.
Thank you in advance for your help!
Peter
On Sunday, September 30, 2012 1:22:31 PM UTC-7, Hans Mulder wrote:
> On 30/09/12 21:42:37, Peter F
On Sunday, September 30, 2012 6:25:29 PM UTC-7, Steven D'Aprano wrote:
> On Sun, 30 Sep 2012 17:35:02 -0700, Peter Farrell wrote:
>
>
>
> > Thanks for trying to help, everybody. Sorry I didn't post the whole
>
> > error message. Now my problem is I
On Sunday, September 30, 2012 8:19:28 PM UTC-7, Dave Angel wrote:
> On 09/30/2012 09:35 PM, Peter Farrell wrote:
>
> > On Sunday, September 30, 2012 6:25:29 PM UTC-7, Steven D'Aprano wrote:
>
> >> On Sun, 30 Sep 2012 17:35:02 -0700, Peter Farrell wrote:
>
>
Daniel Fetchinson wrote:
> I've noticed a strange thing with python lately:
>
>
>
> Python 2.6.2 (r262:71600, Aug 21 2009, 12:23:57)
> [GCC 4.4.1 20090818 (Red Hat 4.4.1-6)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
def f(): print x
> ...
f()
>
Ulrich Eckhardt wrote:
> As you see, the code for test_base() is redundant, so the idea is to
> move it to a baseclass:
>
> class TestBase(unittest.TestCase):
> def test_base(self):
> ...
>
> class TestD1(TestBase):
> def test_r(self):
> ...
> def test_s(self):
>
Ulrich Eckhardt wrote:
> Am 02.10.2012 16:06, schrieb Thomas Bach:
>> On Tue, Oct 02, 2012 at 02:27:11PM +0200, Ulrich Eckhardt wrote:
>>> As you see, the code for test_base() is redundant, so the idea is to
>>> move it to a baseclass:
>>>
>>> class TestBase(unittest.TestCase):
>>> def test_b
Fayaz Yusuf Khan wrote:
> Peter Otten wrote:
>
>> Ulrich Eckhardt wrote:
>>> The problem here is that TestBase is not a complete test case (just
> as
>>> class Base is not complete), but the unittest framework will still
> try
>>> to run it on its
David Banks wrote:
> I want to add a custom assert method to a TestCase subclass. I tried to
> copy my implementation from the unittest module so that it would match
> the behaviour of the regular TestCase as closely as possible. (I would
> prefer to just delegate to self.assertEqual() but this
Manuel Pégourié-Gonnard wrote:
> Peter Otten scripsit :
>
>> David Banks wrote:
>>
>>> Note that the custom assert method causes a stack trace with two frames,
>>> one inside the method itself, whereas the stock unittest method only has
>>> one fram
Manuel Pégourié-Gonnard wrote:
> However, there was an implied question in the "documented" part: can
> we rely on it? Isn't it considered an implementation detail (names
> starting with underscores)?
"Not documented" was my implied answer.
I think you have a valid use case, though, so you could
palmeira wrote:
> Dear pythonists,
>
> I'm having a problem with read/write binary in python.
> I have a binary file that I need to read information, extract a array,
> modify this array and put these values into file again in same binary
> format.
> I need to use unpack_from and pack_into becaus
Johannes Graumann wrote:
> Dear all,
>
> I'm trying to convert
> '00:08:9b:ce:f5:d4'
> to
> '\x00\x08\x9b\xce\xf5\xd4'
> for use in magic packet construction for WakeOnLan like so:
> wolsocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
>wolsocket.setsockopt(socket.SOL_SOCKET, sock
mooremath...@gmail.com wrote:
> What's the best way to accomplish this? Am I over-complicating it? My
> gut feeling is there is a better way than the following:
>
import itertools
x = [1, 2, 3]
y = list(itertools.chain.from_iterable(('insertme', x[i]) for i in
range(len(x)))
Duncan Booth wrote:
> mooremath...@gmail.com wrote:
>
>> What's the best way to accomplish this? Am I over-complicating it?
>> My gut feeling is there is a better way than the following:
>>
> import itertools
> x = [1, 2, 3]
> y = list(itertools.chain.from_iterable(('insertme', x[i]
Michele Simionato wrote:
> I have the following module implementing a registry of functions with a
> decorator:
>
> $ cat x.py
> registry = {} # global dictionary
>
> def dec(func):
> registry[func.__name__] = func
> print registry, id(registry)
> return func
>
> if __name__ == '__m
Grant Edwards wrote:
> On 2012-10-09, Peter Otten <__pete...@web.de> wrote:
>
>> Welcome to python -- this is a trap every newbie falls into ;)
>>
>> Seriously, you shouldn't use the main script as a library;
>
> There must be something wrong with me.
Tim Arnold wrote:
> I have an external process, 'tralics' that emits mathml when you feed it
> latex equations. I want to get that mathml into a string.
>
> The problem for me is that tralics wants to talk to a tty and I've never
> done that before; it basically starts its own subshell.
>
> I ha
Joon Ki Choi wrote:
>
> Hello Pythonistas,
>
> i have a very large textfile with contents like:
>
> @INBOOK{Ackermann1999-b,
> author = {Ackermann, K.-F. and Ackermann, K.-F. and Ackermann, K.-F. and
> Ackermann,
> K.-F. and Ackermann, K.-F. and Ackermann, K.-F. and Ackermann, K.-F.
> and A
Ethan Furman wrote:
> Terry Reedy wrote:
>> In 3.x, you would write __setitem__ to recognize that the 'key' is a
>> slice object rather than an int and act accordingly. (In 2.x, you would
>> write __setslice__.)
>
> I'm not sure how far back it goes, but at least from 2.4 forward
> __setitem__ wo
Steven D'Aprano wrote:
> I'm working with the readline module, and I'm trying to set a key
> combination to process the current command line by calling a known
> function, *and* enter the command line.
>
> Something along the lines of:
>
> * execute function spam() in some context where it can a
Ned Deily wrote:
> In article , Peter Otten <__pete...@web.de>
> wrote:
>> Steven D'Aprano wrote:
>> > I'm working with the readline module, and I'm trying to set a key
>> > combination to process the current command line by calling
Dwight Hutto wrote:
I knew I'd eventually regret putting "on topic" into the subject...
Well done, Dwight.
--
http://mail.python.org/mailman/listinfo/python-list
Mark Lawrence wrote:
> Where is this specific usage documented as my search engine skills have
> let me down?
find and grep ftw.
> By this I mean entering help() without parameters to get
> the following output and then the help> prompt.
http://docs.python.org/dev/py3k/library/functions.html#
Jennie wrote:
> The dir() built-in does not show the __name__ attribute of a class:
>
> >>> '__name__' in Foo.__dict__
> False
> >>> Foo.__name__
> 'Foo'
>
> I implementd my custom __dir__, but the dir() built-in do not want to
> call it:
>
> >>> class Foo:
> ... @classmethod
> ... d
Jennie wrote:
> On 10/20/2012 10:24 AM, Peter Otten wrote:
>
>> So if you want to customise dir(Foo) you have to modify the metaclass:
>>
>>>>> >>>class Foo:
>> ... class __metaclass__(type):
>> ... def __dir__(self):
Chris Rebert wrote:
> line.strip().split()
No need to strip() if you are going to split on whitespace:
>>> line = " a b c \n"
>>> line.split() == line.strip().split()
True
Lest the new idiom takes on while you are bravely fighting the immortable
readlines() ;)
--
http://mail.python.org/mailm
satyam wrote:
> I have a text file like this
>
> A1980JE3937 2732 4195 12.527000
> A1980JE3937 3465 9720 22.00
> A1980JE3937 1853 3278 12.50
> A1980JE3937 2732 2732 187.50
> A1980JE3937 19 4688 3.619000
> A1980JE3937 2995 9720 6.667000
> A1980JE3937 1603 97
Peter Otten wrote:
Brave new words:
> immortable
should be "immortal"
--
http://mail.python.org/mailman/listinfo/python-list
Dennis Lee Bieber wrote:
> On Wed, 24 Oct 2012 11:04:38 +0200, Peter Otten <__pete...@web.de>
> declaimed the following in gmane.comp.python.general:
>
>> Peter Otten wrote:
>>
>> Brave new words:
>>
>> > immortable
>>
>> should
Steven D'Aprano wrote:
> On Thu, 25 Oct 2012 07:47:48 +0200, Peter Otten wrote:
>
>> Wasn't there a Monty Python sketch where a man carrying a parrot in a
>> cage comes into a shop full of stuffed animals and complains: No, I
>> don't admire the taxiderm
On Thu, 25 Oct 2012 12:16:58 +0200, Schneider wrote:
> how can i create a SSH-Connection with python? I have to send some
> commands to the remote host and parse their answers.
> greatz Johannes
I've been using Twisted (twistedmatrix.com). It is especially
convenient for the server end. Its or
On 25 Oct 2012 16:55:46 GMT, Peter Pearson wrote:
> On Thu, 25 Oct 2012 12:16:58 +0200, Schneider wrote:
>> how can i create a SSH-Connection with python? I have to send some
>> commands to the remote host and parse their answers.
>> greatz Johannes
>
&
301 - 400 of 9315 matches
Mail list logo