On Wed, Nov 4, 2009 at 4:27 AM, Tim Chase wrote:
> kylin wrote:
>
>> I need to remove the word if it appears in the paragraph twice. could
>> some give me some clue or some useful function in the python.
>>
>
> Sounds like homework. To fail your class, use this one:
>
> >>> p = "one two three fou
Tim Roberts wrote:
>
> elca wrote:
>>
>>im using win32com 's webbrowser module.
>
> Win32com does not have a webbrowser module. Do you mean you are using
> Internet Explorer via win32com?
>
>>i have some question about it..
>>is it possible to disable image loading to speed up webpage load?
On Sun, Nov 8, 2009 at 9:38 PM, Alan Harris-Reid
wrote:
> In the Python.org 3.1 documentation (section 20.4.6), there is a simple
> “Hello World” WSGI application which includes the following method...
>
> def hello_world_app(environ, start_response):
> status = b'200 OK' # HTTP Status
> headers =
In the Python.org 3.1 documentation (section 20.4.6), there is a simple
“Hello World” WSGI application which includes the following method...
def hello_world_app(environ, start_response):
status = b'200 OK' # HTTP Status
headers = [(b'Content-type', b'text/plain; charset=utf-8')] # HTTP Headers
How about:
print ('%s ' + '%-5.4f ' * 7) % ('text',1,2,3,4,5,6,7)
--
http://mail.python.org/mailman/listinfo/python-list
Am o întrebare, vă rugăm: De ce nu-mi trimit messages from Romania to America?
:(
--
http://mail.python.org/mailman/listinfo/python-list
Someone Something wrote:
I'm writing a simple tax calculator with Tkinter (just for fun).
Here's my current code:
[snip]
def printResult(self):
if self.nrate is None | self.nincome is None:
There's no such attribute as nrate or nincome.
Also, "|" is the bitwise oper
markolopa wrote:
Hi again,
I put a copy of the message and the tarball of the code here (because
of the problem of line breaks):
http://python-advocacy.wikidot.com/comp-lang-python-question
Here's a slightly different approach:
repository.py
=
class Repository(object):
def __
I'm writing a simple tax calculator with Tkinter (just for fun).
Here's my current code:
from Tkinter import *;
class TaxCalc:
def __init__(self, root):
rate=Frame(root)
rate.pack()
income=Frame(root)
income
On Sun, Nov 8, 2009 at 3:13 PM, Ray Holt wrote:
> Can you comment and uncomment code from the shell. I know that the format
> meny only shows in the edit window. I tried crtl + 3, which is what it said
> in the configuration window to use, and nothing happens.
I'm assuming by "the shell" you mean
Can you comment and uncomment code from the shell. I know that the format
meny only shows in the edit window. I tried crtl + 3, which is what it said
in the configuration window to use, and nothing happens. Also can you write
executable code from the edit window. I can't see to get code that I writ
On Nov 8, 2:50 pm, exar...@twistedmatrix.com wrote:
> I'm curious how this visualization works, since earlier you said
> something to the affect that there were no shared resources. If you
> kill a thread and it had opened a window and was drawing on it, with
> most toolkits, you'll end up with a
This question is for any python-twitter developer
while I don't use python-twitter, I do use Andrew Price's Twyt
for my python+twitter scripting (I started to type
"python+twitter scripting needs", but "needs" is S not
the right word for anything regarding twitter).
import twitter
Hi again,
I put a copy of the message and the tarball of the code here (because
of the problem of line breaks):
http://python-advocacy.wikidot.com/comp-lang-python-question
Thanks!
Marko
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 8, 2:42 pm, Mick Krippendorf wrote:
> Wells wrote:
> > I'm not quite understanding why a tuple is hashable but a list is not.
>
> The short answer has already been given. Here is the long answer:
>
> For objects p and q, p==q implies hash(p)==hash(q). It is essential for
> dicts and sets th
This question is for any python-twitter developer
I want to develop an application using python twitter .
Just look at the code...
import twitter
api = twitter.Api();
sta = api.GetUserTimeline('ShashiTharoor')
i = 0
for s in sta:
i +=1
print str(i) + " " + s.text
print
print
Hi,
Could you please give me some advice on the piece of code I am
writing?
My system has several possible outputs, some of them are not always
needed. I started to get confused with the code flow conditions needed
to avoid doing unnecessary work. So I am trying to restructure it
using lazy evalu
On 11/7/2009 5:18 PM Carl Banks said...
I think the top one is O(N log N), and I'm suspicious that it's even
possible to grow a list in less than O(N log N) time without knowing
the final size in advance. Citation?
Quoting Tim --
Python uses mildly exponential over-allocation, sufficient so
New bie Question:
in "Zen of Python" - what exactly does the last one mean ? -
Namespaces are one honking great idea -- let's do more of those!
I mean why the emphasis ? Is it like saying "put modules into
packages" in other programming paradigm s ?
thanks
--
http://mail.python.org/mailman/list
Wells wrote:
> I'm not quite understanding why a tuple is hashable but a list is not.
The short answer has already been given. Here is the long answer:
For objects p and q, p==q implies hash(p)==hash(q). It is essential for
dicts and sets that objects used as keys/elements uphold this law, and
al
In article <4af71b7e$0$1645$742ec...@news.sonic.net>,
John Nagle wrote:
> I have an application running with pyserial talking to a USB to serial
> converter on a Linux EeePC 2G Surf. This works. Until the lid on the PC is
> closed and the device suspends.
>
> The application has /dev/t
Someone Something wrote:
> I have a irc spam bot (only testing on my channel :P ) whose main loop is
> the following:
Poor choice of words on your part. Anything spam-related is evil and
will not get a response.
That said, "IRC bots" are certainly okay and common, and are useful
tools. Some are
I am having problems with indentation some times. When I hit the enter key
after if statements or while statemt there are times when the indentation is
too much and other times too little.
Which editor are you using? On which operating system? Check
for settings regarding spaces-per-tab, whet
Alf P. Steinbach wrote:
* Hrvoje Niksic:
"Alf P. Steinbach" writes:
* Hrvoje Niksic:
"Alf P. Steinbach" writes:
Speedup would likely be more realistic with normal implementation (not
fiddling with bit-fields and stuff)
I'm not sure I understand this. How would you implement tagged
integ
vsoler schreef:
Instead of subsets, do you mean permutations/combinations? Since 2
invoices can have the same amount perhaps the terms permutation is
better.
As some other poster already suggested 'powerset' (
http://en.wikipedia.org/wiki/Power_set ) may be a better name, except
for those
On Nov 1, 6:27 am, Francesco Bochicchio wrote:
> On Nov 1, 4:06 am, Shue Boks wrote:
>
>
>
> > I tried to compile Python and Tcl/Tk on Linux using the following
> > files:
>
> > Python-3.1.1.tar.gz
> > tcl8.5.7-src.tar.gz
>
> > Cannot get tkinter to work after compiling & installing Tcl/Tk. I ge
Dan Bishop schreef:
You can avoid the S list my making it a generator:
def subsets(L):
if L:
for s in subsets(L[1:]):
yield s
yield s + [L[0]]
else:
yield []
Nice one. Thanks!
Ozz
--
http://mail.python.org/mailman/listinfo/python-list
John Nagle animats.com> writes:
>
> I'd argue against general thread cancellation. Inter-thread
> signals, though, have safety problems no worse than the first-thread
> only signals we have now. You're allowed to raise an exception
> in a signal handler, which is effectively thread cancella
I have an application running with pyserial talking to a USB to serial
converter on a Linux EeePC 2G Surf. This works. Until the lid on the PC is
closed and the device suspends.
The application has /dev/ttyUSB0 open, and has a read pending
with a 1 second timeout. When the device comes
I am having problems with indentation some times. When I hit the enter key
after if statements or while statemt there are times when the indentation is
too much and other times too little. When I try to manually make sure the
indentation is correct and try to print, I ge the error message of invali
Wells wrote:
I'm not quite understanding why a tuple is hashable but a list is not.
Any pointers? Thanks!
A hash is created from the object. If the object is mutable then the
hash can change. Lists are mutable but tuples aren't.
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 8 Nov 2009, Wells wrote:
I'm not quite understanding why a tuple is hashable but a list is not.
Any pointers? Thanks!
The keys of a dict have to be immutable. Lists are mutable, tuples are
not.
\t
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, Nov 8, 2009 at 11:15 AM, Wells wrote:
> I'm not quite understanding why a tuple is hashable but a list is not.
> Any pointers? Thanks!
tuple is hashable because it is immutable whereas a list is mutable.
--
http://mail.python.org/mailman/listinfo/python-list
Antoine Pitrou wrote:
Le Sun, 08 Nov 2009 04:40:26 -0800, sven a écrit :
I really don't get that. If the reason would be that it is too much
work to
implement, then I could accept it.
It would probably be a lot of work and even then it would still be unsafe.
Read for example:
http://msdn.mic
I'm not quite understanding why a tuple is hashable but a list is not.
Any pointers? Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, Nov 8, 2009 at 11:57 AM, stephen_b
wrote:
> I have python 2.6 on OS X 10.5.8:
>
> $ python --version
> Python 2.6.2
>
> $ which python
> /Library/Frameworks/Python.framework/Versions/2.6/bin/python
>
> When installing an egg, python 2.5 shows up:
>
> """
> $ sudo easy_install ipython-0.10
On Sun, Nov 8, 2009 at 12:01 PM, NGABONZIZA PROSPER
wrote:
> Hi all;
>
>
> Help!
>
> Could you Tell me where I may find documentation on Solving
> Differential equations with Scipy or Numpy.
>
>
>
> Thank you all
> --
> http://mail.python.org/mailman/listinfo/python-list
>
http://lmgtfy.com/?q=
[r...@13gems angrynates.com]# chcon -R -h
unconfined_u:object_r:httpd_sys_content_t global_solutions/*
Then I surfed to
http://209.216.9.56/global_solutions/index.py
[r...@13gems angrynates.com]# tail /var/log/messages
Nov 8 04:26:02 13gems syslogd 1.4.1: restart.
[r...@13gems angrynates.com]# t
On Sun, Nov 8, 2009 at 12:31 PM, geremy condra wrote:
> On Sun, Nov 8, 2009 at 11:52 AM, Dan Bishop wrote:
>> On Nov 8, 4:43 am, Ozz wrote:
>>> Hi,
>>>
>>> > My first question is:
>>> > 1. given a list of invoives I=[500, 400, 450, 200, 600, 700] and a
>>> > check Ch=600
>>> > how can I print al
On Sun, Nov 8, 2009 at 11:52 AM, Dan Bishop wrote:
> On Nov 8, 4:43 am, Ozz wrote:
>> Hi,
>>
>> > My first question is:
>> > 1. given a list of invoives I=[500, 400, 450, 200, 600, 700] and a
>> > check Ch=600
>> > how can I print all the different combinations of invoices that the
>> > check is
On Sunday 08 November 2009 05:44:31 Victor Subervi wrote:
> [r...@13gems angrynates.com]# chcon -u unconfined_u -r object_r -t
> httpd_sys_content_t global_solutions
> chcon: can't apply partial context to unlabeled file global_solutions
> Please advise.
Try 'chcon -R -h unconfined_u:object_r:http
Ozz wrote:
Hi,
My first question is:
1. given a list of invoives I=[500, 400, 450, 200, 600, 700] and a
check Ch=600
how can I print all the different combinations of invoices that the
check is possibly cancelling
Incidentally, I'm currently learning python myself, and was working on
more
On Nov 8, 1:27 pm, Ozz wrote:
> Robert P. J. Day schreef:
>
> > does your solution allow for the possibility of different invoices
> > of equal amounts? i would be reluctant to use the word "subset" in a
> > context where you can have more than one element with the same value.
>
> I think it ha
stephen_b schrieb:
I have python 2.6 on OS X 10.5.8:
$ python --version
Python 2.6.2
$ which python
/Library/Frameworks/Python.framework/Versions/2.6/bin/python
When installing an egg, python 2.5 shows up:
"""
$ sudo easy_install ipython-0.10-py2.6.egg
Password:
Processing ipython-0.10-py2.6
Hi all;
Help!
Could you Tell me where I may find documentation on Solving
Differential equations with Scipy or Numpy.
Thank you all
--
http://mail.python.org/mailman/listinfo/python-list
I have python 2.6 on OS X 10.5.8:
$ python --version
Python 2.6.2
$ which python
/Library/Frameworks/Python.framework/Versions/2.6/bin/python
When installing an egg, python 2.5 shows up:
"""
$ sudo easy_install ipython-0.10-py2.6.egg
Password:
Processing ipython-0.10-py2.6.egg
removing '/Libra
On Nov 8, 4:43 am, Ozz wrote:
> Hi,
>
> > My first question is:
> > 1. given a list of invoives I=[500, 400, 450, 200, 600, 700] and a
> > check Ch=600
> > how can I print all the different combinations of invoices that the
> > check is possibly cancelling
>
> Incidentally, I'm currently learning
SOLVED. For some reason a "zope" directory were inside my
site-packages folder, so the zope.interface egg was not visible...
On Sun, Nov 8, 2009 at 4:57 PM, Luca Fabbri wrote:
> Hi all.
>
> I've recently updated my system to the last Kubuntu 9.10.
>
> On my system I use:
> python2.6 (default syst
On Nov 8, 8:56�am, Rob Briggs wrote:
> Hello,
>
> Is there a way to do a repeat formatting command like in Fortran? Rather
> that doing this:
>
> print "%s %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f" %
> (parmName[i], tmp[i][1], tmp[i][2], tmp[i][4], �tmp[i][6], �tmp[i][7],
> tmp[i][8], �tmp
Hi all.
I've recently updated my system to the last Kubuntu 9.10.
On my system I use:
python2.6 (default system python)
python 2.4 (needed for the Zope application server)
Also I have 2 easy_install script for installing my eggs.
The default one for python2.6 works normally, but I've some probl
Hi group,
I've released a tool for creating HTML pages or Web sites by writing
them in Python - PySiteCreator v0.1.
Description of PySiteCreator:
PySiteCreator is a tool that allows the user to create Web (HTML)
sites by writing them entirely in Python. A user creates one or more
Python source f
Hello,
Is there a way to do a repeat formatting command like in Fortran? Rather
that doing this:
print "%s %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f" %
(parmName[i], tmp[i][1], tmp[i][2], tmp[i][4], tmp[i][6], tmp[i][7],
tmp[i][8], tmp[i][9])
Something like this:
print "%s 7%-5.3f %
In Luis Alberto Zarrabeitia
Gomez writes:
>¿Have you ever tried to read list/matrix that you know it is not sparse, but
>you
jdon't know the size, and it may not be in order? A "grow-able" array would just
>be the right thing to use - currently I have to settle with either hacking
>together my
Le Sun, 08 Nov 2009 04:40:26 -0800, sven a écrit :
>
> I really don't get that. If the reason would be that it is too much
> work to
> implement, then I could accept it.
It would probably be a lot of work and even then it would still be unsafe.
Read for example:
http://msdn.microsoft.com/en-us/
On 12:40 pm, s...@uni-hd.de wrote:
On Nov 8, 4:27�am, Carl Banks wrote:
It doesn't sound like the thread is communicating with the process
much. �Therefore:
There is quite a bit of communication -- the computation results are
visulized while they are generated.
I'm curious how this visualiz
Thomas wrote:
> Just a curiosity, why does Python do this?
>
[(base, int('1e7', base=base)) for base in range(15,37)]
> [(15, 442), (16, 487), (17, 534), (18, 583), (19, 634), (20, 687),
> (21, 742), (22, 799), (23, 858), (24, 919), (25, 982), (26, 1047),
> (27, 1114), (28, 1183), (29, 1254),
On Nov 6, 8:46 pm, gil_johnson wrote:
> I don't have the code with me, but for huge arrays, I have used
> something like:
>
> >>> arr[0] = initializer
> >>> for i in range N:
> >>> arr.extend(arr)
>
> This doubles the array every time through the loop, and you can add
> the powers of 2 to ge
On Nov 6, 8:46 pm, gil_johnson wrote:
> >>> arr[0] = initializer
> >>> for i in range N:
> >>> arr.extend(arr)
>
> This doubles the array every time through the loop, and you can add
> the powers of 2 to get the desired result.
> Gil
To all who asked about my previous post,
I'm sorry I pos
Just a curiosity, why does Python do this?
>>> l = [(base, int('1e7', base=base)) for base in range(15,37)]
>>> l
[(15, 442), (16, 487), (17, 534), (18, 583), (19, 634), (20, 687),
(21, 742), (22, 799), (23, 858), (24, 919), (25, 982), (26, 1047),
(27, 1114), (28, 1183), (29, 1254), (30, 1327), (3
On Nov 8, 4:27 am, Carl Banks wrote:
> It doesn't sound like the thread is communicating with the process
> much. Therefore:
There is quite a bit of communication -- the computation results are
visulized while they are generated.
> 1. Run the C code in a separate process, or
> 2. Create the thr
Robert P. J. Day schreef:
does your solution allow for the possibility of different invoices
of equal amounts? i would be reluctant to use the word "subset" in a
context where you can have more than one element with the same value.
I think it handles different invoices of equal amounts corre
Oops,
For listing all different subsets of a list (This is what I came up
with. Can it be implemented shorter, btw?):
def subsets(L):
S = []
if (len(L) == 1):
return [L, []]
better to check for the empty set too, thus;
if (len(L) == 0):
retur
On Sun, 8 Nov 2009, Ozz wrote:
>
> Hi,
>
> > My first question is:
> > 1. given a list of invoives I=[500, 400, 450, 200, 600, 700] and a
> > check Ch=600
> > how can I print all the different combinations of invoices that the
> > check is possibly cancelling
>
> Incidentally, I'm currently learni
balavignesh writes:
> Whats the wrong in my code?
Without seeing your code, all we could do is guess, poorly.
Far better would be if you can construct a very small example, one that
you post here so any reader here could run it, that demonstrates the
behaviour you want explained. Don't forget t
On Saturday 07 November 2009 23:59:23 Victor Subervi wrote:
> restorecon didn't change ls -lZ output
Did the suggested changes to the Apache configuration help at all?
> Can you give me the exact command for chcon? It complains there are too few
> arguments, and I couldn't figure it out.
For chc
Hi,
My first question is:
1. given a list of invoives I=[500, 400, 450, 200, 600, 700] and a
check Ch=600
how can I print all the different combinations of invoices that the
check is possibly cancelling
Incidentally, I'm currently learning python myself, and was working on
more or less the
Hello friends,
I am using pyWPS + GRASS to generate the maps for the given
request XML.
As my requestxml contains scandinavian letters , i got the following
error,
" 'ascii' codec can't encode character u'\xe4' in position
4: ordinal not in range(128)"
The Request xml
* Hrvoje Niksic:
"Alf P. Steinbach" writes:
* Hrvoje Niksic:
"Alf P. Steinbach" writes:
Speedup would likely be more realistic with normal implementation (not
fiddling with bit-fields and stuff)
I'm not sure I understand this. How would you implement tagged integers
without encoding type
"Alf P. Steinbach" writes:
> * Hrvoje Niksic:
>> "Alf P. Steinbach" writes:
>>
>>> Speedup would likely be more realistic with normal implementation (not
>>> fiddling with bit-fields and stuff)
>>
>> I'm not sure I understand this. How would you implement tagged integers
>> without encoding typ
Gary Herron schreef:
> Mensanator wrote:
>> On Nov 7, 7:17 pm, Peng Yu wrote:
>>
>>> It seems that int() does not convert '1e7'.
>>>
>> Because 'e' isn't a valid character in base 10.
>>
>
> But 1e7 is a valid float, so this works:
>
> >>> int(float('1e7'))
> 1000
>
> That has a
restorecon didn't change ls -lZ output
Can you give me the exact command for chcon? It complains there are too few
arguments, and I couldn't figure it out.
Does this really matter? I moved the selinux folder and its contents as well
as sent an "echo 0>..." command to kill it. Furthermore,
[r...@13g
71 matches
Mail list logo