In message , Support
Desk wrote:
> You could do something like below to get the rendered page.
>
> Import os
> site = 'website.com'
> X = os.popen('lynx --dump %s' % site).readlines()
I wonder how easy it would be to get the page image in SVG format? I believe
the Gecko HTML engine in Firefox
import os
ch = os.system("import -window root temp.png")
print ch
after that no way to store the screen shot
regards
Prakash
On Mon, Apr 6, 2009 at 10:28 PM, Roberto Fichera wrote:
> Hi All in the list,
>
> I've embedded python v2.6.x engine into my application without any problem.
> Now I woul
It started with this error message... "TypeError: object cannot be
used as an index"
foo = {}
someObject = someClass()
foo[someObject] = "hello"
Obviously, there are some known reasons why objects may not be
indexes, such as if they are not hashable (as in the case of lists).
However, I'm not get
On Apr 6, 10:37 am, grkunt...@gmail.com wrote:
> I am considering teaching an "introduction to programming"
> course for continuing education adults at a local community
> college. These would people with no programming experience,
> but I will require a reasonable facility with computers.
>
> What
>>> import _tkinter
>>> import Tkinter
>>> Tkinter._test
>>>
--
http://mail.python.org/mailman/listinfo/python-list
G'day All
I was following the instructions (listed at bottom of post) from the
PythonInfo Wiki which says to run three tests.
I ran the tests and test 1 and 2 worked
Test 3 gave me an error -
can anyone help ???
Tks in advance
Pete
>>> import _tkinter
>>> import Tkinter
>>> Tkinter._test
>
On Wed, Apr 8, 2009 at 1:15 AM, Eclipse wrote:
import _tkinter
import Tkinter
Tkinter._test
>
That last input line should be:
Tkinter._test()
Note the parens, which do matter (Python != Ruby/Smalltalk). Try again
and see if you get an actual error.
Cheers,
Chris
--
I have a b
On Apr 8, 1:20 pm, Eclipse wrote:
> G'day All
>
> I was following the instructions (listed at bottom of post) from the
> PythonInfo Wiki which says to run three tests.
>
> I ran the tests and test 1 and 2 worked
>
> Test 3 gave me an error -
>
> can anyone help ???
>
> Tks in advance
>
> Pete
>
>
On 07 Apr 2009 02:05:59 GMT
Steven D'Aprano wrote:
> The demuxer can't be an iterator, since it needs to run through the
> entire collection.
Then your demuxer obviously cannot handle infinite sequences.
> def demux(it, n):
> collectors = [[] for i in xrange(n)]
> i = 0
> for item
tleeuwenb...@gmail.com wrote:
> It started with this error message... "TypeError: object cannot be
> used as an index"
>
> foo = {}
> someObject = someClass()
> foo[someObject] = "hello"
"interpreted" or "used"?
If the former, 'foo' may be a list rather than a dict, and someClass a
classic cla
Hello
I'd like to go through a list of e-mail addresses, and extract those
that belong to well-known ISP's. For some reason I can't figure out,
Python shows the whole list instead of just e-mails that match:
=== script
test = "t...@gmail.com"
isp = ["gmail.com", "yahoo.com"]
for item in isp:
Gilles Ganault wrote:
> test = "t...@gmail.com"
> isp = ["gmail.com", "yahoo.com"]
> for item in isp:
> if test.find(item):
> print item
> === output
> gmail.com
> yahoo.com
> ===
>
> Any idea why I'm also getting "yahoo.com"?
find() returns the index where it is found or -1 if it is not
On Wed, 2009-04-08 at 12:01 +0200, Peter Otten wrote:
> Gilles Ganault wrote:
>
> > I'd like to go through a list of e-mail addresses, and extract those
> > that belong to well-known ISP's. For some reason I can't figure out,
> > Python shows the whole list instead of just e-mails that match:
> >
Gilles Ganault writes:
> I'd like to go through a list of e-mail addresses, and extract those
> that belong to well-known ISP's. For some reason I can't figure out,
> Python shows the whole list instead of just e-mails that match:
>
> === script
> test = "t...@gmail.com"
> isp = ["gmail.com"
> Carl Banks (CB) wrote:
>CB> On Apr 6, 2:23 pm, "Diez B. Roggisch" wrote:
>>> > This is a classical synchronization problem with a classical solution:
>>> > You treat the readers as a group, and the writers individually. So you
>>> > have a write lock that each writer has to acquire and rel
Gilles Ganault wrote:
Hello
I'd like to go through a list of e-mail addresses, and extract those
that belong to well-known ISP's. For some reason I can't figure out,
Python shows the whole list instead of just e-mails that match:
=== script
test = "t...@gmail.com"
isp = ["gmail.com", "yah
Remeber the return value of find function of a string is -1 when it
fails, which is True.
Try:
for item in isp:
if item in test:
print item
From: Gilles Ganault
Date: April 8, 2009 5:56:34 PM CST
To: python-list@python.org
Subject: Why does Python show the whole array?
In message
<8e3d0032-5e9f-44c2-9380-1d2383552...@u5g2000vbc.googlegroups.com>,
grkunt...@gmail.com wrote:
> I am considering teaching an "introduction to programming" course for
> continuing education adults at a local community college. These would
> people with no programming experience, but
Gilles Ganault wrote:
> I'd like to go through a list of e-mail addresses, and extract those
> that belong to well-known ISP's. For some reason I can't figure out,
> Python shows the whole list instead of just e-mails that match:
>
> === script
> test = "t...@gmail.com"
> isp = ["gmail.com",
> "tleeuwenb...@gmail.com" (tc) wrote:
>tc> What, exactly, needs to be in place for an object to be a valid
>tc> dictionary key?
It must have __hash__ and __cmp__ or __eq__ methods. Newstyle classes
inherit these from object.
--
Piet van Oostrum
URL: http://pietvanoostrum.com [PGP 8DAE142B
> Here's a tricky case that doesn't show up in your example:
> In each case above, the directory names are distinct.
> how about:
>['/desk', '/desk/ethanallen', '/desk/ikea',
> '/desktop', /desktop/pc', '/desktop/mac']
>Should the answer be ['/desk'] or ['/desk', '/desktop'] ?
Hi Scott
good po
On Wed, 08 Apr 2009 12:11:55 +0200, Ulrich Eckhardt
wrote:
>find() returns the index where it is found or -1 if it is not found. Both an
>index>0 or a -1 evaluate to True when used as conditional expression.
Thanks everyone. I shouldn't have assumed that "if test.find(item):"
was necessarily enou
QOTW: "Those who show promise can advance to our Winter Improve Python to
Expert program, for an additional fee, and, be given expert tutoring to help
you gain our exemplary A.R.S.E./W.I.P.E certification which is guaranteed to
attract certain types of employers by its name alone." - Paddy3118
Gilles Ganault wrote:
> On Wed, 08 Apr 2009 12:11:55 +0200, Ulrich Eckhardt
> wrote:
>>find() returns the index where it is found or -1 if it is not found. Both
>> an
>>index>0 or a -1 evaluate to True when used as conditional expression.
>
> Thanks everyone. I shouldn't have assumed that "if test
On Apr 7, 1:08 pm, akineko wrote:
> Hello everyone,
>
> I'm trying to use named pipes to fuse a Python program and a C
> program.
> One side creates pipes using os.mkfifo() and both sides use the same
> named pipes (one side reads, another side writes). The read side uses
> select.select() to wait
Sorin Schwimmer wrote:
>
> I wanted to replace my old Python 2.4 and tcl/tk 8.4 with tcl/tk 8.5.6 and
> Python 2.6, mainly so that I can enjoy ttk. tcl/tk was installed from sources
> without any problem, I started a wish and worked.
>
> Now, for the Python, here are all the issues signaled by
Hello,
Anyone using Python for coding up genetic algorithms? If
so, would you share your favorite modules/libraries/tools?
Thanks,
Esmail
--
http://mail.python.org/mailman/listinfo/python-list
On 2009-04-08, Gabriel Genellina wrote:
>>> ClientForm.Control = FancyControl
>>> ClientForm.CheckboxControl = FancyCheckboxControl
>>
>> That would work -- but there are probably 8 or 10 different
>> Control subclasses. It's a bit tedious mixing them all one at a
>> time, and you need
On 2009-04-08, Gabriel Genellina wrote:
>>> class Mixin: # or class Mixin(object) if new-style:
>>> def __eq__(self, other):
>>> return (self.type == other.type ...
>>> def __ne__(self, other):
>>> return not self.__eq__(other)
>>> class Fanc
On Apr 7, 3:18 pm, Adam Olsen wrote:
> On Apr 6, 3:02 pm, George Sakkis wrote:
>
> > For example, it is common for a function f(x) to expect x to be simply
> > iterable, without caring of its exact type. Is it ok though for f to
> > return a list for some types/values of x, a tuple for others an
Never mind (at least tentatively).
Later in the day I got an email from the publisher,
saying they're going to send me a corrected copy
"free".
Evidently if you get a bad copy you don't have to complain
to the publisher or the retailer, you just have to post
a complaint somewhere where Google can
pataphor wrote:
> On 07 Apr 2009 02:05:59 GMT
> Steven D'Aprano wrote:
>
>> The demuxer can't be an iterator, since it needs to run through the
>> entire collection.
>
> Then your demuxer obviously cannot handle infinite sequences.
>
>> def demux(it, n):
>> collectors = [[] for i in xrang
Hello,
I'm trying to implement something very simple without using a Python
WebFramework and I need some advice. I want to send a comma delimited string
from the client to a server-side Python script. My initial plan was to use a
JavaScript function (see below) called "makerequest" that creates a
On Apr 5, 12:24 pm, a...@pythoncraft.com (Aahz) wrote:
> [posted & e-mailed, please respond on-group]
There was some problem with the CGIXMLRPCRequestHandler code in the
SimpleXMLRPC Server.
It was not getting the length to read from the CONTENT_LENGTH
environement variable ( as it the CGI server
I have done something in this direction. I will be happy to share my
experience. However, my code is not generic and needs many things to be
manually introduced. My GA is standard (selection by roulette wheel or
tournament, single point cross). Let me know if you are interested!
On Wed, Apr 8, 200
Thanks for the pointers.
Here are some answers:
> Ok, so DBM wasn't built because it couldn't find the external symbol
> 'dbm_firstkey'. I have no idea off the top of my head why that would
> happen, but I don't think you really care at the moment since you are
> trying to get tkinter working.
On Apr 7, 1:44 pm, Tim Chase wrote:
> > f = urllib.urlopen("http://www.google.com";)
> > s = f.read()
>
> > It is working, but it's returning the source of the page. Is there anyway I
> > can get almost a screen capture of the page?
>
> This is the job of a browser -- to render the source HTML. A
Jim Garrison wrote:
Ye Liu wrote:
On Apr 6, 6:33 pm, Jim Garrison wrote:
I notice the online docs (at docs.python.org/3.0/index.html) were
updated today. It seems some of the top-level pages, like
Tutorial, "Using Python", "Language Reference" are truncated
after the first few paragraphs.
Y
Hello Mohammed,
Yes, that would great. While I am comfortable with GAs,
I'm still rather inexperienced with Python so seeing some
implementation examples would be very useful.
Thanks,
Esmail
--
Date: Wed, 8 Apr 2009 17:08:48 +0200
Subject: Re: genetic algorithms in Python?
From: medmedi...@gma
Hi everybody,
I have a data structure (a tree) that has one constraint: I can only store
strings in this data structure.
To know if an object foo already exists in memory, I store "str(id(foo))" in
the data structure.
OK.
But how do I get a usable reference from the id value?
For example, if "fo
I'm trying to use difflib to compare strings ignoring changes
to white-space (space/tab). According to the doc page, you can
do this by specifying a "charjunk" parameter to filter out
characters:
charjunk: A function that accepts a character (a string of
length 1), and returns if the charac
Hi,
This will be a very simple question to ask all the awesome programmers
here:
How can I get answer in in decimals for such a math operator:
3/2
I get 1. I want to get 1.5
Thanks in advance,
Avi
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Apr 8, 2009 at 9:03 AM, Avi wrote:
> Hi,
>
> This will be a very simple question to ask all the awesome programmers
> here:
>
> How can I get answer in in decimals for such a math operator:
>
> 3/2
>
> I get 1. I want to get 1.5
Add the following line to the top of your program (or use Py
> But how do I get a usable reference from the id value?
> For example, if "foo" has a method "bar()", how can I call "foo.bar()"
> from "str(id(foo))" (say, 149466208).
can you just use a weakref instead? It is certainly cleaner than
trying to store id's,
since an id is only guaranteed to be uniq
TP wrote:
Hi everybody,
I have a data structure (a tree) that has one constraint: I can only store
strings in this data structure.
To know if an object foo already exists in memory, I store "str(id(foo))" in
the data structure.
OK.
But how do I get a usable reference from the id value?
For exa
TP wrote:
Hi everybody,
I have a data structure (a tree) that has one constraint: I can only store
strings in this data structure.
To know if an object foo already exists in memory, I store "str(id(foo))" in
the data structure.
OK.
But how do I get a usable reference from the id value?
For exa
On 2009-04-08, Grant Edwards wrote:
> I'm trying to use difflib to compare strings ignoring changes
> to white-space (space/tab). According to the doc page, you
> can do this by specifying a "charjunk" parameter to filter out
> characters:
>
>charjunk: A function that accepts a character (a
Avi wrote:
> Hi,
>
> This will be a very simple question to ask all the awesome programmers
> here:
>
> How can I get answer in in decimals for such a math operator:
>
> 3/2
>
> I get 1. I want to get 1.5
You don't say which python-version you have. Depending on that, the answer
is different.
> You could create a dict with the string as the key and the object as the
> value.
This will create a strong reference to the object, which is (I'm
assuming) undesired behavior.
--
http://mail.python.org/mailman/listinfo/python-list
Esmail wrote:
> Hello Mohammed,
>
> Yes, that would great. While I am comfortable with GAs,
> I'm still rather inexperienced with Python so seeing some
> implementation examples would be very useful.
A google for 'python genetic algorithms' turns up a number
of interesting hits.
I also remember
"Jim Garrison"
> Jim Garrison wrote:
> > Ye Liu wrote:
> >> On Apr 6, 6:33 pm, Jim Garrison wrote:
> >>> I notice the online docs (at docs.python.org/3.0/index.html) were
> >>> updated today. It seems some of the top-level pages, like
> >>> Tutorial, "Using Python", "Language Reference" are tru
MRAB wrote:
> You could create a dict with the string as the key and the object as the
> value.
Thanks. But it implies an additional data structure: a dictionnary.
I don't know what is the best:
* using an additional dict and maintaining it
* or using the "di" module proposed by CTO
If "di" is r
>
> In python2.6 and 3.x, the new behavior is standard.
Apparently that is nonsense - it seems to be not standard for 2.6. Which
Makes sense I guess.
Diez
--
http://mail.python.org/mailman/listinfo/python-list
> I don't know what is the best:
> * using an additional dict and maintaining it
It works, but as you say, is somewhat inelegant.
> * or using the "di" module proposed by CTO
Let me be clear: I am not proposing that you use it. It *does* do what
you
ask- but what you are asking is, all by itself
Complete newbie, so forgive my improper use of Python terminology.
I am working with Django and I have to send off a number of emails
after a person has filled out a form. What I want is to make a call
that goes off to form and send the emails and redirect the user to
another view. I have this w
On Apr 7, 11:39 pm, Lawrence D'Oliveiro wrote:
> In message , Steve
>
> Holden wrote:
> > Lawrence D'Oliveiro wrote:
>
> >> In message <7dd228af-
> >> e549-444d-8623-11e951851...@y9g2000yqg.googlegroups.com>, janus99 wrote:
>
> >>> I messed around with my own comp (windos xp) command prompt ...
>
Correction: the UserString will be dead on the final line. When I
typed
it in I had a strong reference still hanging around.
--
http://mail.python.org/mailman/listinfo/python-list
Stef Mientki wrote:
Baris Demir wrote:
Hi all,
I need to develop a GUI for some scientific data processing
operations and this GUI should work well with a 3D plotting module,
also with NumPy and SciPy for sure. I made a search about packages
but, there are plenty of these modules available.
Avi wrote:
> Hi,
>
> This will be a very simple question to ask all the awesome programmers
> here:
>
> How can I get answer in in decimals for such a math operator:
>
> 3/2
>
> I get 1. I want to get 1.5
>
> Thanks in advance,
> Avi
I'm going to assume your operands are variables instead of
Sorin Schwimmer wrote:
>
> Thanks for the pointers.
>
> Here are some answers:
>
> > Ok, so DBM wasn't built because it couldn't find the external symbol
> > 'dbm_firstkey'. I have no idea off the top of my head why that would
> > happen, but I don't think you really care at the moment since y
Grant Edwards wrote:
> Apparently that "filtering out" characters doesn't mean that
> they're ignored when doing the comparison. (A bit of a "WTF?"
> if you ask me). After some more googling, it appears that I'm
> far from the first person who interpreted "filtered out" as
> "ignored when compa
On Wed, 08 Apr 2009 10:51:19 -0400
Neal Becker wrote:
> What was wrong with this one?
>
> def demux(iterable, n):
> return tuple(islice(it, i, None, n) for (i, it) in
> enumerate(tee(iterable, n)))
Nothing much, I only noticed after posting that this one handles
infinite sequences too. For
Baris Demir wrote:
Stef Mientki wrote:
Baris Demir wrote:
Hi all,
I need to develop a GUI for some scientific data processing
operations and this GUI should work well with a 3D plotting module,
also with NumPy and SciPy for sure. I made a search about packages
but, there are plenty of these
TP wrote:
> If "di" is reliable, it seems a good solution for my initial constraint
> which is the impossibility to store anything but strings in my data
> structure.
'di' is dangerous and not reliable. When the original object is freed,
then the memory address may be used by another Python object
Hi,
joeygartin wrote:
Complete newbie, so forgive my improper use of Python terminology.
I am working with Django and I have to send off a number of emails
after a person has filled out a form. What I want is to make a call
that goes off to form and send the emails and redirect the user to
ano
> Anyway, this person also posted on mod_python list. One of the things
> I highlighted there was that mod_python for some configurations is
> multithreaded and as such they may not be properly protecting
> variables if they are storing them at global scope. They haven't
> responded to any comments
"Lawrence D'Oliveiro" wrote in message
news:grhq75$eb...@lust.ihug.co.nz...
> I thought that a good introduction might be to show them how HTML works, and
> progress from there to embedding little bits of JavaScript.
>
> Nothing to do with Python I know, but might be a possibility.
If you want t
There are a number of things which I have been used
to doing in other OO languages which I have not yet
figured out how to do in Python, the most important
of which is passing method names as args and inserting
them into method calls. Here are two cases I have been
trying to figure out for a curren
On Wed, 2009-04-08 at 19:47 +0100, Dale Amon wrote:
> There are a number of things which I have been used
> to doing in other OO languages which I have not yet
> figured out how to do in Python, the most important
> of which is passing method names as args and inserting
> them into method calls. He
Dale Amon schrieb:
There are a number of things which I have been used
to doing in other OO languages which I have not yet
figured out how to do in Python, the most important
of which is passing method names as args and inserting
them into method calls. Here are two cases I have been
trying to fi
On Wed, Apr 08, 2009 at 09:03:00PM +0200, paul wrote:
> I'd say you can use:
Thanks. I could hardly ask for a faster response on a
HowTo than this!
signature.asc
Description: Digital signature
--
http://mail.python.org/mailman/listinfo/python-list
I taught myself Python from Python Programming for the Absolute
Beginner by Michael Dawson (which has been mentioned above) and with
lots of help from the friendly members of this group, but there's now
a free e-book titled Snake Wrangling for Kids by Jason Briggs. You can
view it at http://www.bri
> I see how it avoids needing to look at the parent node in general, but
> if we were compiling by recursively descending through the AST, then
> we would know whether Name's would be loads or stores by the time we
> got to them (we would already had to have visited an encompassing
> assignment or
hello
i recently tried out this new version of psyco...
http://www.voidspace.org.uk/python/weblog/arch_d7_2009_03_14.shtml#e1063
...because of the new support for generators. the above link says "To
use and test generators, create preferences.py, following the
instructions in setup.py" - exce
In article <637028a0-58b9-4912-896d-2b17e1341...@q16g2000yqg.googlegroups.com>,
joeygartin wrote:
>
>I am working with Django and I have to send off a number of emails
>after a person has filled out a form. What I want is to make a call
>that goes off to form and send the emails and redirect the
On Wed, Apr 8, 2009 at 11:28 AM, Jim Garrison wrote:
> Jim Garrison wrote:
>
>> Ye Liu wrote:
>>
>>> On Apr 6, 6:33 pm, Jim Garrison wrote:
>>>
I notice the online docs (at docs.python.org/3.0/index.html) were
updated today. It seems some of the top-level pages, like
Tutorial, "U
Cameron Simpson wrote:
> On 07Apr2009 10:08, akineko wrote:
>| I'm trying to use named pipes to fuse a Python program and a C
>| program.
>| One side creates pipes using os.mkfifo() and both sides use the same
>| named pipes (one side reads, another side writes). The read side uses
>| select.sel
Hello again,
/usr/local/lib is in /etc/ld.so.conf. The files are real. However,
creating symlinks in /usr/lib targeting the libraries in /usr/local/lib,
then recompiling, solved the tkinter problem. So, the conclusion is that
only /usr/lib is consulted for the tcl/tk libraries.
multiprocessing -
On Mon, 06 Apr 2009 07:37:19 -0700, grkuntzmd wrote:
> What would be a good book to use as the text for the course?
"Python Programming: An Introduction to Computer Science"
Franklin, Beedle & Associates, by little Johny Zelle.
Accept no substitues!
Jim
--
http://mail.python.org/mailman/listinf
On Wed, 2009-04-08 at 01:57 +0100, Rhodri James wrote:
> On Tue, 07 Apr 2009 12:46:18 +0100, J. Clifford Dyer
> wrote:
>
> > On Mon, 2009-04-06 at 23:41 +0100, Rhodri James wrote:
> >> On Mon, 06 Apr 2009 23:12:14 +0100, Anish Chapagain
> >> wrote:
> >>
> >> > Hi,
> >> > I was trying to extrac
HIi everyone.
i was using python/c api to call a python function from c and I know the
name of the function which i want to call.Is there any way to do that??
This is the method i tried...
for eg:This is the python function i wants to call.
>>>def add(x):
... return x+10
This is my code i
On Wed, Apr 8, 2009 at 1:21 PM, pataphor wrote:
> On Wed, 08 Apr 2009 10:51:19 -0400 Neal Becker wrote:
>
>> What was wrong with this one?
>>
>> def demux(iterable, n):
>> return tuple(islice(it, i, None, n) for (i, it) in
>> enumerate(tee(iterable, n)))
>
> Nothing much, I only noticed after p
So I'm trying to see whats the cleanest way to do this:
I have a
checklist = [ax, bx, by, cy ..] (a combination of a,b,c with x and y,
either both on one)
allist = [a,b,c,]
xlist = [x, y, ..]
now I wanna loop through alist and xlist and see if the combination
exists in checklist
so someth
Hi everybody,
I'm doing some experiments with the python 3.0 C API, and I'm having
some problems for obtaining character strings. In python 2.X APIs, a
function called PyString_AsString was available. This function
provided a C string (char*) given a PyObject. But, in python 3.0 API
there is no su
Esmail wrote:
Hello,
Anyone using Python for coding up genetic algorithms? If
so, would you share your favorite modules/libraries/tools?
Search 'Python genetic algorithm' on Google or elsewhere.
--
http://mail.python.org/mailman/listinfo/python-list
R. David Murray wrote:
Esmail wrote:
Hello Mohammed,
Yes, that would great. While I am comfortable with GAs,
I'm still rather inexperienced with Python so seeing some
implementation examples would be very useful.
A google for 'python genetic algorithms' turns up a number
of interesting hits.
Terry Reedy wrote:
Esmail wrote:
Hello,
Anyone using Python for coding up genetic algorithms? If
so, would you share your favorite modules/libraries/tools?
Search 'Python genetic algorithm' on Google or elsewhere.
Hi Terry,
I did that first, and I came up with a number of hits. The "proble
> PyObject* key = PyList_GetItem(moduleKeys,idx);
> PyObject* module = PyDict_GetItem( interp->modules, key );
> char* theKeyName =
> PySys_WriteStdout("Module '%s'\n", theKeyName);
> }
> I was not able to obtain theKeyName, knowing that the "key" PyObject
> is
PK wrote:
So I'm trying to see whats the cleanest way to do this:
I have a
checklist = [ax, bx, by, cy ..] (a combination of a,b,c with x and y,
either both on one)
Since you will be repeatedly looking for items in checklist, I suggest
making it a set instead.
allist = [a,b,c,]
xlist
[Miles]
> I assume that "smallish values of n" refers to the fact that
> itertools.tee places items into every generator's internal deque,
> which islice then skips over, whereas your version places items only
> into the deque of the generator that needs it.
The pure python equivalent listed in th
Sorry but it did not help... I tried this:
PyObject* key = PyList_GetItem(moduleKeys,idx);
char* theKeyName = PyUnicode_AsUTF8String( key );
And this, just in case:
PyObject* key = PyList_GetItem(moduleKeys,idx);
char* theKeyName = PyUnicode_AsUTF8String( PyObject
> The issue is that all PyUnicode* functions are returning PyObjects.
> PyString_AsString return value was char*. Is there any real equivalent
> of this function?
Ah, right. PyString_AsUTF8String returns a bytes object, to which you
need to apply PyBytes_AsString to. At the end, you need to decref
On Apr 8, 2:15 pm, PK wrote:
> So I'm trying to see whats the cleanest way to do this:
>
> I have a
>
> checklist = [ax, bx, by, cy ..] (a combination of a,b,c with x and y,
> either both on one)
>
> allist = [a,b,c,]
> xlist = [x, y, ..]
>
> now I wanna loop through alist and xlist and see i
Thank you very much for your help Martin, now I got it.
Cheers,
RC
On 9 abr, 00:05, "Martin v. Löwis" wrote:
> > The issue is that all PyUnicode* functions are returning PyObjects.
> > PyString_AsString return value was char*. Is there any real equivalent
> > of this function?
>
> Ah, right. Py
Hello,
I'm trying to do compression/decompression of stuff with zlib, and I
just don't get it...
Here is an example. I assume that dec should be "a", but it isn't. dec
turns out to be an empty string, and I don't understand why...
===
import zlib
compressor = zlib.compressob
Quoting PK :
> So I'm trying to see whats the cleanest way to do this:
>
> I have a
>
> checklist = [ax, bx, by, cy ..] (a combination of a,b,c with x and y,
> either both on one)
>
> allist = [a,b,c,]
> xlist = [x, y, ..]
>
[...]
> now the problem is I want to include alpha in missing l
In message <756dl.102831$ur4.35...@en-nntp-09.dc1.easynews.com>, Joel
Koltner wrote:
> If you want to emphasize web usage, I'd be tempted to show them a bit of
> HTML and then introduce them to CGI-bin scripts... written in Python.
Yes, and show them how to watch /var/log/apache2/error.log to fi
Excellent! Thanks all. Since I need to have this running on python 2.4 as
well, I think I'll choose,
for alpha in alist:
for xy in xlist:
if alpha+xy in checklist:
break
else:
missing.append(alpha)
jus tested and worked like a charm.
Appreciate your help!!
On W
On Apr 8, 8:44 pm, Piet van Oostrum wrote:
> > "tleeuwenb...@gmail.com" (tc) wrote:
> >tc> What, exactly, needs to be in place for an object to be a valid
> >tc> dictionary key?
>
> It must have __hash__ and __cmp__ or __eq__ methods. Newstyle classes
> inherit these from object.
> --
> Piet
On Wed, 2009-04-08 at 23:51 +0200, Emma Li wrote:
> Hello,
>
> I'm trying to do compression/decompression of stuff with zlib, and I
> just don't get it...
> Here is an example. I assume that dec should be "a", but it isn't. dec
> turns out to be an empty string, and I don't understand why...
>
1 - 100 of 113 matches
Mail list logo