On 13/06/2006 4:11 PM, Girish Sahani wrote:
> Hi,
> Please check out the following loop,here indexList1 and indexList2 are a
> list of numbers.
Later you say they are integers. Note: Python calls 2.0 a float, not an
integer.
|>>> foo = [9, 8, 7]
|>>> foo[2.0]
Traceback (most recent call last):
> Ok, here's the Hello World example from the Scala website:
>
> object HelloWorld {
> def main(args: Array[String]) = {
> Console.println("Hello, world!")
> }
> }
>
> Opening and closing braces?
> "def main(args: Array[String])"?
> Console.println?
>
> About the only Pythonic thing I can s
Hi Mr. Steve,
The *indexes* i am using are lists...
The code for creation of the PartionedPK is given below...
***
class PartitionedPK(object):
def __init__(self, name, save_to, fields):
self.name= name
Hi all
This is probably old hat to most of you, but for me it was a
revelation, so I thought I would share it in case someone has a similar
requirement.
I had to convert an old program that does a traditional pass through a
sorted data file, breaking on a change of certain fields, processing
each
[EMAIL PROTECTED] wrote:
> Steve Holden wrote:
>
>>[EMAIL PROTECTED] wrote:
>>Since HTTP authentication is managed by the browser it's difficult to
>>integrate it with web application authentication: basically you have to
>>choose between the two. There's no way for the server to tell the
>>browse
Hi,
Please check out the following loop,here indexList1 and indexList2 are a
list of numbers.
for index1 in indexList1:
for index2 in indexList2:
if ti1[index1] == ti2[index2] and not index1 != indexList1.pop():
index1+=1
index2+=1
continue
elif index1 == indexList1.
hi,
what is the difference among numeric, numpy and numarray? i'm going to start
using matplotlib soon and i'm not sure which one i should use.
this page says, "Numarray is a re-implementation of an older Python array
module
called Numeric"
http://www.stsci.edu/resources/software_hardware/nu
On 13/06/2006 3:11 PM, John Machin wrote:
> def bfunction(foo=0, bar="plugh", zot=None):
> # keyword args, caller can do:
> bfunction(zot=10**100) # using a keyword: args foo & bar get default values
> bfunction(10, "xyzzy") # positional: foo = 10; bar = "xyzzy"; zot = 10**100
The last line above
"Johann C. Rocholl" <[EMAIL PROTECTED]> writes:
> Currently, I am considering the following options:
> - LGPL
> - Modified BSD License
> - X11 License (aka MIT License)
>
> I appreciate the simplicity of the BSD and MIT Licenses, except for
> the names. "BSD License" can be confused with the orig
Jonathan Ellis wrote:
> ago wrote:
> > I have just discovered Python Scripter by Kiriakos Vlahos and it was a
> > pleasant surprise. I thought that it deserved to be signalled. It is
> > slim and fairly fast, with embedded graphical debugger, class browser,
> > file browser... If you are into grap
On 13/06/2006 1:45 PM, Redefined Horizons wrote:
> I'm trying to understand the argument flags that are used in the
> method table of an extension module written in C.
>
> First let me ask this question about the method table. Is it an C
> array named "PyMethodDef"?
Its *type* is PyMethodDef (the
[EMAIL PROTECTED] wrote:
> I happen to have delphi, so if someone wants me to make small changes,
> just let me know, I'll try to help
Hmm... now that you offer, would it be possible to have the colors of
text just like in IDLE?
I tried configuring the colors, but some of them don't exist as
Johann C. Rocholl wrote:
> I appreciate the simplicity of the BSD and MIT Licenses, except for the
> names. "BSD License" can be confused with the original BSD License,
> while "MIT License" according to the FSF "is misleading, since MIT has
> used many licenses for software."
I had one lawyer tell
John Salerno wrote:
> I was reading in the wxPython wiki that most of the time you don't have
> to include the id parameter at all, and you can just use keyword
> arguments for other parameters. But I'm having trouble converting this
> code into that method (i.e., without the id parameter)
>
[EMAIL PROTECTED] wrote:
if I try to run blobedit.py in the IDLE ide ...
> the path is equal to "8833" for some
reason.
I believe that IDLE sets up some kind of debugging
connection to its child process. That number might
be a processs ID or port number or something related
to that.
I trie
Steve Holden wrote:
> [EMAIL PROTECTED] wrote:
> Since HTTP authentication is managed by the browser it's difficult to
> integrate it with web application authentication: basically you have to
> choose between the two. There's no way for the server to tell the
> browser to start presenting the requ
"Tim Daneliuk" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> So it is claimed:
>
>
http://www.infoq.com/news/Scala--combing-the-best-of-Ruby-;jsessionid=CC7C8366455E67B04EE5864B7319F5EC
>
> Has anyone taken a look at this that can provide a meaningful contrast
> with Python?
Ok, he
Is the console necessary?
if not, you can easily disable the console by rename the ext to .pyw
[EMAIL PROTECTED] wrote:
> Hi!
>
> I have an application where images (jpeg) have to be annotated by an
> operator. I use PIL like:
>
> import Image
> im = Image.open(Path)
> im.show()
> raw_input(Path +
bruno at modulix wrote:
> [EMAIL PROTECTED] wrote:
> (meta : please don't top-post)
> > Intuitively, the name lookup on
> > self.parent.foo would be faster than if you passed in the object in
> > question
>
>
> Each dot means doing a lookup in a namespace. The more dots, the more
> lookups. And l
I'm trying to understand the argument flags that are used in the
method table of an extension module written in C.
First let me ask this question about the method table. Is it an C
array named "PyMethodDef"?
Now, onto my questions about the arguments:
[1] I see that even when the Python function
Butternut Squash wrote:
> Where is the best place to learn how to use this library???
There dont seem to any tutorials on the web for PyQt4 yet. So you'll
have to make do with reading pyqt3 tutorials, and reading the bundled
example code.
If you are comfortable with C++, then check out the Qt tut
ago wrote:
> I have just discovered Python Scripter by Kiriakos Vlahos and it was a
> pleasant surprise. I thought that it deserved to be signalled. It is
> slim and fairly fast, with embedded graphical debugger, class browser,
> file browser... If you are into graphical IDEs you are probably going
HiI am trying to get a profile of a program using the profile module. The program itself has some fork() call in the code, but my profile.run() is placed before that fork() call.My question is will the profiler be able to pickup the execution of the child and parent processes? Or just one of those?
[EMAIL PROTECTED] wrote:
> Scala seems terse and fast enough, few examples:
>
> http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=all&lang=psyco&lang2=scala
>
> Bye,
> bearophile
Static typing, type inference, "sequence comprehensions"...
Looks that there's a new crop of programming
Being deluged by spam like nearly all of us (though fortunately I have a
very good spam filter), I also hate spam as much as almost everybody. I
know basic Python (enough to make a simple IRC bot) and I figured a good
project to help learn Python would be to make a simple "proxypot."
I've done som
Tim Daneliuk wrote:
> So it is claimed:
>
>
> http://www.infoq.com/news/Scala--combing-the-best-of-Ruby-;jsessionid=CC7C8366455E67B04EE5864B7319F5EC
>
> Has anyone taken a look at this that can provide a meaningful contrast
> with Python?
I find the language very interesting but it is not like
greg wrote:
> I have uploaded a new PyGUI 1.7.2 package to correct
> a couple of errors in the setup.py file.
>
> http://www.cosc.canterbury.ac.nz/~greg/python_gui/
>
> -
>
> What is PyGUI?
> --
>
> PyGUI is an experimental highly-Pyt
> > I have now decided to license my project (including the pure python PNG
> > library) under the Apache License 2.0 which is less restrictive than
> > the GPL in terms of sublicensing.
>
> But it is also incompatible with the GPL:
>
> http://www.fsf.org/licensing/licenses/index_html#GPLIncompatib
Scala seems terse and fast enough, few examples:
http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=all&lang=psyco&lang2=scala
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
Thomas Ganss wrote:
> Klaas schrieb:
>
> > 4. Insert your keys in sorted order.
> This advice is questionable -
> it depends on the at least on the db vendor and probably
> sometimes on the sort method, if inserting pre-sorted
> values is better.
The article I wrote that you quoted named a specifi
Paul Boddie wrote:
> Johann C. Rocholl wrote:
>
>>The MIT license is enticingly short and simple, thank you for the tip.
>>
>>I have now decided to license my project (including the pure python PNG
>>library) under the Apache License 2.0 which is less restrictive than
>>the GPL in terms of sublice
So it is claimed:
http://www.infoq.com/news/Scala--combing-the-best-of-Ruby-;jsessionid=CC7C8366455E67B04EE5864B7319F5EC
Has anyone taken a look at this that can provide a meaningful contrast
with Python?
--
Tim D
Johann C. Rocholl wrote:
> The MIT license is enticingly short and simple, thank you for the tip.
>
> I have now decided to license my project (including the pure python PNG
> library) under the Apache License 2.0 which is less restrictive than
> the GPL in terms of sublicensing.
But it is also in
Duncan Booth <[EMAIL PROTECTED]> writes:
> Gabriel Zachmann wrote:
>
> > Here is a very simple Python script utilizing urllib:
[...]
> > "http://commons.wikimedia.org/wiki/Commons:Featured_pictures/chronologi
> > cal"
> > print url
> > print
> > file = urllib.urlopen( url )
[...]
Hi folks
New to the group.
As a newbie to Python I`d just like to plug Ron Stephens web site which
contains many excellent articles, podcasts and much Python stuff to
help beginners like me. No doubt many already use it and listen to his
weekly podcasts. http://www.awaretek.com/python/index.html
Ch
[EMAIL PROTECTED] writes:
> I am using Python to assemble a biomedical literature analysis pipeline
> as part of my PhD thesis. (http://ib-dwb.sf.net/Muscorian.html)
What's a literature analysis pipeline?
(mental picture: fat pressurised pipe leading to big noisy wood
chipper-style machine spewi
[EMAIL PROTECTED] wrote:
> I have an apache 1.3.29 server that is running my website. I have
> written a bunch of scripts to generate the pages from csv files which
> work great.
>
> My next thing to learn is how to get user authentication functioning
> the way I need it.
>
> I understand the st
Hi John
John Salerno a écrit :
> I was reading in the wxPython wiki that most of the time you don't have
> to include the id parameter at all, and you can just use keyword
> arguments for other parameters. But I'm having trouble converting this
> code into that method (i.e., without the id param
James Stroud a écrit :
> SuperHik wrote:
>
>> and the winner is... :D
>> David Isaac wrote:
>>
>>> alpha = string.lowercase
>>> x=(a+b+c for a in alpha for b in alpha for c in alpha)
>>
>>
>>
>>
>
> Not necessarily vying for winner, but David's solution is highly
> specific as it doesn't do so w
John Machin a écrit :
> On 10/06/2006 7:49 AM, Rob Cowie wrote:
(snip)
>>
>> def generator():
>> for char in alpha:
>
>
> Why stop at two spaces? One-space indentation is syntactically correct :-)
I very often uses 2-spaces indent when posting here, to avoid problems
with wrapping.
--
http:
Evening,
I have an application that is running in an endless loop processing an
incoming queue. Every run is supposed to write a log file about the run
and then close it again. While the 'logging' module is generally working
well (even though the documentation makes me miss some proper examples
ho
Hi!
I have an application where images (jpeg) have to be annotated by an
operator. I use PIL like:
import Image
im = Image.open(Path)
im.show()
raw_input(Path + ':')
Python runs in a console window. Then show starts some application (in
my case "Windows picture and FAX viewer") and the pict
I was reading in the wxPython wiki that most of the time you don't have
to include the id parameter at all, and you can just use keyword
arguments for other parameters. But I'm having trouble converting this
code into that method (i.e., without the id parameter). I keep getting
errors that invo
Hello there,
I have this weird problem with a mod_python application.
Recently I installed ElementTree and cElementTree through ez_setup.py,
even though they were already installed normally (this might not be too
smart, but I don't think it's related to my actual problem).
I have a web applica
On 06/12/2006-11:00AM, David Hirschfield wrote:
>
> I want some kind of lockfile implementation that will allow one process
> to lock a file (or create an appropriately named lockfile that other
> processes will find and understand the meaning of), but there are some
> important requirements:
>
tatamata a écrit :
> Does anyone know is Boa constructor project still alive?
> I visited Boa web site and it seems that it hasn't been updated for a long
> time
>
I downloaded the version 0.4.4 a couple of months ago, so I guess the
project is alive (I have been used the 0.3.1 before). I h
David Hirschfield wrote:
> I want some kind of lockfile implementation that will allow one process
> to lock a file (or create an appropriately named lockfile that other
> processes will find and understand the meaning of), but there are some
> important requirements:
>
> 1. Multiple processes w
Hi!
Sorry for my bad english.
Look here : http://www.mvps.org/scripting/languages/
Python, with PyWin32, can use ActiveScripting.
But... only windows...
--
@-salutations
Michel Claveau
--
http://mail.python.org/mailman/listinfo/python-list
I'm not sure it's even possible to do what I'm trying to here...just
because the logistics may not really allow it, but I thought I'd ask
around...
I want some kind of lockfile implementation that will allow one process
to lock a file (or create an appropriately named lockfile that other
proce
Thank you now it work!!!
Thomas Heller ha scritto:
> lux wrote:
> > Hi to all,
> > i need to traslate this struct in python using ctypes
> >
> > struct Soptions
> > {
> > char chVolumeLabel[128];
> > __int32 nSessionToImport;
> > BS_BOOL bJolietFileSystem;
> > BS_BOOL bBootable;
>
Just curious if anyone had any information, or links, regarding the
blocking of network ports and/or taking over (hijacking) ports using
Python.
Any python modules/libs you could recommend? tutorials/reading
materials?
Thanks in advance.
--
http://mail.python.org/mailman/listinfo/python-list
I have an apache 1.3.29 server that is running my website. I have
written a bunch of scripts to generate the pages from csv files which
work great.
My next thing to learn is how to get user authentication functioning
the way I need it.
I understand the steps required to make .htpaccess files wor
Does anyone know is Boa constructor project still alive?
I visited Boa web site and it seems that it hasn't been updated for a long
time
--
http://mail.python.org/mailman/listinfo/python-list
Cameron Laird wrote:
> Andrew Clover provides new Python icons:
>http://doxdesk.com/img/software/py/icons2.png
>http://mail.python.org/pipermail/python-dev/2006-March/063235.html
>http://mail.python.org/pipermail/python-dev/2006-April/063517.html
I love the new 'folder
H J van Rooyen wrote:
> Note that the point of failure is not the same place in the python file, but
> it
> is according to the traceback, again at a flush call...
Yes, traceback is bogus. Maybe the error is raised during garbage
collection, although the strace you've got doesn't show that. The
> Just in case anybody has the same problem, here's my first attempt at
> implementing a subset of the PNG spec in pure Python. I license it to
> you under the terms of the GNU GPL.
Update: the code is now licensed under the Apache License 2.0.
> http://trac.browsershots.org/browser/trunk/shotfac
Wait wait, what do I do exactly? Thanks Michel.
Michel Claveau wrote:
> Hi!
>
> For me, like PHP (message of 11h.35) :
>
> Only in Windows, I can call Ruby (more exactly Ruby-script) from
> Python.
> I can, also, call, from Python, Ruby-defined-functions, like a method
> of a Python-class.
>
> It'
MTD wrote:
> Hello,
>
> I'm wondering if there's a quick way of resolving this problem.
>
> In a program, I have a list of tuples of form (str,int), where int is a
> count of how often str occurs
>
> e.g. L = [ ("X",1),("Y",2)] would mean "X" occurs once and "Y" occurs
> twice
>
> If I am given
I'll check that out, thanks!
vasudevram wrote:
> [EMAIL PROTECTED] wrote:
> > Hello all. I want a ruby and a python module to be able to communicate
> > with each other, access classes, instances and the like. Is there a
> > bridge for this? I'm aware of rupy, but the documentation seems rather
>
lux wrote:
> Hi to all,
> i need to traslate this struct in python using ctypes
>
> struct Soptions
> {
> char chVolumeLabel[128];
> __int32 nSessionToImport;
> BS_BOOL bJolietFileSystem;
> BS_BOOL bBootable;
> TCHAR chBootImage[_MAX_PATH];
> BS_BOOL bFinalize;
> BS_BOOL bTestBu
Hi!
For me, like PHP (message of 11h.35) :
Only in Windows, I can call Ruby (more exactly Ruby-script) from
Python.
I can, also, call, from Python, Ruby-defined-functions, like a method
of a Python-class.
It's a combination of Active-scripting & dynamic method add to a class.
It's run OK with
Girish Sahani wrote:
> Thanks!It workedi wasted a lot of time trying to find a bug in my
> code...what is wrong in iterating over a list and modifying it?
> Doesnt python take the modified list every time the loop starts?
this is explained in the tutorial, under "the for statement":
The
[EMAIL PROTECTED] wrote:
> Hello all. I want a ruby and a python module to be able to communicate
> with each other, access classes, instances and the like. Is there a
> bridge for this? I'm aware of rupy, but the documentation seems rather
> inadequate for the uninitiated. Are there other librari
> QtNetwork
> A set of classes to support TCP and UDP socket programming and higher
> level protocols (eg. HTTP).
Since QtNetwork is asynchronous how does it compare to twisted?
I find Qt's signals and slots easier to understand and work with than
twisted deferreds.
--
damjan
--
h
Girish Sahani wrote:
> Btw going slightly off-topic, when i try to run a code like below with
> around 50 elements (pairs) in l4,python just hangs. Any ideas why this is
> happening...the data is not that large :((
building a filtered new list by repeatedly removing stuff from a copy
of the origi
Hi!
Only in Windows, I can call PHP (more exactly PHP-script) from Python.
I can, also, call, from Python, PHP-defined-functions, like a method of
a Python-class.
It's a combination of Active-scripting & dynamic method add to a class.
--
@-salutations
Michel Claveau
--
http://mail.python.o
Steve Holden <[EMAIL PROTECTED]> wrote:
>def algorith(d, s):
> if s in d:
> d[s] += 1
> else:
> d[s] = 1
def algorith(d, s):
d[s] = d.get(s, 0) + 1
And the OP should note that converting between dict d and list of
pairs L is simply a matter of L = d.items() and d = di
Lad wrote:
> I downloaded jpeg (from ftp://ftp.uu.net/graphics/jpeg/ ) source
> libraries( file jpegsrc.v6b.tar.gz) and installed them. Now in
> /usr/local/lib I have the following files: cjpeg
> ,djpeg,jpegtran,rdjpgcom and wrjpgcom
cjpeg, djpeg etc are executables, not libraries. if you have
Hello all. I want a ruby and a python module to be able to communicate
with each other, access classes, instances and the like. Is there a
bridge for this? I'm aware of rupy, but the documentation seems rather
inadequate for the uninitiated. Are there other libraries/bridges or
maybe a rupy tutoria
Hi to all,
i need to traslate this struct in python using ctypes
struct Soptions
{
char chVolumeLabel[128];
__int32 nSessionToImport;
BS_BOOL bJolietFileSystem;
BS_BOOL bBootable;
TCHAR chBootImage[_MAX_PATH];
BS_BOOL bFinalize;
BS_BOOL bTestBurn;
BS_BOOL bPerformOPC;
BS_BOOL bV
Gabriele Farina wrote:
> Hi,
>
> I'm tring to implement a Singleton object that should be specific for
> every thread who create it, not global.
> I tried a solution that seems to work, but I have a very poor knowledge
> of concurrent programming, so I'd like someone to help me find some
> problem
"Girish Sahani" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> I am trying to modify a list of pairs (l4) by removing those
> pairs which are not present in a third list called pairList.
> The following is a simplified part of the routine i have written. However
> it does not
>Does it overcome the problem that you reported earlier, that the
contents of the output file from BCP were out of order?
Yes, it does. But, to be honest, I don't know how!!!
"John Machin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 10/06/2006 3:00 AM, A.M wrote:
>> He
By the way, does anyone know if / how you can change the key bindings
in PythonWin? In PyScripter, I was quite pleased that the autocomplete
lets you make your selection by pressing enter (natural), yet in
PythonWin you have to press tab (unnatural). Thanks.
[EMAIL PROTECTED] wrote:
> Great IDE! I
Jan Bijsterbosch wrote:
> Hello ago, Bernard,
>
> "ago" <[EMAIL PROTECTED]> schreef in bericht
> news:[EMAIL PROTECTED]
> >
> > Bernard Lebel wrote:
> >> Not me. I'll probably sound pedantic but
> >> - the editor text looks awful, changing the editor options had no effect
> >> at all
> >> - there
Am Mon, 12 Jun 2006 06:22:52 -0700 schrieb czajnik:
>
> Hi!
>
> I'm quite new to Python development. Can someone advise me a framework
> useful for building (pre-)forking or threaded TCP servers, other than
> SocketServer ? I've seen source code of a few python-based app servers,
> all of theme
Great IDE! I love it. Two things that make me very happy:
1. Unlike PythonWin and Stan's Python Editor (SPE), PyScripter shows
not just methods but also attributes in the class browser. [I'll
mention that Eric3 also does this, but I don't use Eric3 much because
the editor component doesn't allow s
Diez B. Roggisch napisal(a):
> Why do you care if the asynchronous model is overkill or the performance is
> good? Twisted comes close to what you want - and using its strength as
> arguments against it strikes me as odd.
I was unclear :) I mean I don't like using asynchronous model for the
kind
Redefined Horizons wrote:
> How does a web application that uses Python compare with one that uses AJAX?
Mauve has the most RAM
--
http://mail.python.org/mailman/listinfo/python-list
Hi everyone.
I've just been trying to add a bit more granularity to my logging code,
as the jump from INFO (level 20) to DEBUG (level 10) is a bit too big.
I was thinking of borrowing a few levels from java: fine (18), finer
(16) and finest(14).
This is what I've tried:
log = logging.getLogger(a
I think if you know java language very well but feel suffering with the
error prone javascript ,
GWT is good choose for AJAX development .
With the well-known IDE Eclipse your development time efficiency will
promote fast !
--
http://mail.python.org/mailman/listinfo/python-list
QOTW: "Check out BeautifulSoup -- you will never write HTMLParser-based
screen scrapers again. :)" - Jonathan Ellis
"You clearly need something instead of XML." - Paul McGuire
http://groups.google.com/group/comp.lang.python/msg/09e943c8dbf1e8c5?
Johann C. Rocholl donates a PNG manager i
In article <[EMAIL PROTECTED]>,
<[EMAIL PROTECTED]> wrote:
.
.
.
>Scrape means simply scraping pixel colors from locations on the screen.
>I'll worry about assembling it into meaningful information.
>
>Previously, I used Java,
[EMAIL PROTECTED] wrote:
>
> Hi!
>
> I'm quite new to Python development. Can someone advise me a framework
> useful for building (pre-)forking or threaded TCP servers, other than
> SocketServer ? I've seen source code of a few python-based app servers,
> all of theme seem to reinvent the wheel,
It works , thank you everyone !
I think there is much more I need to learn before I can grasp a full
understand of the C/S modle !
Thanks again !
--
http://mail.python.org/mailman/listinfo/python-list
Girish Sahani wrote:
> Hi,
> I am trying to modify a list of pairs (l4) by removing those
> pairs which are not present in a third list called pairList.
> The following is a simplified part of the routine i have written. However
> it does not give the correct output. Please help!
> Its possible
MTD wrote:
> Hello,
>
> I'm wondering if there's a quick way of resolving this problem.
>
> In a program, I have a list of tuples of form (str,int), where int is a
> count of how often str occurs
>
> e.g. L = [ ("X",1),("Y",2)] would mean "X" occurs once and "Y" occurs
> twice
>
> If I am given a
Hi!
I'm quite new to Python development. Can someone advise me a framework
useful for building (pre-)forking or threaded TCP servers, other than
SocketServer ? I've seen source code of a few python-based app servers,
all of theme seem to reinvent the wheel, eventually reusing
SocketServer. I'd ap
> Yes, use the proper tool for the job. Tuples are immutable (they are
> read-only once created). Instead use a dictionary. They key would be
> your string, the value would be the count.
Wow, I really should have thought of that! Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
MTD wrote:
> Hello,
>
> I'm wondering if there's a quick way of resolving this problem.
>
> In a program, I have a list of tuples of form (str,int), where int is a
> count of how often str occurs
>
> e.g. L = [ ("X",1),("Y",2)] would mean "X" occurs once and "Y" occurs
> twice
>
> If I am given a
MTD wrote:
> Hello,
>
> I'm wondering if there's a quick way of resolving this problem.
>
> In a program, I have a list of tuples of form (str,int), where int is a
> count of how often str occurs
>
> e.g. L = [ ("X",1),("Y",2)] would mean "X" occurs once and "Y" occurs
> twice
>
> If I am given
MTD wrote:
> Hello,
>
> I'm wondering if there's a quick way of resolving this problem.
>
> In a program, I have a list of tuples of form (str,int), where int is a
> count of how often str occurs
...
> So clearly that doesn't work... any ideas?
Yes, use the proper tool for the job. Tuples are
Hello,
I'm wondering if there's a quick way of resolving this problem.
In a program, I have a list of tuples of form (str,int), where int is a
count of how often str occurs
e.g. L = [ ("X",1),("Y",2)] would mean "X" occurs once and "Y" occurs
twice
If I am given a string, I want to search L to
Hello ago, Bernard,
"ago" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
>
> Bernard Lebel wrote:
>> Not me. I'll probably sound pedantic but
>> - the editor text looks awful, changing the editor options had no effect
>> at all
>> - there is no network access of UNC paths other th
Tgone:
>I have some custom PHP functions that I didn't want to re-write in
>Python. But maybe I should just rewrite them :)
Absolutely.
The alternative is one of many IPC mechanisms that are available in both
Python and PHP (such as XML-RPC). But that may require more effort than
rewriting the f
On 11/06/2006 1:26 PM, [EMAIL PROTECTED] wrote:
> Thanks for the critique.
>
> John Machin wrote:
>> On 10/06/2006 7:00 AM, [EMAIL PROTECTED] wrote:
[snip]
>>> def sort(self,myList):
>>> for gap in self.gapSeq:
>>> for i in range(1,gap+1):
>>> self.gapInsert
I had similar problems a couple of months back when I was teaching
myself Tkinter and PIL. I wrote up my experiences here:-
http://www.aqzj33.dsl.pipex.com/how_i_learned_tkinter/contents.htm
If you look at the section on Images you will see how I eventually
solved it (with bucket loads of help
Girish Sahani wrote:
>>I guess it's already the case with lst = [ e for e in lst if e in pairs ]
>>
>>
>>In [1]: lst = (1,2,3,4)
>>
>>In [2]: pairs=(5,)
>>
>>In [3]: lst=[e for e in lst if e in pairs]
>>
>>In [4]: lst
>>Out[4]: []
>
> Yes its working. I realized that i was giving an input which di
Girish Sahani wrote:
(please don't top-post)
> Hey Bruno...you are seeing the wrong post :P...please ignore this and
> check out the one with (corrected) appended at the end...
You should have posted the correction in the same thread.
> Also, i used the list comprehension thingy which u have gi
> I guess it's already the case with lst = [ e for e in lst if e in pairs ]
>
>
> In [1]: lst = (1,2,3,4)
>
> In [2]: pairs=(5,)
>
> In [3]: lst=[e for e in lst if e in pairs]
>
> In [4]: lst
> Out[4]: []
Yes its working. I realized that i was giving an input which didnt satisfy
the condition.
Now
1 - 100 of 140 matches
Mail list logo