On Jul 10, 5:32 am, Tim Mitchell <[EMAIL PROTECTED]> wrote:
> I work on a desktop application that has been developed using python and
> GTK (seewww.leapfrog3d.com). We have around 150k lines of python code
> (and 200k+ lines of C). We also have a new project manager with a C#
> background who ha
martinnorth wrote:
> Diez B. Roggisch wrote:
>> martinnorth schrieb:
>>> Hi,
>>>
>>> I am running Python and MySQL on Ubuntu and have installed MySQLdb. If
>>> I try to import MySQLdb I get the following error:
>>>
>>> ActivePython 2.5.2.2 (ActiveState Software Inc.) based on
>>> Python 2.5.2 (r25
Denis Kasak wrote:
> Basically, it reverses the list in place, so it modifies the list which
> called it. It does not return a /new/ list which is a reversed version
> of the original, as you expected it to. Since it doesn't return anything
> explicitly, Python makes it return None. Hence, the com
Alexnb wrote:
> Okay, I am not sure if there is a better way of doing this than findAll() but
> that is how I am doing it right now.
Consider using lxml.html and lxml.cssselect.
http://codespeak.net/lxml/
> I am making an app that screen scapes
> dictionary.com for definitions.
Do they have a
On Thu, 10 Jul 2008 16:32:38 +1200, Tim Mitchell wrote:
> Hi All,
>
> I work on a desktop application that has been developed using python and
> GTK (see www.leapfrog3d.com). We have around 150k lines of python code
> (and 200k+ lines of C). We also have a new project manager with a C#
> backgr
On Jul 11, 9:32 pm, John Machin <[EMAIL PROTECTED]> wrote:
> On Jul 11, 11:35 pm, Paddy <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Jul 11, 2:15 pm, antar2 <[EMAIL PROTECTED]> wrote:
>
> > > Hello,
>
> > > I can not find out how to read a file into a list of lists. I know how
> > > to split a text into
Ben Finney wrote:
So, in summary, despite the appearance of the "Python 3.0" page on the
wiki, there's really no single clearing-house source of Python 3.0
information that is maintained. The interested party needs to know a
half-dozen different resources to find out what's changing, and none
On Fri, 11 Jul 2008 12:27:32 -0700, castironpi wrote:
> On Jul 11, 1:29 pm, WDC <[EMAIL PROTECTED]> wrote:
>> On Jul 11, 2:15 pm, Michiel Overtoom <[EMAIL PROTECTED]> wrote:
>>
>> > You wrote...
>> > >Is there a better way to do that besides doing this:
>>
>> > random.randint(0
Okay, heres the general idea of the html I have to work with:
noun
verb
Okay, I left off some stuff. But what I need to do is get what is inside
each and then each . But the key is that I need everything in the
EXACT order that it would be in the html. I can
En Fri, 11 Jul 2008 15:42:37 -0300, Keith Hughitt
<[EMAIL PROTECTED]> escribi�:
I am having a little trouble figuring out how to convert a python
datetime to UTC. I have a UTC date (e.g. 2008-07-11 00:00:00). I would
like to create a UTC date so that when I send it to MySQL (which
treats all d
On Fri, 11 Jul 2008 20:13:04 -0700, happy wrote:
> Can a variable be considered the simplest of the data structures. I am
> tutoring some kids about basics of programming using python. Not an
> expert in computer sciences, but am a python enthusiast.
Why do you need this additional layer of indir
spam
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 11, 9:24 pm, Neal Becker <[EMAIL PROTECTED]> wrote:
> Robert Bossy wrote:
> > class Foo(Freezeable):
> > def __init__(self):
> > self.bar = 42
> > self.freeze() # ok, we set all variables, no more from here
>
> > x = Foo()
> > print x.bar
> > x.bar = -42
> > print x.bar
> > x.baz = "OMG! A t
En Fri, 11 Jul 2008 10:15:36 -0300, <[EMAIL PROTECTED]> escribió:
Trying to read a pickled filed and list contents.
The attached program works using pprint, but I want to write to my frame.
WriteText only produces half of the records.
What is happening?
What do you mean by "only produces half
Okay, I am not sure if there is a better way of doing this than findAll() but
that is how I am doing it right now. I am making an app that screen scapes
dictionary.com for definitions. However, I would like to have the type of
the word for each definition. For example if def1 and def2 are noun
def
On Jul 12, 1:18 pm, Kevin McMurtrie <[EMAIL PROTECTED]> wrote:
...
> I strongly recommend dropping all articles with "googlegroups.com" in
> the Message-ID.
I strongly recommend setting follow-ups in inane,
multi-posted, spam based threads.
F-U set to cam.misc, since I do not read it, and
do no
In article <[EMAIL PROTECTED]>,
Ben Finney <[EMAIL PROTECTED]> wrote:
> WDC <[EMAIL PROTECTED]> writes:
>
> > On Jul 10, 10:33 pm, 128 <[EMAIL PROTECTED]> wrote:
>
> […]
>
> >
> > Is that spam i spy?
>
> It is, clearly. Please don't make the problem worse by repeating the
> entire thing.
I
Can a variable be considered the simplest of the data structures.
I am tutoring some kids about basics of programming using python.
Not an expert in computer sciences, but am a python enthusiast.
I wanted to know if it is correct to say a variable is a data
structure, it has a name and a value. Pu
On Jul 11, 6:20 pm, Mensanator <[EMAIL PROTECTED]> wrote:
> > Try this:
>
> > spam = ['a', 'n', 'n', 'a']
> > eggs = spam[:]
> > if spam.reverse() == eggs:
> > print "Palindrome"
>
> You could also do
>
> >>> spam = ['a','n','n','a']
> >>> if spam == [i for i in reversed(spam)]:
>
> pri
Diez B. Roggisch wrote:
martinnorth schrieb:
Hi,
I am running Python and MySQL on Ubuntu and have installed MySQLdb. If
I try to import MySQLdb I get the following error:
ActivePython 2.5.2.2 (ActiveState Software Inc.) based on
Python 2.5.2 (r252:60911, Mar 27 2008, 16:42:08)
[GCC 3.3.1 (Su
> Basically, it reverses the list in place, so it modifies the list which
> called it. It does not return a /new/ list which is a reversed version of
> the original, as you expected it to. Since it doesn't return anything
> explicitly, Python makes it return None. Hence, the comparison you are doin
Ross Ridge <[EMAIL PROTECTED]> writes:
> D'Arcy J.M. Cain <[EMAIL PROTECTED]> wrote:
> >def calc_tax(*arg, **name):
> >from calc_tax import calc_tax as _func_
> >calc_tax = _func_
> >return _func_(*arg, **name)
>
> This should do what you want:
>
> def calc_tax(*arg, **name):
>
John Roth <[EMAIL PROTECTED]> writes:
> library changes are all listed in PEP 3008.
I assume you mean PEP 3108, "Standard Library Reorganization"
http://www.python.org/dev/peps/pep-3108/>.
--
\ “I have one rule to live by: Don't make it worse.” —Hazel |
`\
John Roth <[EMAIL PROTECTED]> writes:
> On Jul 11, 6:26 am, Benjamin <[EMAIL PROTECTED]> wrote:
> > On Jul 11, 3:06 am, Ben Finney <[EMAIL PROTECTED]>
> > wrote:
> > > Is there a better information source, then, for the current
> > > state of what's expected in Python 3.0?
> >
> > Look at the deve
On Jul 11, 8:01 am, [EMAIL PROTECTED] wrote:
> Following links from this
> thread:http://groups.google.com/group/comp.lang.python/browse_thread/thread/...
>
> I have found this perfect hash (minimal too)
> implementation:http://burtleburtle.net/bob/hash/perfect.html
>
> I have already translated
Gerhard Häring <[EMAIL PROTECTED]> writes:
> You want to serialize the objects, but only keep them in memory?
> That hardly makes any sense. Serialization is need if you want to
> store your objects in a file or if you want to communicate (via
> network) with other processes.
If one needs to do f
mk wrote:
> Hello,
>
> I'm having terrible problems building C++ extension to Python 2.4 using
> SWIG. I'd appreciate if somebody knowledgeable at the subject took a
> look at it. swig-1.3.29, g++ (GCC) 4.1.1 20070105 (Red Hat 4.1.1-52).
>
> I used following commands to build C++ extension:
>
>
rickman <[EMAIL PROTECTED]> wrote:
> spam
No fucking shit, Sherlock, why double the volume by pointing out the obvious?
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 11, 5:34 pm, Denis Kasak <[EMAIL PROTECTED]>
wrote:
> On Sat, Jul 12, 2008 at 12:22 AM, kdt <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
> >
> > Can someone please explain to me why the following evaluates as false?
> >
> list=['a','n','n','a']
> list==list.reverse()
> False
>
On Jul 11, 1:00 pm, James Fassett <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Had a simple problem that turned into an interesting solution and I
> thought I would share it here.
>
> I had a list of tuples that I needed to get the first value from and
> generate a list.
>
> tuple_list = (
> ('John
Denis Kasak:
> spam = ['a', 'n', 'n', 'a']
> eggs = spam[:]
> if spam.reverse() == eggs:
> print "Palindrome"
An alternative version:
>>> txt = "anna"
>>> txt == txt[::-1]
True
>>> txt = "annabella"
>>> txt == txt[::-1]
False
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-
folks,
I am trying put some user input fields into a scrollable (QScrollView)
window. So,
I placed a QLabel at 0,0 and QLineEdit at 0,1, next to QLabel.
Somehow, results are not what I am expecting.It is placing QLineEdit
below QLabel.
I am not using designer for this. Please, notice that I con
On Jul 11, 11:34 pm, Denis Kasak <[EMAIL PROTECTED]>
wrote:
> On Sat, Jul 12, 2008 at 12:22 AM, kdt <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
> >
> > Can someone please explain to me why the following evaluates as false?
> >
> list=['a','n','n','a']
> list==list.reverse()
> False
On Sat, Jul 12, 2008 at 12:22 AM, kdt <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Can someone please explain to me why the following evaluates as false?
>
list=['a','n','n','a']
list==list.reverse()
False
>
> I'm stumped :s
Read the documentation on list.reverse().
Basically, it reverse
D'Arcy J.M. Cain <[EMAIL PROTECTED]> wrote:
>def calc_tax(*arg, **name):
>from calc_tax import calc_tax as _func_
>calc_tax = _func_
>return _func_(*arg, **name)
This should do what you want:
def calc_tax(*arg, **name):
global calc_tax
from calc
Hi all,
Can someone please explain to me why the following evaluates as false?
>>>list=['a','n','n','a']
>>>list==list.reverse()
>>>False
I'm stumped :s
--
http://mail.python.org/mailman/listinfo/python-list
vanam <[EMAIL PROTECTED]> writes:
> hi all
> i am new to python programming a beginner. I Came to know from the
> groups that "How to think like a computer scientist" is preferable for
> begineers. i just looking through that i came to one section where a
> sample program for generation of graphic
On 11 Jul., 15:25, Fuzzyman <[EMAIL PROTECTED]> wrote:
> On Jul 11, 10:09 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
>
> > P4D = E4X style embedded DSL for Python but without E and X.
>
> > For more information see:
>
> >http://pypi.python.org/pypi/P4D/1.1-py2.5
>
> That looks a lot like YAML. Any
> If didn't investigate everything but I solved the problem by adding
> the "-static-libgcc" option:
>
> CFLAGS="-w -static-intel -static-libgcc"
>
> I think one should commit changes so configure can manage this.
I don't think that change should be made. I'm almost certain that it is
correct. M
Hi ,
I am trying to attach a cairo object into a vbox.I can pack a textbox with the
following code:
entry = gtk.Entry()
entry.set_max_length(50)
entry.connect("activate", self.enter_callback, entry)
entry.set_text("hello")
entry.insert_text(" world", len(entry.get_text()))
On Jul 9, 5:34 pm, keith <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
>
>
> Ethan Furman wrote:
> > writeson wrote:
> >> Guys,
>
> >> Thanks for your replies, they are helpful. I should have included in
> >> my initial question that I don't have as much control ove
On Jul 11, 11:35 pm, Paddy <[EMAIL PROTECTED]> wrote:
> On Jul 11, 2:15 pm, antar2 <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello,
>
> > I can not find out how to read a file into a list of lists. I know how
> > to split a text into a list
>
> > sentences = line.split(\n)
>
> > following text for examp
On Jul 11, 1:29 pm, WDC <[EMAIL PROTECTED]> wrote:
> On Jul 11, 2:15 pm, Michiel Overtoom <[EMAIL PROTECTED]> wrote:
>
> > You wrote...
> > >Is there a better way to do that besides doing this:
>
> > random.randint(0, 9)
> > >09657398671238769
>
> > Maybe this?
>
On Jul 11, 2:53 pm, Terry Reedy <[EMAIL PROTECTED]> wrote:
> Alex Bryan wrote:
> > I am just wondering how you get an integer value for how many items
> > there are in a list, preferably w/o a for loop.
>
> Read the library reference sections on built-in functions and classes.
Quite simple.
If I
Robert Bossy wrote:
> class Foo(Freezeable):
> def __init__(self):
> self.bar = 42
> self.freeze() # ok, we set all variables, no more from here
>
>
> x = Foo()
> print x.bar
> x.bar = -42
> print x.bar
> x.baz = "OMG! A typo!"
>
Pretty nice, but unfortunately the subclass has to remember to c
On Fri, Jul 11, 2008 at 3:09 PM, Mr SZ <[EMAIL PROTECTED]> wrote:
> ff = gtk.FileFilter.add_pixbuf_formats()
> The documentation doesn't say anything about an argument to be passed:
> http://www.pygtk.org/docs/pygtk/class-gtkfilefilter.html#method-gtkfilefilter--add-pixbuf-formats
I don't kno
Hi,
I am using a gtk.filechooser dialog to open and save files.How do I add a
filter so that only images are filtered ?I did something like this:
def get_save_filename(self):
filename = None
chooser = gtk.FileChooserDialog("Save File...", self.window,
[EMAIL PROTECTED] wrote:
James Fassett:
# the first Pythonic attempt using comprehensions
result_list = [x[0] for x in tuple_list]
This has the virtue of working for tuples of any length and doing the
minimal work required.
# the final functional way
[result_list, _] = zip(*tuple_list)
Alex Bryan wrote:
I am just wondering how you get an integer value for how many items
there are in a list, preferably w/o a for loop.
Read the library reference sections on built-in functions and classes.
--
http://mail.python.org/mailman/listinfo/python-list
Ben Finney wrote:
"Martin v. Löwis" <[EMAIL PROTECTED]> writes:
This is rather disappointing. Is that entire page suspect?
All documentation about Python 3 is suspect until Python 3 gets
actually released (nobody can say for sure how the release will
look like in all details).
Is there a b
I'm trying to read mail using the imaplib module. I can get the subject and
date, but not the body, have not found any example on how to do that and I
don't know much about imap. Here's what I have, working as noted...
If anyone can show me what I'm missing in order to get the body of a mail
Hi,
I am having a little trouble figuring out how to convert a python
datetime to UTC. I have a UTC date (e.g. 2008-07-11 00:00:00). I would
like to create a UTC date so that when I send it to MySQL (which
treats all dates at local dates by default), it will already have
incorporated the proper UT
>>>NJSModule?
>>>http://en.wikipedia.org/wiki/NJS
>
>> This seems to be very good indeed. Just downloaded njs but the only
>> njsmodule version I could find was for python 2.1. Does anyone have a
>> recent copy?
>
> 1. You might ask here:
> http://lists.njs-javascript.org/cgi-bin/mailman/listinfo/u
On Jul 11, 2:15 pm, Michiel Overtoom <[EMAIL PROTECTED]> wrote:
> You wrote...
> >Is there a better way to do that besides doing this:
>
> random.randint(0, 9)
> >09657398671238769
>
> Maybe this?
>
> random.randint(0, 9e16)
>
> --
> "The ability of the O
On Jul 11, 12:00 pm, James Fassett <[EMAIL PROTECTED]> wrote:
> tuple_list = (
> ('John', 'Doe'),
> ('Mark', 'Mason'),
> ('Jeff', 'Stevens'),
> ('Bat', 'Man')
> )
>
> # what I'd do in C or other procedural languages
> result_list = []
> for item in tuple_list:
> result_list.a
You wrote...
>Is there a better way to do that besides doing this:
>
random.randint(0, 9)
>09657398671238769
Maybe this?
random.randint(0, 9e16)
--
"The ability of the OSS process to collect and harness
the collective IQ of thousands of individuals
Peter Otten wrote:
Thin Myrna wrote:
The old cookbook offered choices by category. Did you drop that feature?
Looks like categories have become tags:
http://code.activestate.com/recipes/tags/
Yes, that is correct. I should document the tag names to category
mapping that I've used (mostly
NJSModule?
http://en.wikipedia.org/wiki/NJS
Daniel Fetchinson wrote:
This seems to be very good indeed. Just downloaded njs but the only
njsmodule version I could find was for python 2.1. Does anyone have a
recent copy?
1. You might ask here:
http://lists.njs-javascript.org/cgi-bin/mailman/
Christoph Zwerschke <[EMAIL PROTECTED]> wrote:
> In Python programs, you will quite frequently find code like the
> following for removing a certain prefix from a string:
>
> if url.startswith('http://'):
> url = url[7:]
If I came across this code I'd want to know why they weren't using
ur
spam
--
http://mail.python.org/mailman/listinfo/python-list
And what's infuriating is that the .o files do contain the necessary symbol:
# grep _Z13edit_distanceRSsS_ *
Binary file edit_distance.o matches
Binary file _edit_distance.so matches
Binary file edit_distance_wrap.o matches
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 11, 3:36 am, [EMAIL PROTECTED] wrote:
> James Fassett:
>
> > # the first Pythonic attempt using comprehensions
> > result_list = [x[0] for x in tuple_list]
>
> > # the final functional way
> > [result_list, _] = zip(*tuple_list)
>
> > I really like how Python allows me to do what I feel is t
On Jul 11, 6:38 pm, Robert Bossy
> I don't get it. Why use a metaclass? Wouldn't the following be the same,
> but easier to grasp:
>
> class Frozen(object):
> def __setattr__(self, name, value):
> if not hasattr(self, name):
> raise AttributeError, "cannot add attributes to %s"
Hello,
I'm having terrible problems building C++ extension to Python 2.4 using
SWIG. I'd appreciate if somebody knowledgeable at the subject took a
look at it. swig-1.3.29, g++ (GCC) 4.1.1 20070105 (Red Hat 4.1.1-52).
I used following commands to build C++ extension:
# swig -c++ -python edit
I am currently learning, and loving, Python and have a question about
random().
Right now, what I have to do to get a whole number and not a decimal
using random.random() is this:
>>>random.random()
0.84765728501856734
>>>_ * 10**17
84765728501856734.0
Is there a better way to do that besides do
Michele Simionato wrote:
This article could give you same idea (it is doing the opposite,
warning you
if an attribute is overridden):
http://stacktrace.it/articoli/2008/06/i-pericoli-della-programmazione-con-i-mixin1/
There is also a recipe that does exactly what you want by means of a
metaclass
In article
<[EMAIL PROTECTED]>,
ssecorp <[EMAIL PROTECTED]> wrote:
> >>> def mod(x,y):
> return x.append(y)
>
> >>> mod([1,2],3)
> >>> k=[1,2,3]
> >>> k
> [1, 2, 3]
> >>> l = mod(k,4)
> >>> l
> >>> k
> [1, 2, 3, 4]
> >>> l
> >>> k==l
> False
> >>> mod(k,5)
> >>> k
> [1, 2, 3, 4, 5]
> >>>
In article <[EMAIL PROTECTED]>,
Terry Reedy <[EMAIL PROTECTED]> wrote:
> David C. Ullrich wrote:
> > In article
> > <[EMAIL PROTECTED]>,
> > ssecorp <[EMAIL PROTECTED]> wrote:
> >
> >> I am never redefining the or reassigning the list when using validate
> >> but since it spits the modified li
On Jul 11, 5:29 pm, Neal Becker <[EMAIL PROTECTED]> wrote:
> After spending the morning debugging where I had misspelled the name of an
> attribute (thus adding a new attr instead of updating an existing one), I
> would like a way to decorate a class so that attributes cannot be (easily)
> added.
>
It has been already in wxpython-doc-demos package.
On Fri, Jul 11, 2008 at 11:38 PM, Henry Read <[EMAIL PROTECTED]> wrote:
> Editra is a multi-platform text editor with an implementation that focuses
> on creating an easy to use interface and features that aid in code
> development. Currently it
Editra is a multi-platform text editor with an implementation that focuses
on creating an easy to use interface and features that aid in code
development. Currently it supports syntax highlighting and variety of other
useful features for over 60 programming languages.
Editra is freely available un
After spending the morning debugging where I had misspelled the name of an
attribute (thus adding a new attr instead of updating an existing one), I
would like a way to decorate a class so that attributes cannot be (easily)
added.
I guess class decorators are not available yet (pep 3129), but prob
Laurent Rahuel wrote that antar2 wrote:
>> following text for example should be considered as a list of lists (3
>> columns and 3 rows), so that when I make the print statement list[0]
>> [0], that the word pear appears
>>
>>
>> pear noun singular
>> books nouns plural
>> table noun singular
Fi
On Fri, 11 Jul 2008 16:45:20 +0200, Christoph Zwerschke wrote:
> Bruno Desthuilliers schrieb:
>> DRY/SPOT violation. Should be written as :
>>
>> prefix = 'http://'
>> if url.startswith(prefix):
>> url = url[len(prefix):]
>
> That was exactly my point. This formulation is a bit better, bu
Bill Davy wrote:
Traceback (most recent call last):
File "H:/Personal/OutlookIF1/t2.py", line 18, in
outlook = win32com.client.gencache.EnsureDispatch
("Outlook.Application")
File "C:\Python25\Lib\site-packages\win32com\client\gencache.py", line
536, in EnsureDispatch
mod = EnsureM
Bruno Desthuilliers schrieb:
DRY/SPOT violation. Should be written as :
prefix = 'http://'
if url.startswith(prefix):
url = url[len(prefix):]
That was exactly my point. This formulation is a bit better, but it
still violates DRY, because you need to type "prefix" two times. It is
exac
I'm by no means a testing expert, but I'll take a crack at it.
Casey McGinty wrote:
I'm familiar with the unittest module in Python, however I'm hoping
someone can point me to some examples of more advanced usages of the
framework. For example:
1. Using the framework to test a package with ne
On Jul 11, 6:26 am, Benjamin <[EMAIL PROTECTED]> wrote:
> On Jul 11, 3:06 am, Ben Finney <[EMAIL PROTECTED]>
> wrote:
>
> > "Martin v. Löwis" <[EMAIL PROTECTED]> writes:
>
> > > > This is rather disappointing. Is that entire page suspect?
>
> > > All documentation about Python 3 is suspect until Py
antar2 wrote:
Hello,
I can not find out how to read a file into a list of lists. I know how
to split a text into a list
sentences = line.split(\n)
following text for example should be considered as a list of lists (3
columns and 3 rows), so that when I make the print statement list[0]
[0], tha
"Tim Golden" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Bill Davy wrote:
>> and since then have been busy with work, and my other job, and the
>> garden.
>
> Aha! So you're English, are you? Looks like you're in the West Country.
> Weather map suggests you're not short of rain
On Jul 11, 2:15 pm, antar2 <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I can not find out how to read a file into a list of lists. I know how
> to split a text into a list
>
> sentences = line.split(\n)
>
> following text for example should be considered as a list of lists (3
> columns and 3 rows), so
Trying to read a pickled filed and list contents.
The attached program works using pprint, but I want to write to my frame.
WriteText only produces half of the records.
What is happening?
(See attached file: ReadDB_b.py)
D. J. Webre, Jr. PE & PLS
Director of Engineering & Technical Support
Diez B. Roggisch wrote:
>> Is it possible the module was installed with priviledges set too
>> strict? Perhaps the interpreter cannot see the module when it is run
>> from a normal user account.
>
> Possible - certainly. Yet unrealistic, because usually root access is
> required to system-wide i
On 11 Lug, 15:15, antar2 <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I can not find out how to read a file into a list of lists. I know how
> to split a text into a list
>
> sentences = line.split(\n)
>
> following text for example should be considered as a list of lists (3
> columns and 3 rows), so th
Hello,
A way to do it
===
from __future__ import with_statement
res = []
with open("sentences.txt","r") as f:
sentences = [elem for elem in f.read().split('\n') if elem]
for sentence in sentences:
res.append(sentence.split())
p
On Jul 11, 10:09 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
> P4D = E4X style embedded DSL for Python but without E and X.
>
> For more information see:
>
> http://pypi.python.org/pypi/P4D/1.1-py2.5
That looks a lot like YAML. Any reason to use it over YAML?
Michael Foord
http://www.ironpythonin
Hello,
I can not find out how to read a file into a list of lists. I know how
to split a text into a list
sentences = line.split(\n)
following text for example should be considered as a list of lists (3
columns and 3 rows), so that when I make the print statement list[0]
[0], that the word pear
Bill Davy wrote:
and since then have been busy with work, and my other job, and the garden.
Aha! So you're English, are you? Looks like you're in the West Country.
Weather map suggests you're not short of rain over there :)
Now I am back looking at this (and using WInUSB to talk to a Maxim 342
On Jul 11, 12:58 pm, hardemr <[EMAIL PROTECTED]> wrote:
> Hello Everyone,
>
> I want to serialize and deserialize the objects into Memory not into
> file. How can i do that?
pickle.dumps and pickle.loads.
--Inyeol
--
http://mail.python.org/mailman/listinfo/python-list
Tim Mitchell wrote:
Thanks for all the replies - they have all been helpful.
On reflection I think our problems are probably design and people related.
I strongly agree. "Scalability" is becoming a buzzword lately, which is
meaningless unless qualified what exactly is meant.
It's overused w
hardemr wrote:
Hello Everyone,
I want to serialize and deserialize the objects into Memory not into
file. How can i do that?
You want to serialize the objects, but only keep them in memory? That
hardly makes any sense. Serialization is need if you want to store your
objects in a file or if y
On Jul 11, 12:27 am, eliben <[EMAIL PROTECTED]> wrote:
> > > 2) What is the meaning of the comment in astgen.py ? Are the Python
> > > maintainers unhappy with the design of the AST ?3
>
> > Node, I think, is talking about a node in the parse tree. (AST is
> > generated from another parse tree.) Se
Christoph Zwerschke a écrit :
In Python programs, you will quite frequently find code like the
following for removing a certain prefix from a string:
if url.startswith('http://'):
url = url[7:]
DRY/SPOT violation. Should be written as :
prefix = 'http://'
if url.startswith(prefix):
On Jul 11, 3:06 am, Ben Finney <[EMAIL PROTECTED]>
wrote:
> "Martin v. Löwis" <[EMAIL PROTECTED]> writes:
>
> > > This is rather disappointing. Is that entire page suspect?
>
> > All documentation about Python 3 is suspect until Python 3 gets
> > actually released (nobody can say for sure how the r
Following links from this thread:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/179e1a45485ab36a#
I have found this perfect hash (minimal too) implementation:
http://burtleburtle.net/bob/hash/perfect.html
I have already translated part of it to D, and it seems to work well
Jeff schrieb:
Is it possible the module was installed with priviledges set too
strict? Perhaps the interpreter cannot see the module when it is run
from a normal user account.
Possible - certainly. Yet unrealistic, because usually root access is
*required* to system-wide install a package - t
martinnorth wrote:
> Hi,
>
> I am running Python and MySQL on Ubuntu and have installed MySQLdb. If I
> try to import MySQLdb I get the following error:
>
> ActivePython 2.5.2.2 (ActiveState Software Inc.) based on
> Python 2.5.2 (r252:60911, Mar 27 2008, 16:42:08)
> [GCC 3.3.1 (SuSE Linux)] on
In Python programs, you will quite frequently find code like the
following for removing a certain prefix from a string:
if url.startswith('http://'):
url = url[7:]
Similarly for stripping suffixes:
if filename.endswith('.html'):
filename = filename[:-5]
My problem with this is that it'
Gabriel Genellina wrote:
> En Wed, 09 Jul 2008 15:02:56 -0300, Mirko Vogt <[EMAIL PROTECTED]> escribi�:
>
>> it seems that the socket-module behaves differently on unix / windows
>> when a timeout is set.
> [...]
>> Now I will change the code slightly - to be precise I set a timeout on
>> the sock
Durand wrote:
I posted this too soon. Converting the images to png with image magick's
convert did the trick...However, I'm still not sure why I need to convert the
images in the first place. Are there different types of PNGs?
http://en.wikipedia.org/wiki/Portable_Network_Graphics#Transparency
1 - 100 of 136 matches
Mail list logo