On Jun 10, 1:52 am, Steven D'Aprano
wrote:
> On Tue, 09 Jun 2009 22:21:26 -0700, John Yeung wrote:
> > Therefore, to me the most up-to-date docs (which say
> > that uniform(a, b) returns a float in the closed
> > interval [a, b]) is closer to correct than before,
> > but still fails to point out t
504cr...@gmail.com wrote:
> By what method would a string be inserted at each instance of a RegEx
> match?
>
> For example:
>
> string = '123 abc 456 def 789 ghi'
> newstring = ' INSERT 123 abc INSERT 456 def INSERT 789 ghi'
Have a look at re.sub():
>>> s = '123 abc 456 def 789 ghi'
>>> re.com
On Jun 9, 11:58 pm, William Clifford
wrote:
> I've become interested in basic graphs and networks and I'm wondering
> about what algorithms are there for generating basic regular graphs
> like the simplex graph or dodecahedron graph, etc (I'm sure there are
> many). I'm particularly keen on unders
On Jun 9, 11:28�pm, Steven D'Aprano
wrote:
> On Tue, 09 Jun 2009 21:04:49 -0700, Mensanator wrote:
> > On Jun 9, 8:28 pm, John Yeung wrote:
> >> On Jun 9, 8:45 pm, Mensanator wrote:
>
> >> > On Jun 9, 6:05 pm, "Gabriel Genellina"
> >> > wrote:
> >> > > py> a+(b-a)*z < b # the expression used fo
Steven D'Aprano wrote:
On Tue, 09 Jun 2009 18:28:23 -0700, John Yeung wrote:
The docs are now... sort of correct. For some values of a and b,
uniform() can never return b. Notably, I believe uniform(0, 1) is
equivalent to random(), and will never return 1. However, uniform(1, 2)
CAN retur
On Tue, 09 Jun 2009 22:21:26 -0700, John Yeung wrote:
> On Jun 9, 11:24 pm, Steven D'Aprano
> wrote:
>> On Tue, 09 Jun 2009 18:28:23 -0700, John Yeung wrote:
>> > The docs are now... sort of correct. For some values of a and b,
>> > uniform() can never return b. Notably, I believe uniform(0, 1)
On Jun 10, 12:01 am, alex23 wrote:
> On Jun 10, 11:32 am, John Yeung wrote:
>
> > On Jun 9, 8:39 pm, Paul McGuire wrote:
> > > Are you trying to generate a number in the
> > > range [0,n] by multiplying a random function that
> > > returns [0,1] * n? If so, then you want to do
> > > this using:
On Jun 9, 11:24 pm, Steven D'Aprano
wrote:
> On Tue, 09 Jun 2009 18:28:23 -0700, John Yeung wrote:
> > The docs are now... sort of correct. For some values of a and b,
> > uniform() can never return b. Notably, I believe uniform(0, 1) is
> > equivalent to random(), and will never return 1. Howe
On Jun 9, 11:35 pm, "504cr...@gmail.com" <504cr...@gmail.com> wrote:
> On Jun 9, 11:19 pm, Roy Smith wrote:
>
>
>
> > In article
> > ,
>
> > "504cr...@gmail.com" <504cr...@gmail.com> wrote:
> > > By what method would a string be inserted at each instance of a RegEx
> > > match?
>
> > > For exampl
On Tue, 9 Jun 2009 21:33:56 -0700 (PDT), rh0dium
wrote:
>> Having multiple paths or multiple .PTH files isn't a
>> problem for python.
> ..
> We use it for our dev tree before we roll to production. Once dev is
> QA'd then we (integrate) those changes to main and release.
Makes sense...
:-)
On Jun 9, 11:19 pm, Roy Smith wrote:
> In article
> ,
>
> "504cr...@gmail.com" <504cr...@gmail.com> wrote:
> > By what method would a string be inserted at each instance of a RegEx
> > match?
>
> > For example:
>
> > string = '123 abc 456 def 789 ghi'
> > newstring = ' INSERT 123 abc INSERT 456 d
On Jun 9, 4:58 pm, David Lyon wrote:
> On Tue, 9 Jun 2009 16:30:06 -0700 (PDT), rh0dium
> wrote:
>
> >> > Apparently there is a problem with the if statement???
>
> >> > Thanks
>
> > No for .pth files this needs to be on a single line..
>
> I can't really see why you need conditional code...
>
>
On Jun 9, 9:19 pm, alex23 wrote:
> On Jun 10, 8:00 am, rh0dium wrote:
>
> > Apparently there is a problem with the if statement???
>
> Try restructuring the if as a ternary condition:
>
> import os, site; smsc = os.environ.get("TECHROOT", "/home/tech"); smsc
> = smsc if os.path.isdir(smsc) else "
On Tue, 09 Jun 2009 21:04:49 -0700, Mensanator wrote:
> On Jun 9, 8:28�pm, John Yeung wrote:
>> On Jun 9, 8:45�pm, Mensanator wrote:
>>
>> > On Jun 9, 6:05�pm, "Gabriel Genellina"
>> > wrote:
>> > > py> a+(b-a)*z < b # the expression used for uniform(a,b) False
>> > > py> a+(b-a)*z
>> > > 11.0
Here is part of the specification of an algorithm I'm implementing that
shows the reason for my original query:
vid = w * vid + c1 * rand( ) * ( pid – xid ) + c2 * Rand( ) * (pgd –xid ) (1a)
xid = xid + vid (1b)
where c1 and c2 are two positive constants,
rand() and Rand() are two random functi
On Jun 10, 8:00 am, rh0dium wrote:
> Apparently there is a problem with the if statement???
Try restructuring the if as a ternary condition:
import os, site; smsc = os.environ.get("TECHROOT", "/home/tech"); smsc
= smsc if os.path.isdir(smsc) else "/home/tech"; site.addsitedir
(os.path.join(smsc,
In article
,
"504cr...@gmail.com" <504cr...@gmail.com> wrote:
> By what method would a string be inserted at each instance of a RegEx
> match?
>
> For example:
>
> string = '123 abc 456 def 789 ghi'
> newstring = ' INSERT 123 abc INSERT 456 def INSERT 789 ghi'
If you want to do what I think y
On Tue, 09 Jun 2009 20:58:54 -0700, William Clifford wrote:
> I've become interested in basic graphs and networks and I'm wondering
> about what algorithms are there for generating basic regular graphs like
> the simplex graph or dodecahedron graph, etc (I'm sure there are many).
> I'm particularl
By what method would a string be inserted at each instance of a RegEx
match?
For example:
string = '123 abc 456 def 789 ghi'
newstring = ' INSERT 123 abc INSERT 456 def INSERT 789 ghi'
Here's the code I started with:
>>> rePatt = re.compile('\d+\s')
>>> iterator = rePatt.finditer(string)
>>> co
On Jun 10, 1:40 am, Ben Charrow wrote:
> If you're looking to debug your program, try "import pdb"
Another option, if you wish to debug an error, is to run python using
the -i parameter. This will leave you inside the interpreter at the
point that execution stops. Very handy.
- alex23
--
http:/
On Jun 9, 4:33 pm, Esmail wrote:
> Hi,
>
> random.random() will generate a random value in the range [0, 1).
>
> Is there an easy way to generate random values in the range [0, 1]?
> I.e., including 1?
You could do random.uniform(0, 1.0002). Due to floating-
point rounding, there are
On Jun 9, 8:28�pm, John Yeung wrote:
> On Jun 9, 8:45�pm, Mensanator wrote:
>
> > On Jun 9, 6:05�pm, "Gabriel Genellina" wrote:
> > > py> a+(b-a)*z < b # the expression used for uniform(a,b)
> > > False
> > > py> a+(b-a)*z
> > > 11.0
>
> > What you do with the number after it's created is not
>
William Clifford writes:
> I've become interested in basic graphs and networks and I'm wondering
> about what algorithms are there for generating basic regular graphs
> like the simplex graph or dodecahedron graph, etc (I'm sure there are
> many). I'm particularly keen on understanding the very b
On Jun 10, 11:32 am, John Yeung wrote:
> On Jun 9, 8:39 pm, Paul McGuire wrote:
> > Are you trying to generate a number in the
> > range [0,n] by multiplying a random function that
> > returns [0,1] * n? If so, then you want to do
> > this using: int(random.random()*(n+1)) This will
> > give eq
I've become interested in basic graphs and networks and I'm wondering
about what algorithms are there for generating basic regular graphs
like the simplex graph or dodecahedron graph, etc (I'm sure there are
many). I'm particularly keen on understanding the very basic functions
for determining edge
On Tue, 09 Jun 2009 18:28:23 -0700, John Yeung wrote:
> The docs are now... sort of correct. For some values of a and b,
> uniform() can never return b. Notably, I believe uniform(0, 1) is
> equivalent to random(), and will never return 1. However, uniform(1, 2)
> CAN return 2, if this is any i
Jon Harrop wrote:
Arved Sandstrom wrote:
Jon Harrop wrote:
Arved Sandstrom wrote:
Lew wrote:
Interesting distinction. Would it be fair to compare concurrent
programming to the bricks used to build the parallel program's edifice?
Way too much of a fine distinction. While they are in fact dif
On Jun 10, 7:41 am, "Gabriel Genellina"
wrote:
> En Mon, 08 Jun 2009 22:15:22 -0300, BigHand escribió:
>
> > I have an embedded python application. which is a MFC app with
> > Python interpreter embedded.
>
> > In the App, I have a separate thread to execute a Python script
> > (using the
thanks for your reply!
"Lie Ryan" $y61.12...@news-server.bigpond.net.au...
myopc wrote:
hi, all
I am ruuning a c++ program (boost python) , which create many python
interpreaters and each run a python script with use multi-thread
(threading).
when the c++ main program exit, I want to shut dow
On Jun 9, 8:39 pm, Paul McGuire wrote:
> Are you trying to generate a number in the
> range [0,n] by multiplying a random function that
> returns [0,1] * n? If so, then you want to do
> this using: int(random.random()*(n+1)) This will
> give equal chance of getting any number from 0 to n.
Bette
On Jun 9, 8:45 pm, Mensanator wrote:
> On Jun 9, 6:05 pm, "Gabriel Genellina" wrote:
> > py> a+(b-a)*z < b # the expression used for uniform(a,b)
> > False
> > py> a+(b-a)*z
> > 11.0
>
> What you do with the number after it's created is not
> random's concern.
Mensanator, you missed Gabriel's po
I used paster to create a project named pitz. I'm writing a bunch of
user documentation. Where should I put it?
The project looks a little like this:
/home/matt/projects/pitz
setup.py
pitz/
__init__.py # has my project code
docs/ # has my reST files
On Jun 9, 6:05 pm, "Gabriel Genellina" wrote:
> En Tue, 09 Jun 2009 18:33:39 -0300, Esmail escribió:
>
> > random.random() will generate a random value in the range [0, 1).
>
> > Is there an easy way to generate random values in the range [0, 1]?
> > I.e., including 1?
>
> I think you shouldn't w
On Jun 9, 4:33 pm, Esmail wrote:
> Hi,
>
> random.random() will generate a random value in the range [0, 1).
>
> Is there an easy way to generate random values in the range [0, 1]?
> I.e., including 1?
>
Are you trying to generate a number in the range [0,n] by multiplying
a random function that
On Jun 9, 6:12 pm, Robert Kern wrote:
> On 2009-06-09 18:05, Mensanator wrote:
>
>
>
>
>
> > On Jun 9, 4:33 pm, Esmail wrote:
> >> Hi,
>
> >> random.random() will generate a random value in the range [0, 1).
>
> >> Is there an easy way to generate random values in the range [0, 1]?
> >> I.e., inc
On Tue, 9 Jun 2009 16:30:06 -0700 (PDT), rh0dium
wrote:
>> > Apparently there is a problem with the if statement???
>>
>> > Thanks
>
> No for .pth files this needs to be on a single line..
I can't really see why you need conditional code...
If you want to add more locations...
Simply create a
Miles Kaufmann wrote:
I'm curious what algorithm calls for random numbers on a closed interval.
I'm implementing a Particle Swarm Optimizer. Depending on what paper you
read you'll see mention of required random values "between 0 and 1"
which is somewhat ambiguous. I came across one paper that
Robert Kern wrote:
On 2009-06-09 18:05, Mensanator wrote:
On Jun 9, 4:33 pm, Esmail wrote:
That's wrong. Where did you get it?
http://docs.python.org/library/random
What he said :-)
(thanks Robert)
--
http://mail.python.org/mailman/listinfo/python-list
Gabriel Genellina wrote:
En Tue, 09 Jun 2009 18:33:39 -0300, Esmail escribió:
random.random() will generate a random value in the range [0, 1).
Is there an easy way to generate random values in the range [0, 1]?
I.e., including 1?
I think you shouldn't worry about that - the difference may
On Tue, 09 Jun 2009 04:57:48 -0700, samwyse wrote:
> Time to test things! I'm going to compare three things using Python
> 3.0:
> X={...}\nS=lambda x: x in X
> S=lambda x: x in {...}
> S=lambda x: x in (...)
> where the ... is replaced by lists of integers of various lengths.
> Here's the
En Mon, 08 Jun 2009 22:15:22 -0300, BigHand escribió:
I have an embedded python application. which is a MFC app with
Python interpreter embedded.
In the App, I have a separate thread to execute a Python script
(using the PyRun_File), but if the user want to stop the executing
script, ho
On Jun 9, 3:28 pm, Emile van Sebille wrote:
> On 6/9/2009 3:00 PM rh0dium said...
>
>
>
>
>
> > I have a .pth file which has some logic in it - but it isn't quite
> > enough...
>
> > It started with this..
> > import os, site; site.addsitedir(os.path.join(os.environ["TECHROOT"],
> > "tools/python/
On Jun 9, 2009, at 7:05 PM, Mensanator wrote:
On Jun 9, 4:33 pm, Esmail wrote:
Hi,
random.random() will generate a random value in the range [0, 1).
Is there an easy way to generate random values in the range [0, 1]?
I.e., including 1?
I am implementing an algorithm and want to stay as true
On 2009-06-09 18:05, Mensanator wrote:
On Jun 9, 4:33 pm, Esmail wrote:
Hi,
random.random() will generate a random value in the range [0, 1).
Is there an easy way to generate random values in the range [0, 1]?
I.e., including 1?
I am implementing an algorithm and want to stay as true to the
On Jun 9, 4:33 pm, Esmail wrote:
> Hi,
>
> random.random() will generate a random value in the range [0, 1).
>
> Is there an easy way to generate random values in the range [0, 1]?
> I.e., including 1?
>
> I am implementing an algorithm and want to stay as true to the
> original design specificati
En Tue, 09 Jun 2009 18:33:39 -0300, Esmail escribió:
random.random() will generate a random value in the range [0, 1).
Is there an easy way to generate random values in the range [0, 1]?
I.e., including 1?
I think you shouldn't worry about that - the difference may be as small as
2**-53, o
On 6/9/2009 3:00 PM rh0dium said...
I have a .pth file which has some logic in it - but it isn't quite
enough...
It started with this..
import os, site; site.addsitedir(os.path.join(os.environ["TECHROOT"],
"tools/python/modules"))
But that eventually evolved into..
import os, site; site.addsite
On 2009-06-09 17:06, Carl Banks wrote:
On Jun 9, 12:42 pm, Terry Reedy wrote:
Hendrik van Rooyen wrote:
I should have known - you use a string method to get a list of words,
but you have to go to the list to get a list of characters from a string.
That is symmetry.
There is no string method
On 2009-06-09 16:34, Terry Reedy wrote:
Robert Kern wrote:
On 2009-06-09 14:43, Terry Reedy wrote:
jon vs. python wrote:
Python and the stdlib is all open source. If he were to submit a patch,
and it were ignored or rejected for whatever reason, he could still
release it and register it on P
On Jun 9, 12:42 pm, Terry Reedy wrote:
> Hendrik van Rooyen wrote:
> > I should have known - you use a string method to get a list of words,
> > but you have to go to the list to get a list of characters from a string.
>
> That is symmetry.
>
> > There is no string method to do it, which is what I
I have a .pth file which has some logic in it - but it isn't quite
enough...
It started with this..
import os, site; site.addsitedir(os.path.join(os.environ["TECHROOT"],
"tools/python/modules"))
But that eventually evolved into..
import os, site; site.addsitedir(os.path.join(os.environ.get
("TECH
On 6/9/2009 11:59 AM Jon Harrop said...
toby wrote:
On Jun 7, 2:41 pm, Jon Harrop wrote:
No. Most programmers still care about performance
Frequently when they shouldn't.
I disagree. A lot of software is still far too slow because the programmers
failed to pay attention to performance.
Robert Kern wrote:
On 2009-06-09 14:43, Terry Reedy wrote:
jon vs. python wrote:
Python and the stdlib is all open source. If he were to submit a patch,
and it were ignored or rejected for whatever reason, he could still
release it and register it on PyPI. I just checked and NONE of the 6710
Hi,
random.random() will generate a random value in the range [0, 1).
Is there an easy way to generate random values in the range [0, 1]?
I.e., including 1?
I am implementing an algorithm and want to stay as true to the
original design specifications as possible though I suppose the
difference
Erlang uses quite a bit of mutable state behind the scenes ... the
programmers just don't see it.
George
Heh... "The CPUs use quite a bit of mutable state behind the scenes ...
the programmers just don't see it."
Actually with CPU they see it more, than... say Erlang (that's why you
need to
Thanks John,
I didn't realize that the quotes were supposed to surround the entire
field. I ended up making a quick script to replace comma's outside
quotes with tabs. I was just trying to clean this crazy "csv" file to
import into msyql.
thanks again,
bret
--
http://mail.python.org/mailman/l
Bret wrote:
i have a csv file like so:
row1,field1,[field2][text in field2 "quote, quote"],field3,field
row2,field1,[field2]text in field2 "quote, quote",field3,field
using csv.reader to read the file, the first row is broken into two
fields:
[field2][text in field2 "quote
and
quote"
while the
> I'm sure this is a FAQ, but I certainly haven't been able
> to find an answer.
>
> Is it possible to set the program name as seen by the
> operating system or lower-level libraries?
>
> I'm connecting to a database, and the runtime helpfully
> sends some information to the server, such as usernam
On 6/9/2009 1:06 PM m...@pixar.com said...
I'm sure this is a FAQ, but I certainly haven't been able
to find an answer.
Is it possible to set the program name as seen by the
operating system or lower-level libraries?
I'm connecting to a database, and the runtime helpfully
sends some information
Bret gmail.com> writes:
>
> i have a csv file like so:
> row1,field1,[field2][text in field2 "quote, quote"],field3,field
> row2,field1,[field2]text in field2 "quote, quote",field3,field
>
> using csv.reader to read the file, the first row is broken into two
> fields:
> [field2][text in field2
Miles Kaufmann wrote:
On Jun 9, 2009, at 6:05 AM, Diez B. Roggisch wrote:
Also as list-comps are going away and are replaced by
list()
Where did you hear that?
Perhaps in the discussion of possible changes for 3.0 about 18 months
ago. The idea was rejected because set/list/dict(genexp) i
On 2009-06-09 14:43, Terry Reedy wrote:
jon vs. python wrote:
Sorry, I didn't realize that you already proposed list comprehension.
There is some kind of asymmetry in several areas.I guess that's
somehow related to this post: http://www.zedshaw.com/blog/2009-05-29.html
The premise of this po
On Tue, 9 Jun 2009 10:47:11 -0700 (PDT), toby
wrote:
>On Jun 7, 2:41 pm, Jon Harrop wrote:
>> Arved Sandstrom wrote:
>> > Jon Harrop wrote:
>>
>> performance means mutable state.
>
>Hm, not sure Erlangers would wholly agree.
Erlang uses quite a bit of mutable state behind the scenes ... the
pro
I'm sure this is a FAQ, but I certainly haven't been able
to find an answer.
Is it possible to set the program name as seen by the
operating system or lower-level libraries?
I'm connecting to a database, and the runtime helpfully
sends some information to the server, such as username,
pid, and pr
jon vs. python wrote:
Sorry, I didn't realize that you already proposed list comprehension.
There is some kind of asymmetry in several areas.I guess that's
somehow related to this post:
http://www.zedshaw.com/blog/2009-05-29.html
The premise of this post by Zed the Insightful is that Python
Hendrik van Rooyen wrote:
I should have known - you use a string method to get a list of words,
but you have to go to the list to get a list of characters from a string.
That is symmetry.
There is no string method to do it, which is what I am complaining
about.
That would be asymmetry.
> That works for me. There isn't an "InterruptedSystemCall" error or
> equivalent in the standard exception hierarchy. EnvironmentError is
> the parent of OSError & IOError, which is where you'll most likely be
> encountering that state.
Thanks!
--Steve
--
http://mail.python.org/mailman/listinf
On 2009-06-09 03:49, Jean-Michel Pichavant wrote:
I was wondering if there is a way to start an interactive shell within a
script/application.
I'm sometimes tired of adding prints to scan the current namespace so
I'd like to pause the execution and give the user the shell prompt.
This is obviousl
i have a csv file like so:
row1,field1,[field2][text in field2 "quote, quote"],field3,field
row2,field1,[field2]text in field2 "quote, quote",field3,field
using csv.reader to read the file, the first row is broken into two
fields:
[field2][text in field2 "quote
and
quote"
while the second row is
On Jun 9, 2:22 pm, mrstevegross wrote:
> I'm trying to write a try/catch block to handle an "interrupted system
> call". However, I can't seem to locate information on the actual
> typename of the exception. Does anyone know what it would be? I want
> my code to look like this:
>
> try:
> ...
>
mrstevegross wrote:
I'm trying to write a try/catch block to handle an "interrupted system
call". However, I can't seem to locate information on the actual
typename of the exception. Does anyone know what it would be? I want
my code to look like this:
try:
...
except InterruptedSystemCall # wh
> exceptions.EOFError exceptions.ReferenceError exceptions.ZeroDivisionError
>...
> exceptions.NotImplementedError exceptions.UnicodeError exceptions.__str__
Is there a single parent exception to all those? Or should I just
write it as:
try:
...
catch Exception:
...
Thanks,
--Steve
--
http://
On Jun 9, 8:57 am, kretel wrote:
> Hi All,
>
> I am trying to implement the following functionality:
> 1. log messages to the flash drive
> 2. if the flash drive is not available, switch handler to the
> BufferringHandler and log into buffer,
> 3. once the flash drive is plugged in and available s
toby wrote:
> On Jun 7, 2:41 pm, Jon Harrop wrote:
>> Arved Sandstrom wrote:
>> > Jon Harrop wrote:
>> >> I see no problem with mutable shared state.
>>
>> > In which case, Jon, you're in a small minority.
>>
>> No. Most programmers still care about performance
>
> Frequently when they shouldn't.
On Tue, Jun 9, 2009 at 1:52 PM, Ken D'Ambrosio wrote:
> I need to have some non-buffered keyboard interaction with a Python script
> (on Linux).
Assuming you're running your code from a command prompt, something
like this recipe might do the trick:
http://code.activestate.com/recipes/134892/
--
On 2009-06-09, Ken D'Ambrosio wrote:
> I need to have some non-buffered keyboard interaction with a Python script
> (on Linux). Back in the day, I fired up Curses to do this in Perl. Any
> idea if that's still how I have to fly? Or is there a different
> mechanism?
Same as it ever was (in the
hi
im spawning a script that runs for a long from a web app like this:
os.spawnle(os.P_NOWAIT, "../bin/producenotify.py", "producenotify.py",
"xx",os.environ)
the script is spawned and it runs, but till it gets over i am not able to
free the port that is used by the web app, or in other words i
m...@pixar.com wrote:
John Machin wrote:
T=lambda x:x in(25401,25402,25408);import dis;dis.dis(L);dis.dis(T)
I've learned a lot from this thread, but this is the
niftiest bit I've picked up... thanks!
If you are doing a lot of dissing, starting with
from dis import dis
saves subsequent typi
On Jun 9, 2009, at 6:05 AM, Diez B. Roggisch wrote:
Also as list-comps are going away and are replaced by
list()
Where did you hear that?
-Miles
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
James Tauber explains this at
http://jtauber.com/blog/2006/04/15/
python_tuples_are_not_just_constant_lists/>.
He doesn't really explain anything though, he merely states it as
revealed wisdom. The closest he comes to an explanation is to declare
that in tuples "the i
I'm trying to write a try/catch block to handle an "interrupted system
call". However, I can't seem to locate information on the actual
typename of the exception. Does anyone know what it would be? I want
my code to look like this:
try:
...
except InterruptedSystemCall # what's the right name?
> > Anyway there's a TimedRotatingFileHandler handler in the logging package:
> > you can derive from it and change the emit/doRollover pair to hold the
> > records
> > until a device is not ready.
>
> Hm, that might be the way to go. Will have a try.
I had another look at the logging package.
Th
> "Enrico" <4...@755189.45> (E) wrote:
>E> "Piet van Oostrum" ha scritto nel messaggio
>E> news:m2ljo1ajnx@cs.uu.nl...
>>> The method doesn't need the class at all, so a staticmethod would be
>>> preferable:
>>> class Funcoes:
>>> @staticmethod
>>> def CifradorDeCesar(self, mensagem, chav
I need to have some non-buffered keyboard interaction with a Python script
(on Linux). Back in the day, I fired up Curses to do this in Perl. Any
idea if that's still how I have to fly? Or is there a different
mechanism?
Thanks!
-Ken
--
This message has been scanned for viruses and
dangero
R. David Murray wrote:
Well, I for one looked at that long pylint output when I first tried it,
and switched to another tool :)
(pyflakes...but I don't think it does PEP 8)
:-)
Ok, so I'm not the only one who thinks the output is rather lengthy.
I've since dug into the docs and searched on
On Jun 7, 2:41 pm, Jon Harrop wrote:
> Arved Sandstrom wrote:
> > Jon Harrop wrote:
> >> I see no problem with mutable shared state.
>
> > In which case, Jon, you're in a small minority.
>
> No. Most programmers still care about performance
Frequently when they shouldn't.
> and performance means
On Jun 9, 6:10 pm, "A. Cavallo" wrote:
> Hi,
> the problem screams for a separate thread.
I was thinking about that, as mentioned in the first post. Although, I
was wonder if there is another way to tackle the problem.
> Anyway there's a TimedRotatingFileHandler handler in the logging package:
On Tue, Jun 9, 2009 at 8:19 AM, Scott David
Daniels wrote:
> lczancanella wrote:
>>
>> Hi, i am brand new in Python, so sorry if this question is too basic,
>> but i have tried a lot and dont have success... I have the following
>> code...
>>
>> class Funcoes:
>> def CifradorDeCesar(mensagem, ch
Hi,
the problem screams for a separate thread.
Anyway there's a TimedRotatingFileHandler handler in the logging package:
you can derive from it and change the emit/doRollover pair to hold the records
until a device is not ready.
Regards,
Antonio
On Tuesday 09 June 2009 16:57:00 kretel wrote:
Hello,
I have been trying to find an example of how to deal with options that have
spaces in them. I am using jython, which is the same I think as python 2.2.3.
I feebly tried to use optparse and argparse with no success (got gettext,
locale, and optparse). The code is as follows:
try
myopc wrote:
> hi, all
> I am ruuning a c++ program (boost python) , which create many python
> interpreaters and each run a python script with use multi-thread
> (threading).
> when the c++ main program exit, I want to shut down python
> interpreaters, but it crashed. I have googled a lot but can
John Machin wrote:
> T=lambda x:x in(25401,25402,25408);import dis;dis.dis(L);dis.dis(T)
I've learned a lot from this thread, but this is the
niftiest bit I've picked up... thanks!
--
Mark Harrison
Pixar Animation Studios
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 9, 8:20 am, samwyse wrote:
> On Jun 9, 12:30 am, Emile van Sebille wrote:
>
> > On 6/8/2009 8:43 PM Ben Finney said...
> > > The fact that literal set syntax is a relative newcomer is the primary
> > > reason for that, I'd wager.
>
> > Well, no. It really is more, "that's odd... why use s
On Jun 9, 4:57 am, samwyse wrote:
> On Jun 8, 8:57 pm, samwyse wrote:
>
> > I conclude that using constructors is generally a bad idea, since the
> > compiler doesn't know if you're calling the builtin or something with
> > an overloaded name. I presume that the compiler will eventually
> > opti
If you're looking to debug your program, try "import pdb" and then wherever you
want to debug put:
pdb.set_trace()
Your program will then enter the debugger when it executes that line. It's
quite nice really. If you get confused on what to do, just type "help"
http://docs.python.org/library/pd
Hi All,
I am trying to implement the following functionality:
1. log messages to the flash drive
2. if the flash drive is not available, switch handler to the
BufferringHandler and log into buffer,
3. once the flash drive is plugged in and available store the logs
from BufferHandler into that flas
On Jun 9, 10:43 am, Carl Banks wrote:
> You need a % in there, chief.
>
> Carl Banks
You are so right. Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Jun 9, 2009 at 5:38 PM,
stephen_b wrote:
> I'd like to convert a list of floats to a list of strings constrained
> to one .1f format. These don't work. Is there a better way?
>
> [".1f" % i for i in l]
> or
> [(".1f" % i) for i in l]
There's a missing %, this does work...
["%.1f" % i for
On Jun 9, 8:38 am, stephen_b wrote:
> I'd like to convert a list of floats to a list of strings constrained
> to one .1f format. These don't work. Is there a better way?
>
> [".1f" % i for i in l]
> or
> [(".1f" % i) for i in l]
You need a % in there, chief.
[ "%.1f" % x for x in lst ]
BTW, I t
I'd like to convert a list of floats to a list of strings constrained
to one .1f format. These don't work. Is there a better way?
[".1f" % i for i in l]
or
[(".1f" % i) for i in l]
StephenB
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 135 matches
Mail list logo