En Tue, 22 Sep 2009 13:47:09 -0300, Wolodja Wentland
escribió:
On Tue, Sep 22, 2009 at 07:42 -0700, Aahz wrote:
>I want to:
>
>1. Give administrators the freedom to install the data wherever
they
> want
>2. Adhere to the FHS (installing data within modules breaks it)
>3.
On Sep 23, 5:57 pm, exar...@twistedmatrix.com wrote:
> On 06:08 am, jacopo.pe...@gmail.com wrote:
>
> >I am diving into Twisted and Perspective Broker (PB) in particular and
> >I would like to understand more about what happens behind the
> >curtains.
> >Say I have a client and a server on two diff
On Sep 24, 4:14 am, akonsu wrote:
> hello,
>
> SMTPHAndler seems to email every single record separately. is there a
> way to collect all log output and then send it in a single email
> message? or do i have to do it manually?
>
You can use a buffering SMTP handler, see:
http://gist.github.com/1
Hi,
I was trying to capture the video which I was viewing using
Imagegrab module in PIL (windows). But, I found that the video was not
captured at all. A quick googling tells me that it is because the
windows does not have access to the viewing area.
Is there any way I can capture the video?
On Sep 24, 8:37 am, Vinay Sajip wrote:
> On Sep 24, 4:14 am, akonsu wrote:
>
>
> http://python.pinger.pl/m/552751/bufferingsmtphandler
Looking back at it, it looks as if it's adapted from some test code I
wrote back in 2002, see here:
http://opensolaris.org/sc/src/xen-gate/xvm-3.3+xen.hg/tools/
Hello,
I'm a bit of a newbie to python, so this may very well be a basic question:
I have a list of lists, with around 1000 lists looking like this:
['0.000744', '0.480106', 'B'].
I need the average of the first to entries of all the lists, can anybody
help how me to do this?
Thanks in advance
On Thu, 24 Sep 2009 01:30:10 -0700, Evora wrote:
> Hello,
>
> I'm a bit of a newbie to python, so this may very well be a basic
> question:
>
> I have a list of lists, with around 1000 lists looking like this:
> ['0.000744', '0.480106', 'B'].
>
> I need the average of the first to entries of al
On Wed, 23 Sep 2009 18:10:10 -0700, andrew cooke wrote:
> these are valid points, but in practice the main use (for the restricted
> application i care about) is si,ple variables, and this is an "optional
> extra" to help the user, so it's OK if it only works sometimes. at the
> moment i'd be hap
@Martin: Thanks for your great feedback.
So do you think it would be very beneficial for me to start with an
Inman or Kimball book? Or do you think it would be just leisure
reading and not very practical at best - fill my head with needless
jargon and inflexible dogmas, at worst?
I took a datab
In article ,
Nobody wrote:
>On Mon, 07 Sep 2009 23:56:17 +, Albert van der Horst wrote:
>>
>> In view of the above this is not quite the correct way to put it.
>>
>> What I resent is that it leads to a non-professional attitude
>> of the graphical part. Programming is over, lets now kludge
Sorry to ask a simple question but I am a little confused how to
combine the input function and the date time module.
Simply at the start of the program I want to prompt the user to enter
the date, desirably in the format dd/mm/year.
However I want to make sure that python understands the time for
Dear List,
Maybe someone could help out with this mysterious bug..
starting a python program in a directory named "python", makes
the importation of modules sometimes impossible with cryptic
error messages..
sam...@linux-912g:~> mkdir paska2
sam...@linux-912g:~>
sam...@linux-912g:~> echo "import
In article <65e8a017-abcb-49ad-8867-bc473f83e...@s39g2000yqj.googlegroups.com>,
Bearophile wrote:
>Steven D'Aprano:
>
>> (3) Create an inner function, then call that.
>
>Several people after someone gives this anwer.
>
>
>> My personal opinion is that if you really need a local scope
>> inside a
Hello,
I'm a bit of a newbie to python, so this may very well be a basic question:
I have a list of lists, with around 1000 lists looking like this:
['0.000744', '0.480106', 'B'].
I need the average of the first to entries of all the lists, can anybody
help how me to do this?
Thanks in advance
On Sep 23, 7:36 pm, David C Ullrich wrote:
> On Tue, 22 Sep 2009 02:34:53 +, Steven D'Aprano wrote:
> > On Mon, 21 Sep 2009 13:50:23 -0500, David C Ullrich wrote:
>
> >> But you actually want to return twice the value. I don't see how to do
> >> that.
>
> > What?
>
> > Seriously?
>
> You're sa
> MRAB (M) wrote:
>M> mattia wrote:
>>> You were right, the problem was with the print function, using a normal
>>> write everythong works fine.
>>>
>M> You should open the output file as binary (it doesn't matter on
>M> Linux/Unix, but is a good idea anyway for portability).
It probably DO
Sampsa Riikonen wrote:
> => If I start the program in directory "paska2", everythings OK, but if the
> directory name happens to be "python", the importation of the modules goes
> nuts!
What's inside the python/ subdirectory? Do you happen to have a file
called struct.py inside it?
--
http://ma
snfctech wrote:
> @Lemburg: Thanks for the suggestion. I'm sure you make a fine
> product, but my development platform is Linux, and I don't want any
> additional Windows servers to deal with (than the ones I'm already
> stuck with.)
Strange, EasySoft used to support their product on Linux as wel
On Sep 23, 5:49 pm, "Rhodri James"
wrote:
> On Thu, 24 Sep 2009 01:34:35 +0100, andrew cooke wrote:
>
> > For example, I assume it's possible to somehow access the dictionary
> > for the current block, but I can't see how to do this after
> > assignment. If I do it in the Foo constructor, for ex
On Thu, Sep 24, 2009 at 8:54 PM, Evora wrote:
>
> Hello,
>
> I'm a bit of a newbie to python, so this may very well be a basic question:
>
> I have a list of lists, with around 1000 lists looking like this:
> ['0.000744', '0.480106', 'B'].
>
> I need the average of the first to entries of all the
On Thu, Sep 24, 2009 at 04:07 -0300, Gabriel Genellina wrote:
> >I do not intentionally focus on UNIX type systems, but I have grown up
> >with *nix and I rather follow one scheme than none at all. But the
> >proposed way works on Windows as well, although the users might find
> >previously unseen
On Sep 23, 7:41 pm, andrew cooke wrote:
> On Sep 23, 10:11 pm, Dave Angel wrote:
>
> > This comes up periodically in this list, and the answer is always
> > something like: you can't get there from here.
>
> Well, I'm both flexible and desperate, so this is a possible route
> (perhaps near enoug
Wolodja Wentland wrote:
I think many Windows users would say WTF!? when seeing those
directories - and send cordial greetings to you, your parents and
your whole family :)
That is probably true, but Windows has a 'etc' directory
(c:\windows\system32\drivers\etc) which AFAIK contains the hosts f
On Sep 24, 7:12 am, Carl Banks wrote:
> with capture_changed_bindings() as changed:
> b = 5
> c = 4
> d = 6
> print changed
>
> test()
>
> Quick and dirty, not robust at all. But you get the idea.
>
> Carl Banks
brilliant. using the with context is an excellent i
flebber wrote:
Sorry to ask a simple question but I am a little confused how to
combine the input function and the date time module.
Simply at the start of the program I want to prompt the user to enter
the date, desirably in the format dd/mm/year.
However I want to make sure that python underst
Evora wrote:
Hello,
I'm a bit of a newbie to python, so this may very well be a basic question:
I have a list of lists, with around 1000 lists looking like this:
['0.000744', '0.480106', 'B'].
I need the average of the first to entries of all the lists, can anybody
help how me to do this?
Tha
I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no class
or instructor, I am learning this myself. I have Hetlands book "Beginning
Python Novice to Professional and online documentation books so Dive into
Python, python.org etc.
Using the SPE editor.
I have currently only
On Sep 24, 5:20 am, Steven D'Aprano
wrote:
> Speaking as a user (although not of Andrew's domain specific language),
> I'd like to say to developers PLEASE PLEASE PLEASE don't try to "help me"
> with half-baked unreliable solutions that only work sometimes.
>
> There's few things worse than unreli
On Wed, Sep 23, 2009 at 4:21 PM, D'Arcy J.M. Cain wrote:
> In any case, I have a strong philosophical objection to using the same
> name to refer to two different things regardless of any operational
> issues. The manager.firstname and employee.firstname are not the same
> thing and should have d
flebber.c...@gmail.com wrote:
I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no
class or instructor, I am learning this myself. I have Hetlands book
"Beginning Python Novice to Professional and online documentation
books so Dive into Python, python.org etc.
Using the SPE edi
On Thu, Sep 24, 2009 at 12:51 +0100, Tim Golden wrote:
> Wolodja Wentland wrote:
> >Is CSIDL_COMMON_APPDATA and environment variable set on all Windows
> >flavours?
>
> Certainly all those which Python currently supports. There are
> some small subtleties which have changed between older and
> new
Hi,
...
code, even that is not needed, as the columns are returned in the order
specified so code /knows/ that the first column is from /this/
table and the other column with is from /that/ table).
Unless you get a dictionary return.
In any case, I have a strong philosophical objection to
On Sep 24, 10:58 pm, Dave Angel wrote:
> flebber.c...@gmail.com wrote:
> > I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no
> > class or instructor, I am learning this myself. I have Hetlands book
> > "Beginning Python Novice to Professional and online documentation
> > books so
Wolodja Wentland wrote:
On Thu, Sep 24, 2009 at 12:51 +0100, Tim Golden wrote:
Wolodja Wentland wrote:
Is CSIDL_COMMON_APPDATA and environment variable set on all Windows
flavours?
Just to clarify, now that I read your post more carefully,
there *is* an environment variable APPDATA which is t
On Thu, 24 Sep 2009 08:49:02 -0400
Joe Riopel wrote:
> On Wed, Sep 23, 2009 at 4:21 PM, D'Arcy J.M. Cain wrote:
> > In any case, I have a strong philosophical objection to using the same
> > name to refer to two different things regardless of any operational
> > issues. The manager.firstname and
hi everybody,
I took your adviced and used the logging object.
I copied the example in 16.6.15.2 - "using logging in multiple
modules" from
http://docs.activestate.com/activepython/3.1/python/library/logging.html.
unfortunattly it only prints to file the ERROR level's messages and
ignore the othe
On Sep 24, 5:51 am, Iain King wrote:
> On Sep 23, 7:36 pm, David C Ullrich wrote:
>
>
>
> > On Tue, 22 Sep 2009 02:34:53 +, Steven D'Aprano wrote:
> > > On Mon, 21 Sep 2009 13:50:23 -0500, David C Ullrich wrote:
>
> > >> But you actually want to return twice the value. I don't see how to do
>
On Thu, 24 Sep 2009 15:03:26 +0200
Tino Wildenhain wrote:
> > In any case, I have a strong philosophical objection to using the same
> > name to refer to two different things regardless of any operational
> > issues. The manager.firstname and employee.firstname are not the same
> > thing and shou
Grant Edwards invalid.invalid> writes:
>
> Back when I worked on one of the first hand-held cellular
> mobile phones, it used co-routines where the number of
> coroutines was fixed at 2 (one for each register set in a Z80
> CPU).
Gotta love the lightning-fast EXX instruction. :-)
Regards
Antoi
daved170 wrote:
hi everybody,
I took your adviced and used the logging object.
I copied the example in 16.6.15.2 - "using logging in multiple
modules" from
http://docs.activestate.com/activepython/3.1/python/library/logging.html.
unfortunattly it only prints to file the ERROR level's messages a
Jean-Michel Pichavant wrote:
daved170 wrote:
hi everybody,
I took your adviced and used the logging object.
I copied the example in 16.6.15.2 - "using logging in multiple
modules" from
http://docs.activestate.com/activepython/3.1/python/library/logging.html.
unfortunattly it only prints to
I am trying to loop over a dictionary of phone numbers and using a python
regex to determine if they are long distance or local and then adding them
to their appropriate dictionary, My regex doesn't appear to be working
though.
My regex's are these
international__iregex=r'^1?(011|001)'
local__ire
On Sep 24, 11:10 pm, flebber wrote:
> On Sep 24, 10:58 pm, Dave Angel wrote:
>
>
>
> > flebber.c...@gmail.com wrote:
> > > I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no
> > > class or instructor, I am learning this myself. I have Hetlands book
> > > "Beginning Python Novice
I am trying to loop over a dictionary of phone numbers and using a python
regex to determine if they are long distance or local and then adding them
to their appropriate dictionary, My regex doesn't appear to be working
though.
My regex's are these
international__iregex=r'^1?(011|001)' #A
in line...
On Wed, Sep 23, 2009 at 9:13 PM, BJ Swope wrote:
> What is your code not doing?
>
see below
>
> Are you winding up with duplicate data in the DB?
>
yes
>
> Is your web browser re-submitting the form with the same data if you
> refresh the screen?
>
yes
>
> Is your web browser pr
Surely getting it tottally mixed up
from datetime import date
def ObtainDate(params):
date = raw_input("Type Date dd/mm/year: %2.0r%2.0r/%2.0r%2.0r/%4.0r
%4.0r%4.0r%4.0r")
print date.datetime(year-month-day)
By setting "date = raw_input(...)", you mask the datetime.date
object preventing yo
On Sep 24, 4:14 am, akonsu wrote:
> hello,
>
> SMTPHAndler seems to email every single record separately. is there a
> way to collect all log output and then send it in a single email
> message? or do i have to do it manually?
>
> thanks
> konstantin
See also http://pypi.python.org/pypi/mailinglo
Hello,
I want to set up descriptors at runtine, but it isn't working the way
i would expect. Does anybody know if this is possible? Here is an
example:
class Descriptor(object):
def __init__(self, name) :
self.val=0
self.name = name
def __get__(self, obj, objtype):
On Aug 23, 5:02 pm, Phillip B Oldham wrote:
> I've been taking a look at the multitude of coroutine libraries
> available for Python, but from the looks of the projects they all seem
> to be rather "quiet". I'd like to pick one up to use on a current
> project but can't deduce which is the most po
Support Desk wrote:
I am trying to loop over a dictionary of phone numbers and using a
python regex to determine if they are long distance or local and then
adding them to their appropriate dictionary, My regex doesn't appear to
be working though.
My regex's are these
international__iregex=
> You can also try Eclipse + PyDev. It's not the same as Visual Studio, and I
> am not sure about the GUI builder, but I think it's what you want.
I really like Eclipse + Pydev. It is not a GUI builder at all but it
has a nice debugger, code completion and that kind of thing. And its
free!
B
1. Did you try the headers for no-caching of the page?
2. If you wish to avoid dupes in a DB, Primary Keys are the tool to prevent
duplicates.
On Thu, Sep 24, 2009 at 11:01 AM, victorsubervi wrote:
> in line...
>
> On Wed, Sep 23, 2009 at 9:13 PM, BJ Swope wrote:
>
>> What is your code not doin
Hi, Marc-Andre - well, so far you seem to be the only one suggesting
that cross-database joins is the way to go - everyone else has been
telling me to build a warehouse. I initially was trying to avoid the
warehouse idea to "avoid going through the external temporary
resource", as you say. But th
victorsubervi wrote:
> On Wed, Sep 23, 2009 at 9:13 PM, BJ Swope wrote:
>> Is your web browser re-submitting the form with the same data if you
>> refresh the screen?
> yes
I'm surprised no one has mentioned this before, but the standard
approach to this problem is to redirect after a successful
On 07:10 am, jacopo.pe...@gmail.com wrote:
On Sep 23, 5:57�pm, exar...@twistedmatrix.com wrote:
[snip]
It isn't possible. �While the remote methods are running, other events
are not being serviced. �This is what is meant when people describe
Twisted as a "*cooperative* multitasking" syste
Currently it is possible to import a file of one path to more than one
'instance' of a module. One notable example is "import __init__" from
a package. See
http://stackoverflow.com/questions/436497/python-import-the-containing-package
This recently caused a devastating bug in some of my code. Wha
flebber wrote:
On Sep 24, 11:10 pm, flebber wrote:
On Sep 24, 10:58 pm, Dave Angel wrote:
flebber.c...@gmail.com wrote:
I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no
class or instructor, I am learning this myself. I have Hetlands book
"Beginning Python
On a new python 3 installation on a fedora 7 box, I get a test_sys failure.
Here is the console spew. Couldn't find any discussion about this. Suspect I
have fouled up but I don' t know how to proceed. Ideas?
853 test_sys
854 test test_sys failed -- Traceback (most recent call last):
8
On Thu, Sep 24, 2009 at 10:43 AM, Support Desk wrote:
> I am trying to loop over a dictionary of phone numbers and using a python
> regex to determine if they are long distance or local and then adding them
> to their appropriate dictionary, My regex doesn't appear to be working
> though.
"doesn
In article ,
Gabriel Genellina wrote (but I edited):
.
.
.
>More ways to define an empty function that you ever imagined:
>http://groups.google.com/group/comp.lang.python/t/c9f494b6745c7d74/
In Vinay
Sajip writes:
>See my answer to a question on Stack Overflow, which has the source
>code for a simple handler which writes to a database using the Python
>DB-API 2.0:
>http://stackoverflow.com/questions/935930/creating-a-logging-handler-to-connect-to-oracle/1014450#1014450
>Although
On Sep 24, 2:14 am, phi...@semanchuk.com wrote:
> Quoting Wolodja Wentland :
>
>
>
> > On Wed, Sep 23, 2009 at 12:24 -0700, devaru wrote:
> >> I'm trying to install psycopg2 on my system. I followed the
> >> instruction in INSTALL file and gave the command
> >> python setup.py build
> >> running bu
Hello,
I downloaded and installed the pexpect module and wrote a script. All is
well and good, but the script proved to be pretty useful and now I was asked
to run it as a scheduled task up on a server to run periodically. I was
intending on simply packaging it up with Py2Exe and moving it to th
The docs for divmod include the following:
divmod(a, b)
...For floating point numbers the result is (q, a % b), where q
is usually math.floor(a / b) but may be 1 less than that. ...
I know that floating point math can sometimes produce "unexpected"
results, so the above caveat is n
I wrote some code to handle and log exceptions in my application.
It works well, but it produces double output for each exception.
How can I fix this?
Here's the pared-down code:
- main.py
import exceptionLogger
import doStuff
exlog = exceptionLogger.exceptionLogger()
stuff = doStuff.doStuf
Zac Burns wrote:
Currently it is possible to import a file of one path to more than one
'instance' of a module. One notable example is "import __init__" from
a package. See
http://stackoverflow.com/questions/436497/python-import-the-containing-package
This recently caused a devastating bug in s
I recently started playing with Python about 3 days now (Ex Perl guy) and
wanted some input on style and structure of what I'm doing before I really
start picking up some bad habits here is a simple test tool I wrote to validate
home dirs on my system.
Please evaluate and let me know what could
On Sep 24, 2:27 pm, daved170 wrote:
> hi everybody,
> I took your adviced and used theloggingobject.
> I copied the example in 16.6.15.2 - "usingloggingin multiple
> modules"
> fromhttp://docs.activestate.com/activepython/3.1/python/library/logging.html.
>
> unfortunattly it only prints to file t
list = [ 'a', '1', 'b', '2']
what would be the logic, if I input a to get output 1.
--
http://mail.python.org/mailman/listinfo/python-list
You should use a dictionary.
dic = {'a':1, 'b':2}
Use dic['a'] to get output 1.
[]s
iurisilvio
On Thu, Sep 24, 2009 at 5:31 PM, Ahmed Shamim wrote:
> list = [ 'a', '1', 'b', '2']
> what would be the logic, if I input a to get output 1.
> --
> http://mail.python.org/mailman/listinfo/python-lis
On Sep 24, 10:26 am, Zac Burns wrote:
> Currently it is possible to import a file of one path to more than one
> 'instance' of a module. One notable example is "import __init__" from
> a package.
> Seehttp://stackoverflow.com/questions/436497/python-import-the-containin...
>
> This recently cause
Hello,
a = [1, 2, 3, 4, 5, 6]
for i, x in enumerate(a):
if x == 3:
a.pop(i)
continue
if x == 4:
a.push(88)
print "i", i, "x", x
I'd like to iterate over a list and change that list while iterating.
I'd still like to work on all items in that list, which is n
2009/9/24 Ahmed Shamim :
> list = [ 'a', '1', 'b', '2']
> what would be the logic, if I input a to get output 1.
Turn it into a dictionary first:
>>> mylist = [ 'a', '1', 'b', '2']
>>> mydict = dict(zip(mylist[::2], mylist[1::2]))
>>> mydict['a']
'1'
--
Cheers,
Simon B.
--
http://mail.python.o
Not sure I understand well, but let say I did..
list[list.index('a')+1]
Le 14:59, Ahmed Shamim a écrit :
list = [ 'a', '1', 'b', '2']
what would be the logic, if I input a to get output 1.
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Sep 24, 2009 at 1:38 PM, Carl Banks wrote:
> On Sep 24, 10:26 am, Zac Burns wrote:
>> Currently it is possible to import a file of one path to more than one
>> 'instance' of a module. One notable example is "import __init__" from
>> a package.
>> Seehttp://stackoverflow.com/questions/436
On 2009-09-24 14:40 PM, kj wrote:
The docs for divmod include the following:
divmod(a, b)
...For floating point numbers the result is (q, a % b), where q
is usually math.floor(a / b) but may be 1 less than that. ...
I know that floating point math can sometimes produce "unexpect
Torsten Mohr wrote:
Hello,
a = [1, 2, 3, 4, 5, 6]
for i, x in enumerate(a):
If you change a list while iterating over, start at the tail.
...reversed(enumerate(a))
if x == 3:
a.pop(i)
del a[i] # you already have the item
continue
if x == 4:
a.push(88)
Brown, Rodrick wrote:
I recently started playing with Python about 3 days now (Ex Perl guy) and
wanted some input on style and structure of what I'm doing before I really
start picking up some bad habits here is a simple test tool I wrote to validate
home dirs on my system.
Please evaluate an
In Robert Kern
writes:
>On 2009-09-24 14:40 PM, kj wrote:
>>
>> The docs for divmod include the following:
>>
>> divmod(a, b)
>> ...For floating point numbers the result is (q, a % b), where q
>> is usually math.floor(a / b) but may be 1 less than that. ...
>>
>> I know that floa
I'm trying to scrape some historical data from NOAA's website, but I
can't seem to feed it the right form values to get the data out of
it. Heres the code:
import urllib
import urllib2
## The source page http://www.erh.noaa.gov/bgm/climate/bgm.shtml
url = 'http://www.erh.noaa.gov/bgm/climate/pic
Zac Burns wrote:
On Thu, Sep 24, 2009 at 1:38 PM, Carl Banks wrote:
On Sep 24, 10:26 am, Zac Burns wrote:
Currently it is possible to import a file of one path to more than one
'instance' of a module. One notable example is "import __init__" from
a package.
Seehttp://stackoverflow.com/questi
On 24 Sep, 21:11, "Brown, Rodrick " wrote:
> I recently started playing with Python about 3 days now (Ex Perl guy) and
> wanted some input on style and structure of what I'm doing before I really
> start picking up some bad habits here is a simple test tool I wrote to
> validate home dirs on my
On 24 Sep, 22:18, "Adam W." wrote:
> I'm trying to scrape some historical data from NOAA's website, but I
> can't seem to feed it the right form values to get the data out of
> it. Heres the code:
>
> import urllib
> import urllib2
>
> ## The source pagehttp://www.erh.noaa.gov/bgm/climate/bgm.sht
On Thu, 24 Sep 2009 21:11:36 +0100, Brown, Rodrick
wrote:
I recently started playing with Python about 3 days now (Ex Perl guy)
and wanted some input on style and structure of what I'm doing before I
really start picking up some bad habits here is a simple test tool I
wrote to validate
On Thu, Sep 24, 2009 at 4:32 PM, Torsten Mohr wrote:
> Hello,
>
> a = [1, 2, 3, 4, 5, 6]
>
> for i, x in enumerate(a):
> if x == 3:
> a.pop(i)
> continue
>
> if x == 4:
> a.push(88)
>
> print "i", i, "x", x
>
> I'd like to iterate over a list and change that list whil
On Thu, 24 Sep 2009 13:39:57 +0100, andrew cooke wrote:
On Sep 24, 5:20 am, Steven D'Aprano
wrote:
Speaking as a user (although not of Andrew's domain specific language),
I'd like to say to developers PLEASE PLEASE PLEASE don't try to "help
me"
with half-baked unreliable solutions that onl
On Thu, 24 Sep 2009 21:32:53 +0100, Torsten Mohr wrote:
Hello,
a = [1, 2, 3, 4, 5, 6]
for i, x in enumerate(a):
if x == 3:
a.pop(i)
continue
if x == 4:
a.push(88)
print "i", i, "x", x
I'd like to iterate over a list and change that list while iterating.
On Thu, 24 Sep 2009 19:45:37 +0100, Simon Forman
wrote:
FWIW this problem is too simple (IMHO) for regular expressions.
Simply carve off the first three digits and check against sets of the
prefixes you're interested in:
#any number starting with these prefixes is not long distance
local_pr
Okay, thanks for the advice that sounds a good place to start. I used %2.os
was an attempt to define width and precision to stop typo errors eg the
user accidentally inputing 101/09/2009 or similar error. So that the
__/__/ was adhered to.
I will go back to the start get the basics happ
On Thu, Sep 24, 2009 at 6:31 PM, Rhodri James
wrote:
> On Thu, 24 Sep 2009 19:45:37 +0100, Simon Forman
> wrote:
>
>> FWIW this problem is too simple (IMHO) for regular expressions.
>> Simply carve off the first three digits and check against sets of the
>> prefixes you're interested in:
>>
>>
>>
Kevin Holleran wrote:
Hello,
I downloaded and installed the pexpect module and wrote a script. All is
well and good, but the script proved to be pretty useful and now I was asked
to run it as a scheduled task up on a server to run periodically. I was
intending on simply packaging it up with Py
On Thu, Sep 24, 2009 at 2:51 PM, Ethan Furman wrote:
> I believe that modules are imported only once
>
That's *mostly* true, but try this one:
A.py:
print 'Importing A'
import B
B.py:
print 'Importing B'
import A
Cashew:/tmp$ python2.5 B.py
Importing B
Importing A
Importing B
--
Daniel Stutz
On Sun, Sep 13, 2009 at 6:25 AM, Nobody wrote:
> On Fri, 11 Sep 2009 05:27:59 -0700, r wrote:
>
> > Sounds like "somebody" failed to get input
> > from their users at design time. Or "somebody" has the inability to
> > relate to their end users.
>
> You're assuming that there is some "right" an
On Sep 24, 7:49 am, flebber wrote:
> On Sep 24, 11:10 pm, flebber wrote:
>
>
>
> > On Sep 24, 10:58 pm, Dave Angel wrote:
>
> > > flebber.c...@gmail.com wrote:
> > > > I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no
> > > > class or instructor, I am learning this myself. I ha
A friend is looking for some help with how to use Python to access a
WinTV (Go Plus) capture card, and how to display an image from it. Is
there some facility that might help him, or does anyone have experience
with such use that might suggest sources?
--
http://mail.python.org/mailman/listinfo
Brown, Rodrick wrote:
I recently started playing with Python about 3 days now (Ex Perl guy) and
wanted some input on style and structure of what I'm doing before I really
start picking up some bad habits here is a simple test tool I wrote to validate
home dirs on my system.
Please evaluate an
I don't think I am using re.compile properly, but thought as this would
make my output an object it would be better for later, is that correct?
#Obtain date
def ObtainDate(date):
date = raw_input("Type Date dd/mm/year: ")
re.split('[/]+', date)
date
year = date[-1]
month = date[1]
day = date[0]
If you are a csv module user, I have a question for you: Do you use the
csv.Sniffer class?
o Yes, frequently
o Yes, on occasion
o I tried it a few times but don't use it now
o No, I don't need it
o No, never heard of it
o No (some other reason)
If you don't use it, how do
On Sep 24, 12:38 pm, koranthala wrote:
> Hi,
> I was trying to capture the video which I was viewing using
> Imagegrab module in PIL (windows). But, I found that the video was not
> captured at all. A quick googling tells me that it is because the
> windows does not have access to the viewing
On Sep 24, 4:37 pm, Dave Angel wrote:
> Kevin Holleran wrote:
> > Hello,
>
> > I downloaded and installed the pexpect module and wrote a script. All is
> > well and good, but the script proved to be pretty useful and now I was asked
> > to run it as a scheduled task up on a server to run periodic
1 - 100 of 111 matches
Mail list logo