on.
f.close()
print forward, "\n\n", "\n\n", backward, "\n"
It's good to retain context.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
://www.diveintopython.net/file_handling/os_module.html
Emile
BTW, googling for "python how to get a list of names of everything in
the current directory" yields some good information as well. Google is
your friend for this level of question. Not sure anymore beyond that...
--
http://mail.
On 11/13/2012 01:19 PM, Chris Angelico wrote:
Troll fail.
*whoops*
*sigh* mine too.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
elease for
this. You may want to consider having both.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
write
macros from within python and run them using the commands module to test.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
On 11/29/2012 10:39 AM, Nobody wrote:
Every time I see your posts "Shanghai Noodle Factory" sticks in my head
as my daily hummer. :)
--
http://mail.python.org/mailman/listinfo/python-list
t's a rich environment for business applications.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
g can never work reliably...
Hmm, then I'll have to wait longer to experience the unreliability as
the handful of automated gui tools I'm running has only been up 10 to 12
years or so.
Emile
--
https://mail.python.org/mailman/listinfo/python-list
years
ago. Rule one is don't fix it if it ain't broke, so yes, I've got
python projects deployed that run under everything from 1.5.2 on.
Fortunately, they all work without issue so maintenance isn't a problem.
Emile
--
https://mail.python.org/mailman/listinfo/python-list
ver:
>>> s.split()[-1]
'30'
Is it a length of s and speed or rindex over build and toss the list
kind of thing?
Emile
--
https://mail.python.org/mailman/listinfo/python-list
; ", value2
...
Traceback (most recent call last):
File "", line 1, in
TypeError: 'int' object is not iterable
What am I doing wrong?
for ... in dict:
is a way to iterate through dictionnary items,
what you want to do can be done so:
for (key1,key2),(value1,va
ow, following the account
doesn't notify about changes to documents, only changes to the account
itself.
Ask if that's not clear.
Emile
--
https://mail.python.org/mailman/listinfo/python-list
On 01/21/2014 10:03 AM, Chris Angelico wrote:
On Wed, Jan 22, 2014 at 4:52 AM, emile wrote:
Ask if that's not clear.
I'm not entirely sure, but I think this might have been meant for
somewhere other than python-list. Welcome to the club.
Aargh! -- I hate when that happen
Function defs with mutable arguments hold a reference to the mutable
container such that all invocations access the same changeable container.
To get separate mutable default arguments, use:
def f(x=None):
if x is None: x=[2,3]
Emile
On 01/21/2014 11:11 AM, Mû wrote:
Hi everybody,
A
Under Subscription Sponsors in the listing of destinations, I'm going to
guess from the grouping that NE should be NL.
Emile
On 02/11/2014 08:18 AM, M.-A. Lemburg wrote:
[Please help spread the word by forwarding to other relevant mailing lists,
user groups, etc. world-wide; t
On 02/17/2014 09:00 AM, Nir wrote:
k = ['hi','boss']
k
['hi', 'boss']
k= [s.upper for s in k]
s.upper is a reference to the method upper of s -- to execute the method
add parens -- s.upper()
Emile
k
[, ]
Why doesn't the python interpre
or an image, or
something), then the *file* won't have an encoding, so you'll need to
know the encoding of the particular string you want and encode your
string to bytes.
On 2.7 it's as easy as it sounds without having to think much about
encodings and such. I find it mostly just works
stuff, key=lambda x: x.name.lower()))
in this case you're sorting by the lower case value of x.name, which is
what you want.
Emile
# END
The output is:
[Thing d, Thing f, Thing 2, Thing a, Thing b, Thing C]
[Thing 2, Thing a, Thing b, Thing C, Thing d, Thing f]
The second call to s
east, and one mile north and end up at their starting point?
Emile
--
https://mail.python.org/mailman/listinfo/python-list
On 04/30/2014 11:21 AM, Grant Edwards wrote:
On 2014-04-29, emile wrote:
On 04/29/2014 01:16 PM, Adam Funk wrote:
"A man pitches his tent, walks 1 km south, walks 1 km east, kills a
bear, & walks 1 km north, where he's back at his tent. What color is
the bear?" ;-
s for the ingredients of
the foodlist referenced
149 # local internal use only to create sqlFoodListsByID
(Pdb) decval
'4'
(Pdb) len(decval)
1
(Pdb) int(decval)
*** ValueError: invalid literal for int() with base 10: '41.7000003'
(Pdb)
Any ideas?
Thanks,
E
On 03/13/2015 03:14 PM, Chris Angelico wrote:
On Sat, Mar 14, 2015 at 9:10 AM, emile wrote:
(Pdb) decval
'4'
(Pdb) len(decval)
1
(Pdb) int(decval)
*** ValueError: invalid literal for int() with base 10: '41.703'
(Pdb)
Any ideas?
What's type(decval) te
On 03/13/2015 08:09 PM, Chris Angelico wrote:
On Sat, Mar 14, 2015 at 1:33 PM, Paul Rubin wrote:
emile writes:
*** NameError: name 'val' is not defined
(Pdb) l
139 try:
140 val = round(float(decval),1)
141 except:
142 import pdb; pdb.set_tr
On 03/14/2015 09:08 AM, Peter Otten wrote:
emile wrote:
On 03/13/2015 08:09 PM, Chris Angelico wrote:
On Sat, Mar 14, 2015 at 1:33 PM, Paul Rubin
wrote:
emile writes:
*** NameError: name 'val' is not defined
(Pdb) l
139 try:
140 val = round(float(decv
On 03/14/2015 08:52 AM, Chris Angelico wrote:
On Sun, Mar 15, 2015 at 2:28 AM, emile wrote:
It ran almost to completion before generating the error again --
(Pdb) decval
'4'
(Pdb) type(decval)
(Pdb) len(decval)
1
(Pdb) int(decval)
*** ValueError: invalid literal for int() wi
On 03/14/2015 11:24 AM, Peter Otten wrote:
emile wrote:
On 03/14/2015 09:08 AM, Peter Otten wrote:
Why are you checking
int(decval)
because it sure smells like int should work:
(Pdb) "3"
That's a normal string comparison when decval is a string. This and the
ValueEr
On 03/15/2015 07:01 AM, Peter Otten wrote:
Probably not helpful, but I can provoke the behaviour you see by toggling
bytes with ctypes, thus simulating a corrupted str object:
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for
read/write to disk that'd open up additional options.
Otherwise I'm not sure there's much to be gained.
Emile
As I am trying to solve competitive Programs on codechef.com using python i was
wondering if there is any other way to print and scan the inputs fast.
I have se
wever, if that is the behavior you were after, you can get there.
def reassign(mylist): # no reason to shadow the list builtin
mylist[:] = [0,1]
mylist = [1]
reassign(mylist)
mylist
Emile
--
https://mail.python.org/mailman/listinfo/python-list
ve an aptitude repository with
approved software that holds the approved source packages users can
install. Combining automated user system updating with a sole
repository where only your versions are available should do it.
Emile
--
https://mail.python.org/mailman/listinfo/python-list
pprint function from
within the pprint module:
pprint.pprint(board)
or alternately,
from pprint import pprint
pprint(board)
or, as I sometime do
from pprint import pprint as pp
pp(board)
Emile
--
https://mail.python.org/mailman/listinfo/python-list
On 07/22/2014 03:05 PM, fl wrote:
On Tuesday, July 22, 2014 5:51:07 PM UTC-4, emile wrote:
On 07/22/2014 02:42 PM, fl wrote:
pprint is a module name -- you need to invoke the pprint function from
within the pprint module:
pprint.pprint(board)
Thanks. I am curious about the two pprint. Is it
On 07/22/2014 03:17 PM, fl wrote:
On Tuesday, July 22, 2014 4:46:25 PM UTC-4, emile wrote:
On 07/22/2014 01:35 PM, Peter Pearson wrote:
def reassign(mylist): # no reason to shadow the list builtin
mylist[:] = [0,1]
mylist = [1]
reassign(mylist)
mylist
Emile
Thanks for your example. I
s a convenience, the interactive prompt environment will display the
value of a variable when entered on its own.
In scripts, you'd usually want to use print.
Emile
--
https://mail.python.org/mailman/listinfo/python-list
e
local to the function; assigning to the contents (as with [:]) changes
the contents, but not the container variable, and as the container
element was passed in you'll see the changed item outside the function.
Emile
and assign to it the name 'list'." At this point, t
Add a timing harness and use a test interval (N) and call LARGE every
Nth loop until LARGE's timing is better than the prior SHORT's run.
Emile
On 09/23/2014 07:48 AM, Steven D'Aprano wrote:
I have a certain calculation which can be performed two radically different
ways.
On 10/13/2014 11:02 AM, Mark Lawrence wrote:
Why bother to initialise a counter when you can get the enumerate
function to do all the work for you?
I see it as a question of addressing the audience.
Emile
--
https://mail.python.org/mailman/listinfo/python-list
.
Emile
--
https://mail.python.org/mailman/listinfo/python-list
v2.3) is effbot's guide to
the standard library available at
http://effbot.org/zone/librarybook-index.htm
It's pretty much _all_ examples.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
never function isn't _exactly_ "Example" the else clause executes.
If you want to catch forms of example you might try:
if function.strip().upper() == "EXAMPLE":
Emile
print ("Hello World!")
else:
print ("blah blah blah"
uot;-c ''" options i keep seeing in the attempts to pass bogus info in
my 'page' variable?
And hows oops.py relevant? Such file doesnt nto exist in my webssever.
You're certainly right about that -- particularly by the time it's
attempted. :)
Emile
--
http://mail.python.org/mailman/listinfo/python-list
ork. Does anyone have suggestions on how I could
get this to work?
Thanks in advance for the help,
Emile
This message may contain privileged and/or confidential information. If
you have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or d
al "To" and
"Subject" lines so that I know to whom the email was sent and the
subject line without opening the email?
Thanks in advance for the help.
Emile Boudreau
This message may contain privileged and/or confidential information. If
you have received this e-mail in err
x27;t Work
It's just adding the "From" "To" "Subject" in the message itself. I want
to have each field at the correct place and then just the msg in the
body.
Any Help?? Thanks
Emile Boudreau
-Original Message-
From: [EMAIL PROTECTED]
[mailto
access to all the variables I have?
thanks
Emile Boudreau
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Boudreau, Emile
Sent: Tuesday, March 20, 2007 1:51 PM
To: python-list@python.org
Subject: RE: Subject line with smtplib.sendmail()
Thanks for the
Hello,
I have two batch files and I'm trying to run them in parallel. I
haven't been able to find any information on how to make python open 2
command prompt and then make each prompt run one of the batch files.
Can anyone point me in the right direction?
Thanks,
Emil
Hello,
I have two batch files and I'm trying to run them in parallel. I
haven't been able to find any information on how to make python open 2
command prompt and then make each prompt run one of the batch files.
Can anyone point me in the right direction?
Thanks,
Emil
"From: %s" % FROM,
"To: %s" % TO,
"Subject: %s" % subject,
"",
body
), "\r\n")
server = smtplib.SMTP(HOST)
server.sendmail(FROM, [TO], BODY)
server.quit()
Emile Boudreau
This message may
Thanks so much I would of never found that out.
Problem SOLVED
Emile Boudreau
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim
Williams
Sent: Friday, March 30, 2007 9:12 AM
To: Boudreau, Emile
Cc: python-list@python.org
Subject: Re: Sending
'dev.tar.gz':
return 1
For some reason I only get 'logs' printed when is_Dev is called. (ie.
It's only going through is_dev once)
Does anyone see something wrong that I'm not seeing??
Thanks,
Emile Boudreau
This message may contain privileged and/or co
now the results of the filter is an empty list and i know it
shouldn't be.
Emile Boudreau
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Boudreau, Emile
Sent: Tuesday, April 03, 2007 10:52 AM
To: python-list@python.org
Subject: Problem with
71, in getmember
raise KeyError("filename %r not found" % name)
KeyError: "filename 'symbols.xml' not found"
I know that the tarball contants this file "symbols.xml" but I don't
understand why it's not extracting it. Any help will be great
Your hint of checking "tar.getnames()" was exatly what I needed. It
returns the path to where the file will be extracted (ie.
Src/ver/qfw/symbols.xml). After knowing this fact it was quite simple to
extract the file.
Thanks, problem solved!!!
Emile Boudreau
x5754
-Original Message
> '' and jobs.job = fixes.job and fixes.change = 28339 order
by change desc"
db = odbc.odbc( "UDAP4" )
cursor = db.cursor()
cursor.execute( Query )
Emile Boudreau
x5754
This message may contain privileged and/or confidential information. If
you have recei
than the
older compiler.ast module. See the ChangeLog files for more detailed
information and our blogentry
http://www.logilab.org/blogentry/8554 explaining how we support
both compiler and _ast.
--
Emile Anclin
http://www.logilab.fr/ http://www.logilab.org/
Informatique scientifique
unction():
print "aFunction running"
aFunction()
Cobbled together from http://www.chrisevans3d.com/pub_blog/?p=530 and
http://stackoverflow.com/questions/3687046/python-sphinx-autodoc-and-decorated-members
HTH
Emile
--
http://mail.python.org/mailman/listinfo/python-list
s, but on linux I've done some
testing with python-fuse that allows interception on file access to take
whatever actions you like, in your case archive prior upon write.
Might be worth a look.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
On 6/22/2012 11:19 AM duncan smith said...
On 22/06/12 17:42, Emile van Sebille wrote:
On 6/22/2012 8:58 AM duncan smith said...
Hello,
I have an application that would benefit from collaborative working.
Over time users construct a "data environment" which is a number of
files in J
32com.server.register
win32com.server.register.UseCommandLine(fenxUtilities)
HTH,
Emile
So i need the script to be launched, say, by pressing a button
in excel and, for instance, retrieve immediately data from the mysql
table. For what I found in the net, it seems there are three ways to
control p
script...
Registering the com server does that for you (the __name__ == __main__
part of the python script)
Again, get one of the examples working and move out from there.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
On 7/7/2012 2:05 AM Maurizio Spadaccino said...
Thanks again Emile, I'll try out some examples. I found this one:
http://showmedo.com/videotutorials/video?name=2190050&fromSeriesID=219
quite enlightning.
One last doubt is: say the python code gets used by more Excel Users (different
p
-dev/2002-March/020568.html for
more info.
Emile
Of interest the 3.1 installation also has the select module file
re-named select_failed.so.
Any help appreciated,
Regards,
John Pote
--- Posted via news://freenews.netfront.net/ - Complaints to
n...@netfront.net ---
--
http://mail.pyt
orced my hobby from my
career. And my family likes me better too.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
to e or f, so this is the second None,None
Why do you expect 1,2?
Emile
e = 1
f = 2
print c,d
Output:
None None
None None
1 2
I'm expecting the code as:
None None
1 2
1 2
What's wrong?
And this question made my GUI program totally out of
properly, this is bvisual basic and should result
in some form of visual basic error (possibly library related) if
anything and not a python traceback.
Emile
Traceback (most recent call last):
...
appt.BodyFormat = OlBodyFormat.olFormatHTML
NameError: name 'OlBodyForma
shortened abbreviations. I then cycled
through best fitting substitutions to get as close as reasonable to the
40 character limit which generally resulted in recognizable descriptions
in the legacy environment that matched by being directly derived from
the longer marketing names.
YMMV,
Emile
causes an error type (val): %s (%s)" (type(ii),ii)
Either it's a python bug or there really is a list in there.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
ently absorbed a couple SAP resellers.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
ation otherwise. :)
Emile
--
http://mail.python.org/mailman/listinfo/python-list
meant something else ..
j runs through range(M, 100) and then range(0,M), and i runs through
range(N,100) and then range(0,N)
.. apologies if I didn't make that clear enough.
for i in range(N,N+100):
for j in range(M,M+100):
do_something(i % 100 ,j % 100)
Emile
tions creating iterators for efficient looping
New in version 2.3.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
l("abcd")
print val2str(str2val("abcd"))
print val2str(str2val("good"))
print val2str(str2val("longer"))
print val2str(str2val("verymuchlonger"))
Flavor to taste.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
Unix
socket (located on the same host) or a TCP socket (remote host)
Is this correct?
Thank you.
I'm sure there's no single correct answer to this.
Consider (python 2.6]:
emile@paj39:~$ mkdir web
emile@paj39:~$ cd web
emile@paj39:~/web$ cat > test.html
hello from test.html
emil
ystem I get:
ActivePython 2.7.0.2 (ActiveState Software Inc.) based on
Python 2.7 (r27:82500, Aug 23 2010, 17:18:21) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib
>
import socket
print socket.__file__
Chances are the __file__'s directory isn't in the command line's sys.path.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
ned
again. The sys.path outputs are identical. The print socket.__file__ reveals
a file that is in the sys.path...g.
Next, I'd check for rogue versions of _socket.pyd in directories
occuring in sys.path.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
, sunaudiodev )
Please guide me to proceed further.
You're done, unless you specifically need support for any of those
specific modules.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
ourself.
I concur, but FYI the version of Python with RHEL5 is 2.4. Still, OP
should stick with that unless there is a pressing reason.
Hence, the 2.6 install.
Learn-to-trim-ly y'rs,
Emile
--
http://mail.python.org/mailman/listinfo/python-list
On 8/20/2012 11:37 AM Walter Hurry said...
On Mon, 20 Aug 2012 11:02:25 -0700, Emile van Sebille wrote:
On 8/20/2012 10:20 AM Walter Hurry said...
I concur, but FYI the version of Python with RHEL5 is 2.4. Still, OP
should stick with that unless there is a pressing reason.
Hence, the 2.6
On 8/20/2012 1:55 PM Walter Hurry said...
On Mon, 20 Aug 2012 12:19:23 -0700, Emile van Sebille wrote:
Package dependencies. If the OP intends to install a package that
doesn't support other than 2.6, you install 2.6.
It would be a pretty poor third party package which specified Pytho
On 8/20/2012 9:34 PM John Nagle said...
After a thread of clueless replies,
s/clueless/unread
Emile
--
http://mail.python.org/mailman/listinfo/python-list
roper newsreader?
Probably because their ISP doesn't offer a free server
Python lists are available on the free gmane mail-to-news server.
I'm getting high load related denials with the gmane connections a lot
recently so I'm open to alternatives.
Suggestions or reco
erflow.com/questions/1335507/keyboard-input-with-timeout-in-python
among others.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
invoking spyderlib stuff that's causing the error?
Emile
--
http://mail.python.org/mailman/listinfo/python-list
uring that fld is an appropriate length. One
way may be tweaking the split to return the right numbers of elements:
>>> T = "1,2,3"
>>> flds = (T+","*5).split(",")[:5]
>>> flds
['1', '2', '3', '', '']
Emile
--
http://mail.python.org/mailman/listinfo/python-list
-- your reposting of the entire 'abusive' post is
in and of itself abusive.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
nd thereby gain
access to the documentation directly.)
There's a good overview at http://www.linktionary.com/e/edi.html
HTH,
Emile
I'm especially not wanting ad hoc advice in this thread; this is surely
an old, complex problem with a lot of ground already covered. Primers on
pitfalls to
reasonably lightweight
and has been working well for our similar situation.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
w for
telecommuting. I'm looking for a third member of the team that will
focus on back end development integrating various systems through to an
open source python platform.
Where are you located? I'm on the SF Peninsula.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
On 9/26/2012 6:06 PM Wayne Werner said...
On Sun, 23 Sep 2012, Dwight Hutto wrote:
We're the borg.
Oh, so you *are* a robot. That does explain your posts ;)
Damn. Now I'll forever more hear Stephen Hawkin's voice as I read the
repeated contexts. Maybe that'll help
On 9/27/2012 2:58 PM Rikishi42 said...
Inboxes?
What is this, usenet or email ?
Yes. Both.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
Debashish Saha wrote:
how to insert random error in a programming?
Make the changes late in the day then leave for the weekend?
Emile
--
http://mail.python.org/mailman/listinfo/python-list
thank you very much!
You could use string interpolation:
Dx = numpy.matrix('%s %s %s; %s %s -0.5; 0 -0.5 1.5'
% (test11 test12 test13 test21 test22))
Emile
--
http://mail.python.org/mailman/listinfo/python-list
realize that windows may not allow the full memory to user space.
I'm not sure what exactly the restrictions are, but a 4Gb windows box
doesn't always get you 4Gb of memory.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
there is not :-)
In the end I am going to what to get triples, quads... also.
How far have you gotten? Show us the loops you're trying now and any
errors you're getting.
Emile
--
http://mail.python.org/mailman/listinfo/python-list
gt;>> groupsize=3
>>> a = "applesauce"
>>> for i in range(len(a)-groupsize+1): a[i:i+groupsize]
...
'app'
'ppl'
'ple'
'les'
'esa'
'sau'
'auc'
'uce'
Other than adding depth to my knowledge of the ever growing standard
library, is there a reason to prefer pairwise over my simple loop?
Emile
--
http://mail.python.org/mailman/listinfo/python-list
rs = tee(iterable, n)
for i, it in enumerate(iters):
for _ in range(i):
next(it, None)
return izip(*iters)
It's good that the standard library provides these tools as a
convenience, but when all you need is a derringer, why reach for a howitzer?
Emile
--
http:
On 10/21/2012 9:19 PM, Ian Foote wrote:
On 22/10/12 09:03, Emile van Sebille wrote:
So, as OP's a self confessed newbie asking about slicing, why provide an
example requiring knowledge of tee, enumerate, next and izip?
Because not only the newbie will read the thread? I for on
On 10/23/2012 4:35 PM, emile wrote:
So, let's see, at that point in time (building backward) you've got
probably somewhere close to 400-500Gb in memory.
My guess -- probably not so fast. Thrashing is sure to be a factor on
all but machines I'll never have a chance to wor
brucegoodst...@gmail.com wrote:
Using a decorator works when named arguments are not used. When named arguments
are used, unexpected keyword error is reported. Is there a simple fix?
Extend def wrapper(*args) to handle *kwargs as well
Emile
Code:
-
from functools import wraps
def
1 - 100 of 645 matches
Mail list logo