Chris Angelico wrote:
> It's also worth noting that the ~/ notation is a shell feature. You
> may or may not be able to use it in config.read().
The latter. Combined with
"""
read(self, filenames) method of ConfigParser.ConfigParser instance
Read and parse a filename or a list of filenames.
Roy Smith wrote:
> In article ,
> Sudheer Joseph wrote:
>
>> Dear members,
>> I need to print few arrays in a tabular form for example
>> below array IL has 25 elements, is there an easy way to print
>> this as 5x5 comma separated table? in python
>>
>> IL=[
Olive wrote:
> One feature that seems to be missing in the re module (or any tools that I
> know for searching text) is "diacretical incensitive search". I would like
> to have a match for something like this:
>
> re.match("franc", "français")
>
> in about the same whay we can have a case incens
Jurgens de Bruin wrote:
> This is my first script where I want to use the python threading module. I
> have a large dataset which is a list of dict this can be as much as 200
> dictionaries in the list. The final goal is a histogram for each dict 16
> histograms on a page ( 4x4 ) - this already w
Jurgens de Bruin wrote:
> I will post code - the entire scripts is 1000 lines of code - can I post
> the threading functions only?
Try to condense it to the relevant parts, but make sure that it can be run
by us.
As a general note, when you add new stuff to an existing longish script it
is alw
Dan Stromberg wrote:
> I'm getting the error in the subject, from the following code:
> def add(self, key):
> """
> Adds a node containing I{key} to the subtree
> rooted at I{self}, returning the added node.
> """
> node = self.find(key)
> if not
Dan Stromberg wrote:
> python 2.x, python 3.x and pypy all give this same error, though jython
> errors out at a different point in the same method.
By the way, 3.x doesn't have unbound methods, so that should work.
--
http://mail.python.org/mailman/listinfo/python-list
Cameron Simpson wrote:
> TL;DR: I think I want to modify an int value "in place".
>
> Yesterday I was thinking about various "flag set" objects I have
> floating around which are essentially bare "object"s whose attributes
> I access, for example:
>
> flags = object()
> flags.this = True
>
Absalom K. wrote:
> Hi, I am working on Linux; a friend of mine sends to me python files from
> his Windows release. He uses the editor coming with the release; he runs
> his code from the editor by using a menu (or some F5 key I think).
>
> He doesn't declare any encoding in his source file; whe
Alex Naumov wrote:
> I'm trying to call new process with some parameters. The problem is that
> the last parameter is a "string" that has a lot of spaces and different
> symbols like slash and so on. I can save it in file and use name of this
> file as parameter, but my question is: how to make it
lokeshkopp...@gmail.com wrote:
> i had written the following code i am unable to create the instance of the
> class "Node" in the method "number_to_LinkedList" can any one help me how
> to do ?? and what is the error??
>
>
> class Node:
> def __init__(self, value=None):
> self.valu
Νίκος Γκρ33κ wrote:
> Hello this is the following snippet that is causing me the error i mention
> in the Subject:
> print( " color=tomato size=5> %s " ) % (url, url)
Hint (Python 3):
>>> print("a=%s, b=%s") % (1, 2)
a=%s, b=%s
Traceback (most recent call last):
File "", line 1, in
TypeError
Νίκος Γκρ33κ wrote:
> Thank you very much Peter, so as it seems in Python 3.3.1 all
> substitutuons must be nested in print().
Yes; in other words:
In Python 3 print() is a function.
--
http://mail.python.org/mailman/listinfo/python-list
Νίκος Γκρ33κ wrote:
> python3 pelatologio.py gives me error in this line:
>
> Traceback (most recent call last):
> File "pelatologio.py", line 283, in
> ''' % (months[key], key) )
> KeyError: 1
>
> The code is:
>
> #populating months into a dropdown menu
> years = ( 2010, 2011,
JackM wrote:
> Having a problem getting a py script to execute. Got this error:
>
> File "/scripts/blockIPv4.py", line 19
> ip = line.split(';')[0]
> ^
> IndentationError: expected an indented block
>
>
> I'm perplexed because the code that the error refers to *is* indented:
>
>
>
Chris Angelico wrote:
> On Wed, May 29, 2013 at 2:19 AM, Peter Otten <__pete...@web.de> wrote:
>> Solution: configure your editor to use four spaces for indentation.
>
> ITYM eight spaces.
I meant: one hit of the Tab key should add spaces up to the next multiple of
four.
Luca Cerone wrote:
>>
>> That's because stdin/stdout/stderr take file descriptors or file
>>
>> objects, not path strings.
>>
>
> Thanks Chris, how do I set the file descriptor to /dev/null then?
For example:
with open(os.devnull, "wb") as stderr:
p = subprocess.Popen(..., stderr=stderr)
Serhiy Storchaka wrote:
> 30.05.13 23:46, Skip Montanaro написав(ла):
>> Am I missing something about how io.StringIO works? I thought it was
>> a more-or-less drop-in replacement for StringIO.StringIO.
>
> io.StringIO was backported from Python 3. It is a text (unicode) stream.
> cStringIO.Stri
Chris Angelico wrote:
> On Tue, Jun 4, 2013 at 5:57 PM, John Ladasky
> wrote:
>> On Tuesday, June 4, 2013 12:45:38 AM UTC-7, Anssi Saari wrote:
>>
>>> BTW, did I get the logic correctly, the end result is random?
>>
>> You're right! I'm guessing that's not what the OP wants?
>
> I'm guessing th
mstagliamonte wrote:
> Hi everyone,
>
> I am a beginner in python and trying to find my way through... :)
>
> I am writing a script to get numbers from the headers of a text file.
>
> If the header is something like:
> h01 = ('>scaffold_1')
> I just use:
> h01.lstrip('>scaffold_')
> and this re
alex23 wrote:
> def get_transcript_and_size(line):
> columns = line.strip().split()
> return columns[0].strip(), int(columns[1].strip())
You can remove all strip() methods here as split() already strips off any
whitespace from the columns.
Not really important, but the nitp
Michael wrote:
> I'm writing a decorator that I never want to be nested. Following from the
> answer on my StackOverflow question
> (http://stackoverflow.com/a/16905779/106244), I've adapted it to the
> following.
>
> Can anyone spot any issues with this? It'll be run in a multi-threaded
> enviro
lionelgreenstr...@gmail.com wrote:
> Sorry for my quote,
> but do you have any suggestion?
>> After 30seconds (more or less) the program crashes: seems a buffer
>> problem, but i'm not really sure.
>>
>> What's wrong?
I don't use qt or pyserial myself, but your problem description is too vague
ethereal_r...@hotmail.com wrote:
> Hello, I'm working with PostgreSQL and Python to obtain 2 columns froma
> database and need to print it in a specific format.
>
> Here is my current code.
>
>
>
> #!/usr/bin/python
> # -*- coding: utf-8 -*-
>
> import psycopg2
> import sys
>
> con = None
>
Tim Chase wrote:
> On 2013-06-07 23:46, Jason Swails wrote:
>> On Fri, Jun 7, 2013 at 10:32 PM, Tim Chase
>> > def calculate(params):
>> > a = b = 0
>> > if some_calculation(params):
>> > a += 1
>> > if other_calculation(params):
>> > b += 1
>> > return (a, b)
>> >
>>
claire morandin wrote:
> I have the following script which does not return anything, no apparent
> mistake but my output file is empty.I am just trying to extract some
> decimal number from a file according to their names which are in another
> file. from collections import defaultdict import nump
claire morandin wrote:
> Thanks Peter, true I did not realize that ercc_contigs is empty, but I am
> not sure how to "populate" the dictionary if I only have one column for
> the value but no key
You could use a "dummy value"
ercc_contigs = {}
for line in open('Faq_ERCC_contigs_name.txt'):
g
Rui Maciel wrote:
> Let:
> - class Point be a data type which is used to define points in space
> - class Line be a data type which possesses an aggregate relationship with
> objects of type Point
> - class Model be a container class which stores collections of Point and
> Line objects
>
>
> Ess
Rui Maciel wrote:
> Peter Otten wrote:
>
>> Don't add
>>
>>>position = []
>>
>> to your code. That's not a declaration, but a class attribute and in the
>> long run it will cause nothing but trouble.
>
> Why's that?
Especial
Rui Maciel wrote:
> How do you guarantee that any object of a class has a specific set of
> attributes?
You don't.
Such a guarantee is like the third wheel on a bike -- it doesn't improve the
overall experience.
PS: I'd rather not mention the memory-saving technique that is sometimes
abused,
Rui Maciel wrote:
> Peter Otten wrote:
>
>> Rui Maciel wrote:
>>
>>> How do you guarantee that any object of a class has a specific set of
>>> attributes?
>>
>> You don't.
>
>
> What's your point regarding attribute assignme
Rui Maciel wrote:
> Peter Otten wrote:
>
>> I don't understand the question. My original point was that you should
>> omit class attributes that don't fulfill a technical purpose.
>>
>
> You've said the following:
>
>
>> class Point
Chris Angelico wrote:
> On Tue, Jun 11, 2013 at 6:34 AM, Roy Smith wrote:
>> new_songs = [s for s in songs if s.is_new()]
>> old_songs = [s for s in songs if not s.is_new()]
>
> Hmm. Would this serve?
>
> old_songs = songs[:]
> new_songs = [songs.remove(s) or s for s in songs if s.is_new()]
>
Fábio Santos wrote:
> On 10 Jun 2013 23:54, "Roel Schroeven" wrote:
>>
>> You could do something like:
>>
>> new_songs, old_songs = [], []
>> [(new_songs if s.is_new() else old_songs).append(s) for s in songs]
>>
>> But I'm not sure that that's any better than the long version.
>
> This is so be
Terry Jan Reedy wrote:
> Many long-time posters have advised "Don't rebind built-in names*.
I'm in that camp, but I think this old post by Guido van Rossum is worth
reading to put the matter into perspective:
"""
> That was probably a checkin I made. I would have left it alone except the
> cod
rusi wrote:
> On Jun 11, 12:09 pm, Peter Otten <__pete...@web.de> wrote:
>> Terry Jan Reedy wrote:
>> > Many long-time posters have advised "Don't rebind built-in names*.
>>
>> I'm in that camp, but I think this old post by Guido van Rossum is
Chris Angelico wrote:
> On Wed, Jun 12, 2013 at 1:28 AM, Serhiy Storchaka
> wrote:
>> 11.06.13 01:50, Chris Angelico написав(ла):
>>
>>> On Tue, Jun 11, 2013 at 6:34 AM, Roy Smith wrote:
new_songs = [s for s in songs if s.is_new()]
old_songs = [s for s in songs if not s.is_new()]
Joshua Landau wrote:
> On 11 June 2013 01:11, Peter Otten <__pete...@web.de> wrote:
>> def partition(items, predicate=bool):
>> a, b = itertools.tee((predicate(item), item) for item in items)
>> return ((item for pred, item in a if not pred),
>>
Adam Mercer wrote:
> Hi
>
> I'm trying to update one of my scripts so that it runs under python2
> and python3, but I'm running into an issue that the following example
> illustrates:
>
> $ cat test.py
> try:
> # python-2.x
> from urllib2 import urlopen
> from ConfigParser import ConfigPar
Ronny Mandal wrote:
> Hello,
>
> I am trying to write a script which will parse a code segment (with
> ast.parse()), locate the correct function/method node (by name) in the
> resulting tree and replace this function (node) with another function
> (node), e.g.:
>
> MyMod1.py:
>
> class FooBar()
Jayakrishnan Damodaran wrote:
> I have a class which calculates some salary allowances. Instead of a blind
> calculation I need to check some conditions before I can return the
> calculated amount. Like if all the allowances calculated till now plus the
> one in progress must not exceed the total
Giorgos Tzampanakis wrote:
> I have a program that saves lots (about 800k) objects into a shelve
> database (I'm using sqlite3dbm for this since all the default python dbm
> packages seem to be unreliable and effectively unusable, but this is
> another discussion).
>
> The process takes about 10-
Chris Rebert wrote:
> On Jun 14, 2013 10:26 PM, wrote:
>> What is the thinking behind stopping 'one short' when slicing or
>> iterating through lists?
> I find Dijkstra's explanation rather convincing:
> http://www.cs.utexas.edu/~EWD/transcriptions/EWD08xx/EWD831.html
This is the only case whe
Giorgos Tzampanakis wrote:
> So it seems that the pickle module does keep some internal cache or
> something like that.
I don't think there's a global cache. The Pickler/Unpickler has a per-
instance cache (the memo dict) that you can clear with the clear_memo()
method, but that doesn't matter
sixtyfourbit wrote:
> I'm in the first chapter of Natural Language Processing with Python and am
> trying to run the example .dispersion_plot. I am using Python 2.7.4
> (Anaconda) on Mac OSX 10.8.
>
> When I load all of the necessary modules and try to create the dispersion
> plott, I get no retu
Alan Newbie wrote:
> Hello,
> Let's say I want to compare two csv files: file A and file B. They are
> both similarly built - the first column has product IDs (one product per
> row) and the columns provide some stats about the products such as sales
> in # and $.
>
> I want to compare these file
jfhar...@gmail.com wrote:
> Hi,
>
> Sorry if this appears twice, I sent it to the mailing list earlier and the
> mail seems to have been swallowed by the black hole of email vagaries.
>
> We have a class which executes external processes in a controlled
> environment and does "things" specified
Jason Friedman wrote:
> I have XML which looks like:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> The "Property X" string appears twice times and I want to output the
> "path"
> that leads to all such appearances. In this case the output would be:
>
> LEVE
nickgan@windowslive.com wrote:
> I have recently started to solve my first Python problems but I came
> across to this:
> Write a version of a palindrome recogniser that accepts a file name from
> the user, reads each line, and prints the line to the screen if it is a
> palindrome.(by http://w
Hans wrote:
> Hi,
>
> I'm doing a regular expression matching, let's say
> "a=re.search(re_str,match_str)", if matching, I don't know how many
> str/item will be extracted from re_str, maybe a.group(1), a.group(2) exist
> but a.group(3) does not.
>
> Can I somehow check it? something like:
> if
Yves S. Garret wrote:
> Hi, I have a question about breaking up really long lines of code in
> Python.
>
> I have the following line of code:
> log.msg("Item wrote to MongoDB database %s/%s" %(settings['MONGODB_DB'],
> settings['MONGODB_COLLECTION']), level=log.DEBUG, spider=spider)
>
> Given th
Chris Angelico wrote:
> On Fri, Jun 21, 2013 at 7:15 PM, Peter Otten <__pete...@web.de> wrote:
>> Combining these modifications:
>>
>> for line in f:
>> word = line.strip()
>> if is_palindrome.is_palindrome(word):
>> print word
>
Борислав Бориславов wrote:
> while 1:
> name=raw_input("What is your name? ")
> if name == "bobi": print "Hello Master!" and break
> else: print "error"
> I want if my conditions are met to do a couple of things and i cant do
> that
> while 1:
> name=raw_input("What is your name?
pablobarhamal...@gmail.com wrote:
> Hi there! I'm quite new to programming, even newer in python (this is
> actually the first thing I try on it), and every other topic I've seen on
> forums about my problem doesn't seem to help.
>
> So, the following lines are intended to draw a white square (wh
Phu Sam wrote:
> I have a method that opens a file, lock it, pickle.load the file into a
> dictionary.
> I then modify the status of a record, then pickle.dump the dictionary back
> to the file.
>
> The problem is that the pickle.dump never works. The file never gets
> updated.
>
> def updateSta
Marco Perniciaro wrote:
> Hi,
> I've been working with Python for a long time.
> Yet, I came across an issue which I cannot explain.
>
> Recently I have a new PC (Windows 7).
> Previously I could call a Python script with or without the "python" word
> at the beginning. Now the behavior is differ
Tim wrote:
> I am extending a parser and need to create many classes that are all
> subclassed from the same object (defined in an external library). When my
> module is loaded I need all the classes to be created with a particular
> name but the behavior is all the same. Currently I have a bunch
Tim wrote:
> I am not completely understanding the type function I guess. Here is an
> example from the interpreter:
>
> In [1]: class MyClass(object):
>...: pass
>...:
> In [2]: type('Vspace', (MyClass,), {})
> Out[2]: __main__.Vspace
> In [3]: x = Vspace()
>
---
Joshua Landau wrote:
> I would say if a dict isn't good, there are still some cases where you
> might not want to use globals.
>
> I _might_ do:
> # Make a module
> module_for_little_classes = ModuleType("module_for_little_classes",
> "All the things")
> module_for_little_classes.__dict__.update
John Reid wrote:
> Looking at the docs for warnings.simplefilter
> (http://docs.python.org/2/library/warnings.html) I think the following
> script should only produce one warning at each line as any message is
> matched by the simple filter
>
> import warnings
> warnings.simplefilter('default')
>
Vincent Davis wrote:
> I have a list of a list of integers. The lists are long so i cant really
> show an actual example of on of the lists, but I know that they contain
> only the integers 1,2,3,4. so for example.
> s2 = [[1,2,2,3,2,1,4,4],[2,4,3,2,3,1]]
>
> I am calculating the product, sum, ma
cts.private.ya...@gmail.com wrote:
> I'd like to use closures to set allow a subroutine to set variables in its
> caller, in leu of pointers.
"leu"? Must be a Fench word ;)
> But I can't get it to work. I have the
> following test pgm, but I can't understand its behaviour:
>
> It uses a functi
cts.private.ya...@gmail.com wrote:
> As for python 3 ... "nonlocal"? I see I'm not alone in picking obnoxious
> names ...
tous chez...
> Alas, one reason it's a weak workaround is that it doesn't work - at
> least, not how I wish it would:
> $ cat ptrs
>
> x = 34
>
> def p1 (a1):
>
> a1
Helmut Jarausch wrote:
> Hi,
>
> I have a strange error. When I try import idlelib.PyShell from Python3.3
> it fails with
>
> Python 3.3.2+ (3.3:68ff68f9a0d5+, Jun 30 2013, 12:59:15)
> [GCC 4.7.3] on linux
> Type "help", "copyright", "credits" or "license" for more information.
import idlel
Ven wrote:
> I use: Python 2.6 and sqlalchemy 0.6.1
>
> This is what I am trying to do:
>
> from sqlalchemy.types import (
> Integer,
> String,
> Boolean
> )
> from sqlalchemy.ext.declarative import declarative_base
>
> Base = declarative_base()
>
> class SampleMeta(type):
> def __
Joshua Landau wrote:
> On 3 July 2013 23:19, Joshua Landau wrote:
>> If you don't want to do that, you'd need to use introspection of a
>> remarkably hacky sort. If you want that, well, it'll take a mo.
>
> After some effort I'm pretty confident that the hacky way is impossible.
Well, technical
Steven D'Aprano wrote:
> Well, if I ever have more than 63,000,000 variables[1] in a function,
> I'll keep that in mind. Until then, I'm pretty sure you can trivially
> avoid name clashes with globals that you wish to avoid clashing with.
> [1] Based on empirical evidence that Python supports nam
Rotwang wrote:
> Sorry to be OT, but this is sending my pedantry glands haywire:
We are mostly pedants, too -- so this is well-deserved...
> On 04/07/2013 08:06, Dave Angel wrote:
>> On 07/04/2013 01:32 AM, Steven D'Aprano wrote:
>>>
>>
>>>
>>> Well, if I ever have more than 63,000,000
Russel Walker wrote:
> Since I've already wasted a thread I might as well...
>
> Does this serve as an acceptable solution?
>
> def supersum(sequence, start=0):
> result = type(start)()
> for item in sequence:
> try:
> result += supersum(item, start)
> except:
skunkwerk wrote:
> Hi,
> I'm using a custom pickler that replaces any un-pickleable objects (such
> as sockets or files) with a string representation of them, based on the
> code from Shane Hathaway here:
> http://stackoverflow.com/questions/4080688/python-pickling-a-dict-with-
some-unpickla
skunkwerk wrote:
> On Monday, July 8, 2013 12:45:55 AM UTC-7, Peter Otten wrote:
>> skunkwerk wrote:
>>
>>
>>
>> > Hi,
>>
>> > I'm using a custom pickler that replaces any un-pickleable objects
>> > (such
>>
>
Ulrich Eckhardt wrote:
> Hello!
>
> I just stumbled over a case where Python (2.7 and 3.3 on MS Windows)
> fail to detect that an object is a function, using the callable()
> builtin function. Investigating, I found out that the object was indeed
> not callable, but in a way that was very unexpec
Steven D'Aprano wrote:
> On Fri, 12 Jul 2013 07:36:30 +, Duncan Booth wrote:
>
>> To be a convincing use-case you would have to show a situation where
>> something had to be both a static method and a utility method rather
>> than just one or the other and also where you couldn't just have bo
L O'Shea wrote:
> Hi all,
> I've been asked to take over a project from someone else and to extend the
> functionality of this. The project is written in Python which I haven't
> had any real experience with (although I do really like it) so I've spent
> the last week or two settling in, trying to
Joshua Landau wrote:
> On 12 July 2013 11:45, Devyn Collier Johnson
> wrote:
>> Could you explain what you mean? What and where is the new Flexible
>> String Representation?
>
> Do not worry. jmf is on about his old rant comparing broken previous
> versions of Python to newer ones which in some
pe...@ifoley.id.au wrote:
> Hi List,
>
> I am new to Python and wondering if there is a better python way to do
> something. As a learning exercise I decided to create a python bash
> script to wrap around the Python Crypt library (Version 2.7).
>
> My attempt is located here - https://gist.git
fronag...@gmail.com wrote:
> Hm. My apologies for not being very clear. What I'm doing is this:
>
> self.loader_thread = Thread(target=self.loadpages,
> name="loader_thread")
> self.loader_thread.start()
> while self.loader_thread.isAliv
pablobarhamal...@gmail.com wrote:
> Ok, I'm working on a predator/prey simulation, which evolve using genetic
> algorithms. At the moment, they use a quite simple feed-forward neural
> network, which can change size over time. Each brain "tick" is performed
> by the following function (inside the
Chris Hinsley wrote:
> On 2013-07-22 18:36:41 +, Chris Hinsley said:
>
>> Folks, I have this decorator:
>>
>> def memoize(maxsize):
>> def _memoize(func):
>> lru_cache = {}
>> lru_list = []
>
> Other clues, I use it on a recursive function:
>
> @memoize(64)
> def next_m
malay...@gmail.com wrote:
> I faced a problem: to implement appropriate search program I need to tick
> few checkboxes which turned out to have the same name (name="a",
> id="a1","a2","a3","a4"). Set_input('a', True) does not work (I use Grab
> library),
For all but the most popular projects a u
en...@yandex.ru wrote:
> This is my first post, nice to meet you all!
Welcome!
> I`m biology student from Russia, trying to learn python to perform some
>
> simple simulations.
>
> Here`s my first problem.
> I`m trying to perform some simple 2d vector rotations in pygame, in order
>
> to lear
Ethan Furman wrote:
> So, my question boils down to: in Python 3 how is dict.keys() different
> from dict? What are the use cases?
I just grepped through /usr/lib/python3, and could not identify a single
line where some_object.keys() wasn't either wrapped in a list (or set,
sorted, max) call,
Oscar Benjamin wrote:
> On Jul 24, 2013 7:25 AM, "Peter Otten" <__pete...@web.de> wrote:
>>
>> Ethan Furman wrote:
>>
>> > So, my question boils down to: in Python 3 how is dict.keys()
>> > different
>> > from dict? What are t
Chris Angelico wrote:
> On Thu, Jul 25, 2013 at 5:04 PM, Steven D'Aprano
> wrote:
>> - Views support efficient (O(1) in the case of keys) membership testing,
>> which neither iterkeys() nor Python2 keys() does.
>
> To save me the trouble and potential error of digging through the
> source code:
Ian Kelly wrote:
> On Thu, Jul 25, 2013 at 2:13 AM, Peter Otten <__pete...@web.de> wrote:
>> Chris Angelico wrote:
>>
>>> On Thu, Jul 25, 2013 at 5:04 PM, Steven D'Aprano
>>> wrote:
>>>> - Views support efficient (O(1) in the case of key
ty...@familyrobbins.com wrote:
> I'm a bit new to python and I'm trying to create a simple program which
> adds words and definitions to a list, and then calls them forward when
> asked to.
> while escape < 1:
>
> choice = input("Type 'Entry' to add a word to the Dictionary, 'Search'
> t
malay...@gmail.com wrote:
> вторник, 23 июля 2013 г., 11:25:00 UTC+4 пользователь Peter Otten написал:
>> malay...@gmail.com wrote:
>> For all but the most popular projects a url works wonders. I'm assuming
>> http://grablib.org
> Well, I have read the documentat
syed khalid wrote:
> I am trying to do a "import shogun" in my python script. I can invoke
> shogun with a command line with no problem. But I cannot with a python
> import statement.
>
>>invoking python from a command line...
>
> Syedk@syedk-ThinkPad-T410:~/shogun-2.0.0/src/interfac
Joseph L. Casale wrote:
>> Has anyone encountered this and utilized other existing functions
>> within the shipped 3.6.21 sqlite version to accomplish this?
>
> Sorry guys, forgot about create_function...
Too late, I already did the demo ;)
>>> import sqlite3
>>> db = sqlite3.connect(":memory:"
Devyn Collier Johnson wrote:
> On Python3, how can I perform bitwise operations? For instance, I want
> something that will 'and', 'or', and 'xor' a binary integer.
>>> 0b1010 | 0b1100
14
>>> bin(_)
'0b1110'
>>> 0b1010 & 0b1100
8
>>> bin(_)
'0b1000'
>>> 0b1010 ^ 0b1100
6
>>> bin(_)
'0b110'
--
CWr wrote:
> Some years ago I started a small WSGI project at my university. Since then
> the project was grown up every year. Some classes have more than 600 lines
> of code with (incl. boiler-plates mostly in descriptors/properties).
>
> Many of these properties are similar or have depencies am
shearich...@gmail.com wrote:
> Listening to 'Radio Free Python' episode 8
> (http://radiofreepython.com/episodes/8/ - around about the 30 minute mark)
> I heard that Python pre creates some integer constants to avoid a
> proliferation of objects with the same value.
>
> I was interested in this a
Johann Spies wrote:
> I am trying the following:
>
> Change data like this:
>
> Bien Donné : agri tourism
>
> to this:
>
> Bien Donné agri tourism
>
> I am using the 'unescape' function published on
> http://effbot.org/zone/re-sub.htm#unescape-html but working through a file
> I get the follo
Rotwang wrote:
> Hi all, I have a module that saves and loads data using cPickle, and
> I've encountered a problem. Sometimes I want to import the module and
> use it in the interactive Python interpreter, whereas sometimes I want
> to run it as a script. But objects that have been pickled by runn
Josh English wrote:
> I'm creating a cmd.Cmd class, and I have developed a helper method to
> easily handle help_xxx methods.
>
> I'm trying to figure out if there is an even lazier way I could do this
> with decorators.
>
> Here is the code:
> *
> import cmd
>
>
> def add_
gmspro wrote:
> Why is python source code not available on github?
>
> Make it available on github so that we can git clone and work on source
> code.
http://thread.gmane.org/gmane.comp.python.devel/121885/focus=122111
--
http://mail.python.org/mailman/listinfo/python-list
Josh English wrote:
> On Sunday, June 24, 2012 1:07:45 AM UTC-7, Peter Otten wrote:
>>
>> You cannot access a class instance because even the class itself doesn't
>> exist yet. You could get hold of the class namespace with
>> sys._getframe(),
>>
>&
Peter Otten wrote:
>>>helpfunc = getattr(self, "do_" + name[5:]).help
>
> i. e. it looks for getattr(self, "do_help") which does exist and then
Sorry that should be getattr(self, "do_done").
--
http://mail.python.org/mailman/listinfo/python-list
Alister wrote:
> I think I may be on firmer grounds with the next few:
>
> isValidPassword can be simplified to
>
> def isValidPassword(password:
> count=len(password)
> return count>= mud.minpass and count<= mud.maxpass
>
> ( I used count to save finding the length of password
levi nie wrote:
> i love python very much.it's powerful,easy and useful.
> i got it from Openstack.And i'm a new guy on python.
Welcome!
> Can i ask some stupid questions in days? haha...
Sure, but we cannot guarantee that the answer will be stupid, too ;)
--
http://mail.python.org/mailman/li
1 - 100 of 5496 matches
Mail list logo