"Gabriel Genellina" <[EMAIL PROTECTED]> writes:
> The "magic" happens when the descriptor is found in the *class*, not
> in the instance. I think it's detailed in Hettinger's document.
The document is wrong here:
Alternatively, it is more common for a descriptor to be invoked
automatical
On Apr 15, 6:35 am, Evan <[EMAIL PROTECTED]> wrote:
> that's great, a custom shell is what I need.
>
> Thanks all
> Evan
And for the quick-n-dirty there is:
python -i yourscript.py
Which runs your script then drops you into the interpreter.
- Paddy.
--
http://mail.python.org/mailman/listinfo/
in 342436 20080414 160208 =?UTF-8?B?R3J6ZWdvcnogU8WCb2Rrb3dpY3o=?= <[EMAIL
PROTECTED]> wrote:
>> Hello, I was hoping to get some opinions on a subject. I've been
>> programming Python for almost two years now. Recently I learned Perl,
>> but frankly I'm not very comfortable with it. Now I want to
Hi all,
I'm very very beginner of python but I'm dare to ask this question
straight away. =P
Is it possible to import C++ static library compiled by GCC? The
target is definitely Linux machine.
I found some examples from Google showing the way C++ can import
Python so called embedded python. But
andrew cooke <[EMAIL PROTECTED]> writes:
> This is my first attempt at new classes and dynamic python, so I am
> probably doing something very stupid... After reading the how-to for
> descriptors at http://users.rcn.com/python/download/Descriptor.htm I
> decided I would make an object that return
On Apr 11, 10:27 am, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Thu, 10 Apr 2008 23:57:29 -0300, <[EMAIL PROTECTED]> escribió:
>
> > i.e. you give, the graph, the start and end vertices as inputs and you
> > get the output as a listing of all the paths. This is where I got to.
> > It would
On Apr 11, 10:27 am, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
>
> If you want to understand how recursion works, or how you can actually
> construct a recursive function step by step, see this excellent post by
> Neil Cerutti:
>
> http://groups.google.com/group/comp.lang.python/msg/9f0b1
Brian: Impressive!
This is the most balanced, well-informed and interesting reply to this
debate. I would like to make some comments even so.
I have tried all languages, and consider myself agnostic. However, I
would like to roughly repeat what James Gosling (Java inventor) said
at a lectu
andrew cooke a écrit :
> Hi,
>
> This is my first attempt at new classes and dynamic python, so I am
> probably doing something very stupid... After reading the how-to for
> descriptors at http://users.rcn.com/python/download/Descriptor.htm I
> decided I would make an object that returns attribut
Dear Python users,
I am pleased to announce version 9.3 of the data plotting software
DISLIN.
DISLIN is a high-level and easy to use plotting library for
displaying data as curves, bar graphs, pie charts, 3D-colour plots,
surfaces, contours and maps. Several output formats are supported
such as X
Hrvoje Niksic a écrit :
(snip)
> As others explained, descriptors are called for descriptors found in
> class attributes, not in ones in instance attributes.
(snip)
> However, if you know what you're doing, you can simply customize your
> class's __getattribute__ to do what *you* want for your o
On Apr 15, 4:06 am, Bruno Desthuilliers wrote:
> The canonical solution is to use a custom descriptor instead of a property:
>
> class Field(object):
>def __init__(self, name, onchange):
> self.name = name
> self.onchange = onchange
>
>def __get__(self, instance, cls):
> if
On Fri, 2008-04-11 at 03:14 -0700, bdsatish wrote:
> The built-in function round( ) will always "round up", that is 1.5 is
> rounded to 2.0 and 2.5 is rounded to 3.0.
>
> If I want to round to the nearest even, that is
>
> my_round(1.5) = 2# As expected
> my_round(2.5) = 2# Not 3,
Req. Designation - Jr. Software Engineer(QA)
Company - Allindia Technologies Limited.
Criteria - Any Degree
SALARY - 2.5 to 3.5 lakhs PA.
How to apply -:
1] Click the below link and first complete your profile with your
school and college.
http://www.batchmates.com/MGMhome.asp?refid=1970195&re
On Apr 15, 11:22 am, Sjoerd Mullender <[EMAIL PROTECTED]> wrote:
> Thomas Dybdahl Ahle wrote:
> > On Fri, 2008-04-11 at 03:14 -0700, bdsatish wrote:
> >> The built-in function round( ) will always "round up", that is 1.5 is
> >> rounded to 2.0 and 2.5 is rounded to 3.0.
>
> >> If I want to round to
ignore that - i was mistaken (my test was too complex).
the problem seems to be that the attribute is deleted even though
__delete__ is defined.
i'll look at it tomorrow.
thanks again,
andrew
On Apr 15, 4:50 am, andrew cooke <[EMAIL PROTECTED]> wrote:
> i tried code very similar after reading
OK, fixed my bug - it does work. Now sleep... Thanks again, Andrew
--
http://mail.python.org/mailman/listinfo/python-list
Thomas Dybdahl Ahle wrote:
> On Fri, 2008-04-11 at 03:14 -0700, bdsatish wrote:
>> The built-in function round( ) will always "round up", that is 1.5 is
>> rounded to 2.0 and 2.5 is rounded to 3.0.
>>
>> If I want to round to the nearest even, that is
>>
>> my_round(1.5) = 2# As expected
>>
Alexander Dong Back Kim wrote:
> Hi all,
>
> I'm very very beginner of python but I'm dare to ask this question
> straight away. =P
>
> Is it possible to import C++ static library compiled by GCC? The
> target is definitely Linux machine.
>
> I found some examples from Google showing the way C+
Chris <[EMAIL PROTECTED]> wrote:
> even is closer to even.75 than even+1.25. Why should it be rounded
> up ?
Because the OP wants to round values to the nearest integer. Only values of
the form 'x.5' which have two nearest values use 'nearest even' to
disambiguate the result.
See http://en.wi
andrew cooke a écrit :
> On Apr 15, 4:06 am, Bruno Desthuilliers [EMAIL PROTECTED]> wrote:
>
>> The canonical solution is to use a custom descriptor instead of a property:
(snip code)
> i tried code very similar after reading the first replies and found
> that it did not work as expected on setti
Den 15. april. 2008 kl. 11.11 skrev Diez B. Roggisch:
> Alexander Dong Back Kim wrote:
>
>> Hi all,
>>
>> I'm very very beginner of python but I'm dare to ask this question
>> straight away. =P
>>
>> Is it possible to import C++ static library compiled by GCC? The
>> target is definitely Linux ma
On 14 avr, 20:02, Thomas Dybdahl Ahle <[EMAIL PROTECTED]> wrote:
> On Fri, 2008-04-11 at 03:14 -0700, bdsatish wrote:
> > The built-in function round( ) will always "round up", that is 1.5 is
> > rounded to 2.0 and 2.5 is rounded to 3.0.
>
> > If I want to round to the nearest even, that is
>
> > m
Penny Y. <[EMAIL PROTECTED]> wrote:
> -邮件原件-
> 发件人: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] 代表 Steve Holden
> 发送时间: 2008年4月15日 2:17
> 收件人: python-list@python.org
> 主题: Re: 有中国人乎?
>
>
> >Since what I entered in English was something like "Yes, Python has a
> >future. But it will tak
Bruno Desthuilliers <[EMAIL PROTECTED]>
writes:
>> However, if you know what you're doing, you can simply customize your
>> class's __getattribute__ to do what *you* want for your objects.
>
>
> But bear in mind that, beside possible unwanted side-effectn, you'll
> get a non-negligible performanc
On Apr 15, 12:33 pm, Chris <[EMAIL PROTECTED]> wrote:
> On Apr 15, 11:47 am, Duncan Booth <[EMAIL PROTECTED]>
> wrote:
>
> > Chris <[EMAIL PROTECTED]> wrote:
> > > even is closer to even.75 than even+1.25. Why should it be rounded
> > > up ?
>
> > Because the OP wants to round values to the neares
Hi,
Thanks!
I like DISLIN (even if I use it very little).
@+
--
Michel Claveau
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 15, 11:47 am, Duncan Booth <[EMAIL PROTECTED]>
wrote:
> Chris <[EMAIL PROTECTED]> wrote:
> > even is closer to even.75 than even+1.25. Why should it be rounded
> > up ?
>
> Because the OP wants to round values to the nearest integer. Only values of
> the form 'x.5' which have two nearest va
i installed pythoncard, but i could not find how to start it ?
where can i find its executable/binary ?
or menu item ?
or command line that i should enter ?
thanks.
--
İ.Bahattin Vidinli
Elk-Elektronik Müh.
---
iletisim bilgileri (Tercih sirasina gore):
skype: bvidinli (sesli g
On 11 Apr, 21:29, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
> ... If the numbers to be rounded come from a
> measurement, the left column is not just a number but the representant
> of an interval (as Mikael said, the're quantized). 2.3 means that the
> measurement was closer to 2.3 than to 2.2
On Apr 15, 1:04 pm, bvidinli <[EMAIL PROTECTED]> wrote:
> i installed pythoncard, but i could not find how to start it ?
> where can i find its executable/binary ?
> or menu item ?
> or command line that i should enter ?
>
> thanks.
>
> --
> Ý.Bahattin Vidinli
> Elk-Elektronik Müh.
> -
>
> Diez: I tried SWIG, and it works nicely with C. For C++, I didn't
> manage to make it work. I tried SIP; I have some problems compiling
> etc. Would it be too much to ask you to supply a working example of a
> (simple, stupid) C++ class and the necessary SIP files? Preferably for
> Mac OS X, b
On 15 апр, 07:46, Brian Vanderburg II <[EMAIL PROTECTED]>
wrote:
[...]
> C has the advantage that it does not to anything behind your back. This
> is very useful especially for any form of system development or where
> you must know exactly what is going on. It is still possible to do
> 'object o
I've been trying to access my webcam using Python, but I failed
miserably. The camera works fine under Ubuntu (using camora and
skype), but I am unable to get WebCamSpy or libfg to access my webcam.
First I tried webcamspy (http://webcamspy.sourceforge.net/). That
requires pySerial and pyParallel,
Berco Beute wrote:
> I've been trying to access my webcam using Python, but I failed
> miserably. The camera works fine under Ubuntu (using camora and
> skype), but I am unable to get WebCamSpy or libfg to access my webcam.
>
> First I tried webcamspy (http://webcamspy.sourceforge.net/). That
> r
I'm shocked. I've seen no mention of Smalltalk at all. Which should be soo
oobvious!
;)
I would take an incremental approach. Learn Java first, since it is still
OO, offers a rich set of libraries for just about every task but requires a
bit more work. C++ requires that you do more work still (
hi ,
python experts i want some help from u people just mail me how to
write scripts for web applications (like form coding for login page,
etc).
i m waiting for ur reply by
have a nice day!
--
http://mail.python.org/mailman/listinfo/python-list
Hrvoje Niksic a écrit :
> Bruno Desthuilliers <[EMAIL PROTECTED]>
> writes:
>
>>> However, if you know what you're doing, you can simply customize your
>>> class's __getattribute__ to do what *you* want for your objects.
>>
>> But bear in mind that, beside possible unwanted side-effectn, you'll
>
On Apr 15, 7:47 am, ashish <[EMAIL PROTECTED]> wrote:
> hi ,
> python experts i want some help from u people just mail me how to
> write scripts for web applications (like form coding for login page,
> etc).
>
> i m waiting for ur reply by
> have a nice day!
I suggest you start by going to the
ashish wrote:
> hi ,
> python experts i want some help from u people just mail me how to
> write scripts for web applications (like form coding for login page,
> etc).
>
>
> i m waiting for ur reply by
While you are waiting, would a nice back-rub & and a good portion of powder
sugar gently
ashish,
While you are waiting for Diez to arrive, you should check out this Web
site: http://www.google.com. It has some interesting content. Perhaps
you can find information there that will help you to ask a better question.
Here is another page you should look at:
http://www.catb.org/~es
On Apr 11, 12:08 pm, "Neil Cerutti" <[EMAIL PROTECTED]> wrote:
> On Thu, Apr 10, 2008 at 8:25 PM, Carl Banks <[EMAIL PROTECTED]> wrote:
> > On Apr 10, 2:20 pm, Tommy Nordgren <[EMAIL PROTECTED]> wrote:
>
> > > On 9 apr 2008, at 03.01, [EMAIL PROTECTED] wrote:
>
> > > > okay, I'm having this one pr
PureMVC is an extremely lightweight MVC framework based upon proven
design patterns. Originally written for ActionScript 3 (Flash, Flex,
AIR) it has been ported to nearly all major languages and platforms.
Here is a simple blog example using the PureMVC Framework for Python:
http://trac.puremvc.or
Thanks, that would be great.
While I'm at it I wondering how to display a video preview. Here's
someone using VideoCapture (the win32 lib) and PyGame, but I'd rather
use a GUI framework and preview/capture videos directly.
2B
> It has been *ages* since I did this - so take it with a grain of sa
Hi
I am trying to modify a small program i found off the internet as follows... I
can get the 'tracert' to work and it gives me all the info back. However, when
i replace the tracert with 'ping', the commamd prompt shows 'testing' and the
script freezes... any suggestions as why it is doing t
I'd like to be able to get the path to the oldest folder in whatever directory
I'm currently in. Is there a simple way to go about this? I'd like it to run
on both OS X and Windows XP. I found this example at
"http://trac.v2v.cc/browser/python-v2v/v2v/v2v.py?rev=python-v2v%2C37";, but was
cu
On Apr 14, 11:07 pm, Sverker Nilsson <[EMAIL PROTECTED]> wrote:
> What serious reports?
You almost had me collecting a list of reports/references. Almost :)
Google and you'll find them.
Regards,
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> I'd like to be able to get the path to the oldest folder in whatever
> directory I'm currently in.
And just because I'm feeling silly:
import os
print os.popen ("dir /b /ad /od /tc c:\python25\lib\site-packages").readline ()
TJG
--
http://mail.python.org/mailma
[EMAIL PROTECTED] wrote:
> I'd like to be able to get the path to the oldest folder in whatever
> directory
> I'm currently in. Is there a simple way to go about this?
> I'd like it to run on both OS X and Windows XP.
> I found this example but was curious if there's a better way to do this?
Berco Beute wrote:
> Thanks, that would be great.
>
> While I'm at it I wondering how to display a video preview. Here's
> someone using VideoCapture (the win32 lib) and PyGame, but I'd rather
> use a GUI framework and preview/capture videos directly.
gstreamer has a preview window.
Diez
--
ht
Gabriel;
That's really nice code you wrote. I will rewrite my app accordingly, after
I catch a breather! Say, would you please publish this somewhere? Why should
I write a howto on this and credit you when all I would be doing is
republishing (plagerizing) what you published? Please insert these k
Sverker Nilsson wrote:
> [about code supporting multiple Python versions]
> When it has been the fuzz with versions before, then I could have the
> same code still work with older versions. But now it seems I have to
> fork TWO codes. [...]
I don't think many people have ported their C extensions
Hi there,
I cannot figure out where did the 'dl' module went when running
python on AMD64 (debian stable).
According to the documentation, I have :
python
>>> import sys
>>> help(sys.setdlopenflags)
...
setdlopenflags(...)
sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)
...
But when
would it be possible to use one of an object's methods without
initializing the object?
In other words, if I have:
class Test:
def __init__(self):
print 'init'
def foo(self):
print 'foo'
and I want to use the foo function without hitting the
initialize constructor function.
Is t
On 15-Apr-08, at 12:30 AM, Sverker Nilsson wrote:
> No one forces me, but sooner or later they will want a Python 3.0 and
> then a 3.1 whatever.
>
> I don't want that fuzz. As about the C versions, I am not that
> worried. What's your point?
>
> I just like want to write a program that will stay w
On 15 avr, 17:27, Reckoner <[EMAIL PROTECTED]> wrote:
> would it be possible to use one of an object's methods without
> initializing the object?
>
> In other words, if I have:
>
> class Test:
> def __init__(self):
> print 'init'
> def foo(self):
> print 'foo'
>
> and I want to use
Reckoner wrote:
> would it be possible to use one of an object's methods without
> initializing the object?
>
> In other words, if I have:
>
> class Test:
> def __init__(self):
> print 'init'
> def foo(self):
> print 'foo'
>
> and I want to use the foo function without hitting the
>
It is published. On comp.lang.python. Google groups has it, so google
(search) will find it.
Cheers,
Cliff
On Tue, 2008-04-15 at 17:04 +0200, Victor Subervi wrote:
> Gabriel;
>
> That's really nice code you wrote. I will rewrite my app accordingly,
> after I catch a breather! Say, would you p
On 15 avr, 17:43, Robert Bossy <[EMAIL PROTECTED]> wrote:
> Reckoner wrote:
> > would it be possible to use one of an object's methods without
> > initializing the object?
>
> > In other words, if I have:
>
> > class Test:
> > def __init__(self):
> > print 'init'
> > def foo(self):
> >
What is the role or position of C# in this context ?
If I remember well, some people have said that C# is an improved
C++ or Java.
e
--
Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991
--
http://mail.
Chris McAloney wrote:
> *Have* you tried the 2to3 tool? It might help to lessen your
> concerns a bit. Yes, Python 3 is different from 2.x, but we've known
> that it was going to be for years and, as has already been pointed
> out, the devs are being very careful to minimize the pain that t
On Apr 14, 11:18 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
> However, that is for the OP to decide. The reason I don't like the
> sort of question I posed is it's presumptuous--maybe the OP already
> considered and rejected this, and has taken steps to ensure the in
> memory data structure won't
Aaron Watters <[EMAIL PROTECTED]> writes:
> Even with Btree's if you jump around in the tree the performance can
> be awful.
The Linux file cache really helps. The simplest approach is to just
"cat" the index files to /dev/null a few times an hour. Slightly
faster (what I do with Solr) is mmap
In article
<[EMAIL PROTECTED]>,
Sverker Nilsson <[EMAIL PROTECTED]> wrote:
> No one forces me, but sooner or later they will want a Python 3.0 and
> then a 3.1 whatever.
>
> I don't want that fuzz. As about the C versions, I am not that
> worried. What's your point?
>
> I just like want to wri
egbert wrote:
> What is the role or position of C# in this context ?
> If I remember well, some people have said that C# is an improved
> C++ or Java.
> e
I think C# is in a great position, and might be recommended. C# has the
added advantage of being able to very easily work with IronPython. Th
As a relative new comer to Python, I haven't done a heck of a lot of
hacking around with it. I had my first run in with Python's quirky (to
me at least) tendency to assign by reference rather than by value (I'm
coming from a VBA world so that's the terminology I'm using). I was
surprised that these
On Apr 15, 3:07 am, Paul Anton Letnes <[EMAIL PROTECTED]>
wrote:
> but C bogs you down with administrative stuff (try converting an int
> to a string; I found myself googling for an hour!).
It took an hour to find sprintf()?
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 15, 11:55 am, egbert <[EMAIL PROTECTED]> wrote:
> What is the role or position of C# in this context ?
> If I remember well, some people have said that C# is an improved
> C++ or Java.
C# is more similar to Java than C++. Neither is very similar to C++,
except in some cosmetic syntactic wa
[EMAIL PROTECTED] wrote:
> As a relative new comer to Python, I haven't done a heck of a lot of
> hacking around with it. I had my first run in with Python's quirky (to
> me at least) tendency to assign by reference rather than by value (I'm
> coming from a VBA world so that's the terminology I'm u
On Apr 15, 10:23 am, [EMAIL PROTECTED] wrote:
> As a relative new comer to Python, I haven't done a heck of a lot of
> hacking around with it. I had my first run in with Python's quirky (to
> me at least) tendency to assign by reference rather than by value (I'm
> coming from a VBA world so that's
On Apr 15, 6:23 pm, [EMAIL PROTECTED] wrote:
> As a relative new comer to Python, I haven't done a heck of a lot of
> hacking around with it. I had my first run in with Python's quirky (to
> me at least) tendency to assign by reference rather than by value (I'm
> coming from a VBA world so that's t
Thank you both, the assigning using slicing works perfectly (as I'm
sure you knew it would)... It just didn't occur to me because it
seemed a little nonintuitive... The specific application was
def dicttolist (inputdict):
finallist=[]
for k, v in inputdict.iteritems():
temp = v
http://effbot.org/zone/python-objects.htm still says it best.
mt
--
http://mail.python.org/mailman/listinfo/python-list
I think the fundamental "disconnect" is this issue of mutability and
immutability that people talk about (mainly regarding tuples and
whether they should be thought of as static lists or not)
Coming from VBA I have a tendency to think of everything as an
array...
So when I create the following
t
or
import sys
from urllib2 import *
try:
r=urllib2.urlopen("http://un-know-n.com/";)
except URLError,e:
print str(e)
sys.exit(1)
print r.info()
se python scope and namespaces ..
--
http://mail.python.org/mailman/listinfo/python-list
Hello all,
Today I found myself once again defining two functions that I use all
the time: nsplit and iterable. These little helper functions of mine
get used all the time when I work. Im sick of having to define them
(but am very good at it these days, less than 1 typo per function!).
It leads m
Hi there.
Is there a way to force unittest to run test methods in the order they
appear?
I'll try to explain.
My test suite appears as something like this:
import unittest
from test.test_support import TestSkipped, run_unittest
class TestCase(unittest.TestCase):
def test_z(self):
..
The fact that C# is a .NET language is also a major weakness, since you can
only use it on Windows.
- Original Message
From: Michael Torrie <[EMAIL PROTECTED]>
To: python-list@python.org
Sent: Tuesday, April 15, 2008 1:19:31 PM
Subject: Re: Java or C++?
egbert wrote:
> What is the role
[EMAIL PROTECTED] wrote:
> Thank you both, the assigning using slicing works perfectly (as I'm
> sure you knew it would)... It just didn't occur to me because it
> seemed a little nonintuitive... The specific application was
>
> def dicttolist (inputdict):
> finallist=[]
> for k, v in inpu
> You must be joking - better designed? C++ was a botch to an already poor
> language.
>
Although I'm relatively new to the concept that C++ is too difficult to
use, I would concede that with certain mindset and priorities Java may
be a valid choice. Not so if one is willing to expand know
On Tue, 15 Apr 2008 12:02:48 -0700 (PDT)
"Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote:
> Hi there.
> Is there a way to force unittest to run test methods in the order they
> appear?
Since they run in alphabetical order why not just rename them to the
order you want them to run? Something like th
On Sat, 12 Apr 2008 03:43:28 +, David Cook wrote:
> On 2008-04-11, Gabriel Ibanez <[EMAIL PROTECTED]> wrote:
>
>> Why is nobody talking about pyGTK ? There are no limits with licenses
>> (I think)
>
> The OS X port is still pretty preliminary.
>
> Dave Cook
I often use pygtk for my *ix pro
[EMAIL PROTECTED] schrieb:
> by changing temp = v[:] the code worked perfectly (although changing
> temp.insert(0,k) to temp = [k] + temp also worked fine... I didn't
> like that as I knew it was a workaround)
So the for body now looks like this?:
temp = v[:]
temp.insert(0, k)
finallist.
On Apr 3, 2008, at 10:54 AM, Trent Mick wrote:
> Jacob Davis wrote:
>> I just installed the MySQLdb module and I have been able to get it
>> to run in my command line interpreter. I am running Mac Leopard,
>> and Python 2.5.
>> I have tested importing and actually connecting and using a MySQL
On Apr 15, 1:51 pm, Erich <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> Today I found myself once again defining two functions that I use all
> the time: nsplit and iterable. These little helper functions of mine
> get used all the time when I work. Im sick of having to define them
> (but am very go
On Apr 15, 1:51 pm, Erich <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> Today I found myself once again defining two functions that I use all
> the time: nsplit and iterable. These little helper functions of mine
> get used all the time when I work. Im sick of having to define them
> (but am very go
Erich schrieb:
> This is like split() but returns a list of exactly lenght n. This is
> very useful when using unpacking, e.g.:
> x, y = nsplit('foo,bar,baz', ',', 2)
You could use the second argument of split:
x, y = 'foo,bar,baz'.split(',', 1)
Note that the number has the meaning "only spli
On 13 Apr, 19:19, Bryan Oakley <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > mapq = PhotoImage(file = 'C:\Users\saftarn\Desktop\elmapovic.gif')
> > w.create_image(10, 10, image = mapq, anchor = NW)
>
> > after doing this is there any possibility of getting the
> > characteristics of the
In 2005 I heard of plans to add Python as a second language to the
Gecko engine. Is this still true? Or has this plan been abandoned?
--
http://mail.python.org/mailman/listinfo/python-list
Well, if you're new - first find the function, then how to use it,
this funny %d5 (or something, don't remember) syntax - it's hard
compared to:
cout << 5 or similar stream tricks, or just 5 + "" in Java, or just
str(5) in Python. Anyway, small tasks are very hard for C newbies.
Den 15. a
> Today I found myself once again defining two functions that I use all
> the time: nsplit and iterable. These little helper functions of mine
> get used all the time when I work. Im sick of having to define them
> (but am very good at it these days, less than 1 typo per function!).
> It lead
>> def nsplit(s,p,n):
>> n -= 1
>> l = s.split(p, n)
>> if len(l) < n:
>> l.extend([''] * (n - len(l)))
>> return l
>
> The split() method has a maxsplit parameter that I think does the same
> thing. For example:
>
temp = 'foo,bar,baz'
temp.split(',', 1)
> ['foo'
Ben Kaplan wrote:
> The fact that C# is a .NET language is also a major weakness, since you can
> only use it on Windows.
Really? I have developed several C# .NET applications and I only use OS
X and Linux. Guess I imagined it. Also, IronPython runs very well on
Linux and OS X.
If you'd said
On Apr 15, 3:15 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
>
> My suggestion would just be to create your own utils.py module
> that holds your commonly used tools and re-uses them
>
> -tkc
Well, I almost said that, but I was trying to find some "battery"
included that he could use since the OP s
I am not sure how to capture the output of a command
using subprocess without creating a temp file. I was
trying this:
import StringIO
import subprocess
file = StringIO.StringIO()
subprocess.call("ls", stdout = file)
Traceback (most recent call last):
File "", line 6, in ?
File "/usr/local
when calling function hmm here, what do i get? the widget i clicked
on?
if i have a canvs on wich i have a bitmap and i click on the bitmap,
is the event.widget then the bitmap?
can i get info about the bitmap then? like color of the pixel i
clicked. if so, how?
w.bind("", key)
w.bind("", hmm)
d
Le Tue, 15 Apr 2008 05:21:54 -0700, Berco Beute a écrit :
> I've been trying to access my webcam using Python, but I failed
> miserably. The camera works fine under Ubuntu (using camora and skype),
> but I am unable to get WebCamSpy or libfg to access my webcam.
>
> First I tried webcamspy (http:
Tim Chase wrote:
>def nsplit(s, delim=None, maxsplit=None):
> if maxsplit:
>results = s.split(delim, maxsplit)
>result_len = len(results)
>if result_len < maxsplit:
> results.extend([''] * (maxsplit - result_len)
>return results
> else:
>
On Apr 15, 7:23 pm, [EMAIL PROTECTED] wrote:
> test = [[1],[2]]
> x = test[0]
Python names are pointer to values. Python behaves like Lisp - not
like Visual Basic or C#.
Here you make x point to the object which is currently pointed to by
the first element in the list test. If you now reassign
Hi all,
I've never programmed Java. I started directly in C, then C++ and now using
Python, mainly because its modules, because I found very hard to use and
find external libraries to do the same as Python (i.e. to read an URL o send
an email), and soften these libraries on C are not free or de
1 - 100 of 154 matches
Mail list logo