ould care?
>
> Regards,
>
>
> Björn
>
And why is that superior to this:
def avg(l):
return float(sum(l))/len(l)
>>>avg([1,2,3,4])
2.5
Which can actually be read and debugged in the future!
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
usty.y
>>> 1
>
> ... ? thanks.
>
> peace
> stm
>
Not sure why you want it, but here is one solution:
class clown:
def __init__(self):
self.x=0
def __getattr__(self, key):
if key == 'y': return self.x
return self.__dict__[key]
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
t;
> Steve
I can't think of any of my code that got broken and it fixed a
broken SSL problem (on Windows) that I was fighting.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
=x.upper().find('SEARCH')
print hasword
True
print location
23
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
e that you should
be able to modify easily to meet your needs.
http://docs.python.org/lib/telnet-example.html
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
ok at itertools izip. zip creates
a list of lists which could take lots of memory/time if they are VERY
large. itertools izip iterates over them in place.
from itertools import izip
for a_item, b_item, c_item in izip(a,b,c):
# do something
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
; but the output's the same.
>
> Rich
Use the interpreter to test things:
a="(u'ground water',)"
a[2:-2]
"'ground water'"
a[3:-3]
'ground water'
That is what you are looking for.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
almost always interfere
in some way with the editors (same was true for ActiveState). Maybe
you could give that a try.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
st let the registered .PDF viewer do it for you.
os.start('myfile.pdf')
Launches whatever is registered as .PDF viewer and user
can then print, save, zoom, etc. on their own.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
plications?
>
>
>
> I would appreciate any help.
>
>
>
> Also, does anyone know of any good Linux or python user groups in the orange
> county, California area?
>
>
Pick up a copy of "Python Cookbook" from O'Reilly.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
Grant Edwards wrote:
> On 2007-02-12, Larry Bates <[EMAIL PROTECTED]> wrote:
>
>>> I at least need the code for useing some library for
>>> connecting to acrobat reader and giving the print command on
>>> windows and some thing similar on ubuntu linux.
>
Grant Edwards wrote:
> On 2007-02-12, Larry Bates <[EMAIL PROTECTED]> wrote:
>> On 2007-02-12, Larry Bates <[EMAIL PROTECTED]> wrote:
>>>>> I at least need the code for useing some library for
>>>>> connecting to acrobat reader and giving the pr
vj wrote:
> Would really appreciate the binary files for the db_row.
>
> Thanks,
>
> VJ
>
If you don't get an answer you may want to take a look
at replacing with SQLObject:
http://sqlobject.org/
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
ep(5)
>servicemanager.LogMsg(
>servicemanager.EVENTLOG_INFORMATION_TYPE,
>servicemanager.PYS_SERVICE_STOPPED,
>(self._svc_name_, "")
>)
>self.logger.info("Stopped")
>except:
>self.logger.error('',exc_info = sys.exc_info())
>
>
> if __name__=='__main__':
>win32serviceutil.HandleCommandLine(Service)
>
>
I was using _ssl.pyd to upload files to DAV server over ssl and
found it to be a problem. I upgraded to Python 2.5 and the problem
was fixed. I don't know if it is the same problem that is affecting
you, but I couldn't get it to work on 2.4.
FYI, Larry
--
http://mail.python.org/mailman/listinfo/python-list
pass
#--End while--
#-----
# Log stopped message to EventLog
#-
servicemanager.LogMsg(servicemanager.EVENTLOG_INFORMATION_TYPE,
servicemanager.PYS_SERVICE_STOPPED,
(self._svc_name_, ''))
return
Note: I pieced this together from a working service, it has NOT been
tested. It should be VERY close.
If you don't have it already you might want to pick up a copy of
Python Programming on Win32 by Mark Hammond and Andy Robinson. It helped
me a LOT.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
exception and continue your loop.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
work:
flts=[float(i) for i in range(1, 11)]
If you want arbitrary starting and ending floats and an
arbitrary step, you will need to write your own function.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
27;m somewhat new to python but this makes sense to me.
>
finally: block is executed even if there is an exception in which case f
hasn't been defined. What you want is:
try:
f = file(self.filename, 'rb')
f.seek(DATA_OFFSET)
self.__data = f.read(DATA_S
web server does the authentication on the
server side. Why not use Apache to do the digest authentication?
http://httpd.apache.org/docs/2.0/mod/mod_auth_digest.html
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
stdazi wrote:
> Hello!
>
> Many times I was suggested to use xrange and range instead of the
> while constructs, and indeed, they are quite more elegant - but, after
> calculating the overhead (and losen flexibility) when working with
> range/xrange, and while loops, you get to the conclusion that
stat(x).st_mtime, x) for x in files]
#
# Sort them. Sort will sort on mtime, then on filename
#
flist.sort()
#
# Extract a list of the filenames only and return it
#
return [x[1] for x in flist]
#
# or if you only want the basenames of the files
#
#return [os.path.basename(x[1]) for x in flist]
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
t priviledge? Then what is supposed to
> happen? Can anyone give me a clue? Thanks.
>
I'm no expert, but I think what normally happens is the module gets
installed into ../pythonxx/lib/site-packages/ and if it
installs __init__.py file there they get automatically searched.
At least tha
ot;Hex: ", hex
print "Len(hex):", len(hex)
nonhex=HexTostr(hex)
#testStr = tinycode(keyStr, etestStr, reverse=True)
testStr = tinycode(keyStr, nonhex, reverse=True)
print "Decrypted string:", testStr
WARNING: THIS IS NOT A STRONG ENCRYPTION ALGORITHM. It is just a
nuisance for someone that really wants to decrypt the string. But
it might work for your application.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
ell
> Jython where to search for imported modules? Thanks.
>
Maybe Jython expert has the perfect answer but til then.
Did you try:
sys.path.append('path to search')
Usually this works if nothing else does.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
s.
>
> Can anyone help me?
>
> Regards,
>
> Sam
>
I'll bet that some of the best information you can get about interacting
with Outlook is going to be by looking at the sourcecode to SpamBayes
plug-in. You can get it from here:
https://sourceforge.net/project/s
x27;t mean you could
do anything with the machine. I assume that you are connecting to
do something on the machine. Just wrap what you are trying to do
in try: block. It will either succeed or fail. Handle the exeption.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
27;t found in my searches so far. If so, I will humbly accept
> any ridicule that comes along with said simple solution :-).
>
> Thanks in advance,
> Brandon
Normally this would be:
f = os.popen('./wrapper_dir/utility_dir/some_external_utility')
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
a)
Convert integer to ascii string:
a=1
b=str(a)
or
a=1
b="%i" % a
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
ects, there is no documentation about
> what to do with them :(
>
> Thanks for your help!
I've always used the struct module to unpack the C array into the floats
(or ints or strings or ...) that I wanted.
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
vice
> versa
>> in Python?
>>
>> Thanks!
>>
>>
>
>
The phrasing of your question threw us all. What you want is chr
backslash=chr(92)
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
UnicodeDecodeError:
> print "file.py contains non-ascii characters"
>
>
The next problem will be that non-text files will contain non-ASCII
characters (bytes). The other 'issue' is that OP didn't say how large
the files were, so .read() might be a problem.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
;
> P.S. The respective mailing list does not like me, so that I try my
> luck here.
I quick search of Google turned up:
http://books.google.com/books?id=1Shx_VXS6ioC&pg=PA625&lpg=PA625&dq=python+rational+number+library&source=web&ots=BA8_4EXdQ4&sig=aDEnYA99ssKe7PSweVNyi8cS2eg
http://calcrpnpy.sourceforge.net/clnum.html
http://gmpy.sourceforge.net/
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
the idea of prototype associated with it for no clear reason).
What you describe is exactly how Zope works so you might want to spend
some time looking at it.
http://www.zope.org
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
ommunication (via sockets, pipes, filesystem,
database, ...). That way your A's won't have the problem you describe.
Just a suggestion.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
cause you need mscvr71.dll and w9xpopen.exe at a
minimum as external files. If you want to have only 1 .EXE to
distribute, use Inno Installer. Your users will thank you for
having a proper installer, uninstaller.
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
the last 2
> hours??...)
>
>
> Thanks for a any enlightenment...
>
I think your problem is that C$ is a "special" share. Try creating
a share and connect to it instead. It is either that your your userid/
password are in fact incorrect.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
scp file to local computer
> 3. make sure file size of copy and original are the same
>
> any suggestions would be appreciated
>
> thanks
> gabe
>
Why not just use rsync across the ssh tunnel to synchronize the remote
file to local file? This works great and you don't have to do much.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
"Pythonic design" is not to worry about it.
If users want to set attributes that won't accomplish anything
productive (within your class) let them.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
def __init__(self, fp=None):
self.fp=fp
def endElement(self, name:
doSomething(self, "GroupResultList", self.text, self.fp)
but you could set it later if you like:
fp = open('dummyFile.txt')
curHandler=LogHander()
curHandler.fp=fp
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
list
class foo:
def __init__(self):
self.somelist=['a','b','c']
self.bars=[]
self.bars.append(bar(self))
At least that's the way I understand it and it seems to work. If
this isn't what you are asking just disregard.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
llows you:
MySQL databases
root access to your virtual machine
By the time you do the research and/or write something you will have spent more
time than moving to another ISP. Its not all that hard and they are CHEAP.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
int me to a
> simple step by step guide for installing Eric? I've downloaded the tar
> files, but what do I do with them?
>
> Thanks
>
Take a look at PyScripter also. I REALLY like it a lot on Windows:
http://mmm-experts.com/Products.aspx?ProductId=4
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
rom it.
Lots of discussions on this have been posted try looking into history of this
list. Everything from vi to Eclipse to Wing.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
s that you go through the process to
get a proper zip file.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
le to check if the URL already exist.
>
> Couldn't find any python library that implements trees.
> Is there some library of this kind in python? Or can I find it
> somewhere else?
>
Put them into a set. You can check for existence (very fast) and at the end it
is easy to sort.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
for i in range(num):
> self.list.CheckItem(i)
>
> def OnDeselectAll(self, event):
> num = self.list.GetItemCount()
> for i in range(num):
> self.list.CheckItem(i, False)
>
> def OnApply(self, event):
> num = self.list.GetItemCount()
> for i in range(num):
> if i == 0: self.log.Clear()
> if self.list.IsChecked(i):
> self.log.AppendText(self.list.GetItemText(i) + '\n')
>
> app = wx.App()
> Repository(None, -1, 'Repository')
> app.MainLoop()
>
>
>
> If you see what I'm doing wrong I'd be grateful for any help.
>
> Mike
>
You probably will want to post over at gmane.comp.python.wxpython. A lot more
wx people (including wxPython author) over there.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
ith using [] as default arguments. Mutables are only
evaluated
once (not at every call). This question comes up about once a week on this
forum where people don't understand this.
I would recommend using (if you can):
def __init__(self, connected = None, weights=None, uid = None):
self.connected = connected or []
self.weights = weights or []
If you want to stay with single connections list do this:
def __init__(self, connections = None, uid = None):
if connections is not None:
self.connected=[c[0] for c in connections]
self.weights=[c(1) for c in connections]
else:
self.connected=[]
self.weights=[]
Others have addressed the lack of need for accessors.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
gamename wrote:
> Hi,
>
> In TCL, you can do things like:
> set foobar "HI!"
> set x foo
> set y bar
> subst $$x$y
> HI!
>
> Is there a way to do this type of evaluation in python?
>
> TIA,
> -T
>
myStore={}
myStore['foobar
ven find writing to file and then loading it is very fast. I
recommend tab delimited as that seems to work well.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
ule. For
> my users who install my Windows application, I'd prefer that they not
> have to install the entirety of Python on their machines.
>
> Thanks much,
> D
Turn the Python program into a COM object instead. Then it can be dispatched
by
any programming language and distr
self.filename = 'unknown'
else:
self.filename = filename
fileobj = file(filename, "rb")
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
the
printer in binary mode and write to it directly. If it is a networked printer
you will need to write to the spooler.
printer=open("LPT1", "wb")
printer.write(int('01b', 16), int('40', 16)
printer.close()
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
tnered with developers to use our product WebSafe to provide secure
software distribution (among other uses for the service). Take a look at:
http://www.websafe.com. We have a special program for developers that allows
you to put our API inside your application as well.
Larry Bates
Vi
age with python? Thanks!
>
> The images are separate from the html document. You have to parse the
> html text, find the tags, and retrieve them.
>
Actually IMHO this is even more difficult than it sounds. Javascript can
change
the webpage after it loads.
Larry
--
http://mail.python.org/mailman/listinfo/python-list
value * 2.
That should get you the unsigned value you want in a long.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
Diez B. Roggisch wrote:
> Larry Bates wrote:
>
>> eliss wrote:
>>> I'm using dl.call() to call a C function in an external library. It's
>>> working great so far except for one function, which returns an
>>> unsigned int in the C version. Howev
7;)
> print coord
>
>
> ___
>
> the result is 'None' ...
>
> If I print out the kml with tostring I can see the entire file and to
> me the XPath string also seems correct
>
> any idea?
This works:
>>> url='http://e
--
>> Looking for last minute shopping deals? Find them fast with Yahoo!
>> Search.
>> <http://us.rd.yahoo.com/evt=51734/*http://tools.search.yahoo.com/newsearch/category.php?category=shopping>
>>
>>
If you know the string doesn't contain anything evil (that is you control where
it comes from) you can also do:
mylist=eval(s)
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
do you think you need the line numbers)? Extraction is done
using tags not line numbers. All that said, you should look at Beautiful Soup
module before continuing.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
string. IMHO regular
expressions are overkill for the task you describe. You may be better served
to
just try to convert it to whatever number you want.
try:
value=int(string1)
except ValueError:
# do whatever you want for non integers here
else:
# do whatever you want for integers here
Or use string methods:
if string1.isdigit():
print "digits found"
else:
print "alphas found"
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
s.stdout.write(chr(27)+'[2J')
sys.stdout.flush()
Unfortunately that doesn't clear the screen because the ANSI module isn't
loaded
by default. Use os.system('cls') as mentioned instead.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
think wxWindows works extremely well but the learning curve is quite steep.
The upside is that it is cross-platform and there is virtually nothing you
can't
write using wxPython/Windows. BTW-They hae an excellent newsgroup at:
gmane.comp.python.wxpython
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
rom web browser. Does this sound at all like
what
you are looking for? No firewall issues and I even tunneled ports securely
over
ssh and it worked flawlessly.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
ion with free variables
>
> I have no reason why you're getting the error, but there is no reason to try
> to exec an import. Just use
>
> import sys
>
> Hope that helps.
>
> j
>
Don't exec "import sys" just do import sys.
Also.
a=range(15)
b=[13,3]
c=filter(lambda x: x not in b,a)
is just:
c=[x for x in xrange(15) if x not in [13,3]]
IMHO this is much easier to read.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
periodically "pack" the file with a
separate process. That could run unattended (e.g. at night). Or, if I did this
a lot, I would use a database instead.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
If I do, a
good editor with search/replace seems to do the trick. I find it quite
uncommon
to change the "types" of arguments, but when I do, I can use duck typing to
work
around that as well. Hang in there, you will get it.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
ormat send to interpreter after preprocessing:
>
>>>> b = 10*a + 0.1
>
>
> Best regards
>
> Stefan Salewski
>
I'm no expert, but I'll bet that pyparsing module will be the answer to your
question.
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
say if the Linux server was local or not. If local, you could use
SAMBA to create a SMB share and have the XP PC get to it that way. There are
other ways, but these should get you started.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
the
contents. If you read if from a user they could type in:
os.system('rm -rf *') or os.system('del *.*')
eval that and it deletes all the files on your disk
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
f '00:00:00.00', would i use regular expressions?
You could use regular expressions or you might want to take a look at
Beautiful Soup http://www.crummy.com/software/BeautifulSoup
to parse the page and replace the offending text.
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
w.
You will find that most Python programmers bristle at words like
"missing", "enforcement" and "strictly defined the type". Python
programmers just don't work that way. The fact that programmers in
other languages must, is their loss.
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
Zope presents objects/folders via WebDAV. It isn't "simple",
but it works and is a Python "thing".
On Windows you can get a demo of GroupDrive here:
http://www.webdrive.com/products/groupdrive/index.html
-Larry Bates
robert wrote:
> For testing purposes I'
object such as a list or dictionary used as default value will be shared
by all calls that don't specify an argument value for the corresponding slot;
this should usually be avoided.
Change to something like:
__init__(self,seg=None,value=0,description=""):
self.segment=seg or [0,0,0,0,0,0]
self.value=value
self.description=description
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
included'?
>
> I hope that question even makes sense! :)
I believe Python is unique in the depth of the standard library when
compared to most languages. Most require that you purchase or get many
of the "batteries" from somewhere outside the standard distribution.
Thi
big brother ReportLab PDF generator, but works equally well. In
addition, it works well if you want to put graphs into .PDF documents.
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
not), you should look at
the Python plug-in for Eclipse.
Remember that Python is so dynamic that you can build dependencies
during program execution and import them on-the-fly. So a dependency
checker would always be incomplete. You always need to write unit
tests.
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
on works:
ReportLab PageCatcher - reads .PDF background templates (note: not free)
ReportLab - allows you to write on top of the .PDF template to produce
a .PDF file as output.
The results are a very high quality .PDF output document.
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
igParser()
INI.read(inifilepath)
section="directories"
dirs=[x for x in INI.options(section) if x.startswith('dir_')]
or more easily:
[init]
dirs=/home/florian,/home/john,home/whoever
and in program do:
section="init"
dirs=INI.get(section, 'dirs'
ontinuations are represented by an embedded newline then
leading whitespace.
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
Python to execute a method on an uninstantiated
class. I can't imagine how you would use such a thing. Can you
give us a real-life "use case"?
This produces the output you want:
m=MyClass()
print m.prop()
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
ys return true.
>
> Any hints on what I'm missing?
>
> Thanks,
>
> -tkc
>
>
While I have never needed anything like this in my 5 years of Python
programming, here is a way:
a,b,c = 3*[0]
q,r,s,t,u,v = 6*[0]
of if you like:
def zeros(num):
return num*[0]
a
Just wrote:
> In article <[EMAIL PROTECTED]>,
> Larry Bates <[EMAIL PROTECTED]> wrote:
>
>> While I have never needed anything like this in my 5 years of Python
>> programming, here is a way:
>>
>> a,b,c = 3*[0]
>> q,r,s,t,u,v = 6*[0]
>
&
lapsed time=0.05 seconds
sets elapsed time=0.03 seconds
There may be other ways using bisect or some other module. If data
is random, unsorted or has duplicates, I would look at in-memory
database like SQLlite instead.
If the values are unique you can do something like:
a=set(range(10))
b=set(rang
_value.
Normally you do something like:
l_value=None
.
. Intervening code
.
if l_value is None:
print "l_value uninitialized"
Or (something I never use):
if not locals().has_key('l_value'):
print "l_value uninitialized"
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
om (not recommended unless you don't control the
format of the file).
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
ve
the method (e.g. sort of like local variables in a function). If
you want them to be instance attributes the "self." is required.
Now if you use them a lot you can create shortcuts inside the
method. The lack of "self." is how python knows if this is
a temporary lo
ce
>>
>> thank you all again!
>
> Be warned that this may /add/ items to a:
>
>>>> set("abc").symmetric_difference("bcd")
> set(['a', 'd'])
>
> If your subject is correct you want difference(), not
> symmetric_difference().
>
> Peter
Whoops. My bad. Peter is correct.
-Larry
--
http://mail.python.org/mailman/listinfo/python-list
mulator = accumulator + data
> gives a list of tuples which when printed looks like
> ('jack', 'bony', 'J')
> ('sam', 'lee', 'S')
> ...
>
> how can I get the output in the formate
> jack bony J
> sam lee S
> ..
r.index() dosn't work because...
>
> str = "hello world"
> for i in str:
> print str.index(i)
>
> 0
> 1
> 2
> 2
> 4
> 5
> 6
> 4
> 8
> 2
> 10
>
> Every 'e' in "hello world" has the same index value. Am i missing somthing?
Split the string on '=', and join it back with '=#'.
s='=#'.join(s.split('='))
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
Check out the csv module.
-Larry Bates
Gary Wessle wrote:
> Hi
>
> I have a file with data like
> location pressure temp
> str flootfloot
>
> I need to read pressure and temp in 2 different variables so that I
> can plot them as lines. is there a package wh
end(i)
> return outputlist
> movelist = [1,2,3,4,5,6,7,8,9,10,11]
> print chopupmoves(movelist)
>
Try something like this:
def chopupmoves(movelist):
return [movelist[0:3], movelist[3:6], movelist[6:]]
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
end(i)
> return outputlist
> movelist = [1,2,3,4,5,6,7,8,9,10,11]
> print chopupmoves(movelist)
>
Try something like this:
def chopupmoves(movelist):
return [movelist[0:3], movelist[3:6], movelist[6:]]
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
Check out the csv module.
-Larry Bates
Gary Wessle wrote:
> Hi
>
> I have a file with data like
> location pressure temp
> str flootfloot
>
> I need to read pressure and temp in 2 different variables so that I
> can plot them as lines. is there a package wh
port sys
def write_data(data, out_file=None):
if out_file is None:
fp = sys.stdout # how to connect standard output to fp?
else
fp = open(out_file,"w")
fp.write(data)
# more fp.write() statements follow
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
application
as a Windows Service and have it sleep for however long you
want. It won't impact your system looping and sleeping.
It will also be asynchronous, as it will sleep for time you
specify, run your code to completion and then sleep again
which isn't the same as running
TML POST
action=upload doesn't give you anything to work with to provide such
information to the client's browser (if it does I'm not aware of it
anyway). It also would take something like JavaScript and XMLRPC on
the client to make the round trip to get updated progress information.
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
2) Either s=str(n) or s="%i" % n will return string
containing '5' (without the quotes of course).
Note: chr(n) would return character whose ASCII decimal
value is 5 (ASCII ENQ).
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
g thumbnail is supposed to be < 10 kb...
>
> Thank You,
>
> Almad
>
JPEG quality 200 is overkill, btw -- it completely disables JPEG's
quantization stage, and "mainly of interest for experimental pur-
poses", according to the JPEG library documentation, which
conti
le. Note
that O/S is saying that permission is denied to the folder name
stored in self.output:
"D:\\Szymek\\python\\pythumb\\images\\proba"
You most likely meant:
img.save(os.path.join(self.output, file), "JPEG", optimize=1)
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
htininches, weightinpounds)]
except IndexError:
print "height/weight combination not found in lookup table"
-Larry Bates
--
http://mail.python.org/mailman/listinfo/python-list
1301 - 1400 of 1904 matches
Mail list logo