Steven Bethard wrote:
> Steve M wrote:
>> I'm actually doing this as part of an exercise from a book. What the
>> program is supposed to do is be a word guessing game. The program
>> automaticly randomly selects a word from a tuple. You then have the
>> oportun
a string. In one of the forms:
'1,2,3,4' or '1:4'
The numbers can be either message sequence numbers or uids.
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
g an encoding:
ust = unicode(st)
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
able.
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
hared effort" in the
single sub-project, it might very well be on a higher level.
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
can be a little simpler:
listA = list(Set(listA))
You don't even need to convert it to a list. You can just iterate over
the set.
>>> la = [1,2,3,4,3,2,3,4,5]
>>> from sets import Set
>>> sa = Set(la)
>>> for itm in sa:
... print itm
1
2
3
ted sub entries into a list
of strings?
In Twisteds protocols/imap4.py module there is a function called
parseNestedParens() that can be ripped out of the module.
I have used it for another project and put it into this attachment.
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad S
x27;t support unicode, but you should not have problem
importing/exporting encoded strings.
I have imported utf-8 encoded string with no trouble. But I might just
have been lucky that they are inside the latin-1 range?
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Scien
Gregor Horvath wrote:
thanks are given to all
"problem" solved...
Personally I add a , after every list/tuple item. Also the last.
It also makes copy/pasting code easier.
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/
Convention
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
Brian Quinlan wrote:
> Max M wrote:
>
>> Is there any codec available for handling The special UTF-7 codec for
>> IMAP?
> Is there something special do you need or is recipe OK?
>
> >>> u"\u00ff".encode('utf-7')
> '+AP8-'
A
dice1, dice2 = rolldice()
roll += 1
if dice1 + dice2 == 7:
print 'Too bad, you loose in roll %s' % roll
result = None
elif (dice1, dice2) == (first1, first2):
print 'Congratulations, you win in roll %s' % roll
result = None
Hopefully h
Dan Perl wrote:
"Max M" <[EMAIL PROTECTED]> wrote in message
Most of us here have been students (or still
are) and may sympathize with the OP, but personally I have been also a TA so
I have seen the other side and that's where my sympathy lies now.
My reply was a joke... M
://initd.org/projects/psycopg1
Postgres runs fine on Windows now in a native version. And pgAdmin is a
pretty nice tool.
A precompiled psycopg is the missing link. Thanks. I will try it out.
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/ma
app and restart it later, there'd be a way to bring d back
into the process and have that Frob instance be there.
Have you considdered using the standalone ZODB from Zope?
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
u might be more comfortable with:
data = [['foo','bar','baz'],['my','your'],['holy','grail']]
result = []
for l in data:
result += l
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
Max M wrote:
I tried funnies like [[w for w in L] for L in data],
That is absolutely correct. It's not a funnie at all.
well, syntactically correct or not, it doesn't do what he want...
Doh! *I* might not be used to list comprehensions then... You are right.
Th
nd stuff. You should get tons of answers.
##
st = '80 00 00 00'
import binascii
import struct
s = ''.join([binascii.a2b_hex(s) for s in st.split()])
v = struct.unpack("f", s)[0]
print v
##
regards Max M
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
ftware/BeautifulSoup/
I will most likely do what you want in 2 or 3 lines of code.
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
t the time taken to convert a list into a tuple.
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
return st_encoded, encoding
except UnicodeError:
pass
st = 'Test characters æøå ÆØÅ'
encodings = ['utf-8', 'latin-1', 'ascii', ]
print get_encoded(st, encodings)
(u'Test characters \xe6\xf8\xe5 \xc6\xd8\xc5', '
using those email adresse, or you don't log on
with the correct credentials.
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
The entity Fredrik Lundh wrote:
Isn't it about time you became xml avare, and changed that to:
?
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
Max M wrote:
Isn't it about time you became xml avare, and changed that to:
Yeah, but give the guy a break, we've all made feeble attempts at humor
from time to time.
Hey, what's wrong with a little nørd humor...
I just found it amusing that somenone like Fred
to find those than it is to use them as the
sender.
Most email clients can fetch the settings from other mail clients, so
it's been done before.
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
project which does that on different platforms. But I am
not aware how well they work.
The best place to ask is probably on the Python Midi list at:
http://sourceforge.net/mail/?group_id=113783
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/ma
= MapiMessage(0, subject, body, None, None, None, 0,
cast(NULL, lpMapiRecipDesc), RecipCnt, recip,
nFileCount, lpFiles)
rc = MAPISendMail(0, 0, byref(msg), 0, 0)
if rc != SUCCESS_SUCCESS:
raise WindowsError, "MAPI error %i" % rc
---
Looks good.
Lenard Lindstrom
Nice quoting
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
Max M wrote:
Lenard Lindstrom wrote:
So what is this, some kind of competition? If you really though Lenard's
quoting was a sin (since I took your remarks to be sardonic), how much
more so was your gratuitous repetition thereof?
I thought that showing by example might h
#x27;)()
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
I recently saw this:
http://www.egenix.com/files/python/mxTools.html
mx.Tools.verscmp(a,b)
Compares two version strings and returns a cmp() function
compatible value (<,==,> 0). The function is useful for sorting lists
containing version strings.
The logic used is as follows: the string
Hi,
I am trying to grok using actor patterns in a gui as explained here by
Andrew Eland:
http://www.andreweland.org/code/gui-actor.html
The short article explains it using java with which i am not used to
at all. But he does provide a python example using pygtk:
http://www.andreweland.org/code/g
ror
Why do you need the 'HEADER'
Wouldn't this be enough?
resp, items = server.search(None, 'Message-id', msgID)
I am note shure if the msgId should be quoted. I assume not, as it will
allways be an integer.
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
are you going to fix it?
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
_string, substring) # note the order
searched_string=""
print string.find(searched_string, substring)
You will not make that error if you use the string method instead.
searched_string.find(substring)
And you don't have to import anything either..
--
hilsen/regards Max M, Denmar
Hmm... no takers? Too bad, the pattern and it's implementation in
python is pretty interesting...
[EMAIL PROTECTED] (M Ali) wrote in message news:<[EMAIL PROTECTED]>...
> Hi,
>
> I am trying to grok using actor patterns in a gui as explained here by
> Andrew Eland:
>
at this a while ago, which might be a starter.
http://pyrtf.sourceforge.net/
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
your
strings as unicode, do the transfom, and encode it back as latin1.
print repr('før'.decode('latin-1').upper().encode('latin-1')) #
'F\xd8R'
print repr('FØR'.decode('latin-1').encode('latin-1'))
'F\xd8R'
--
hilsen
I see that the last 255 bytes are missing.
How is this possible, I receive every last byte from stdin?
I don't think its a Python problem. Those methods are used in a lot of
places. Your file is most likely not what it is supposed to be.
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
praba kar wrote:
Dear All,
I am new to Python I want to know how to
change a time into timestamp
Is there any specific reason for not using datetime instead of time ?
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
>From your site:
"The reason some people don't know for sure if they are going to Heaven when
they die is because they just don't know."
Isn't that like saying the reason I'm not a rocket scientist is because I'm
not a rocket scientist?
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTEC
Matthew Thorley wrote:
I am creating an object database to store information about network
devices, e.g. switches and routers.
Possible usefull pages?
http://www.python.org/doc/essays/graphs.html
more at:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/119466
--
hilsen/regards Max M
import sys, traceback
def e2str(id):
"""Return a string with information about the current exception. id
is arbitrary string included in output."""
exc = sys.exc_info()
file, line, func, stmt = traceback.extract_tb(exc[2])[-1]
return("%s: %s line %s (%s): %s" % (id, func, line, rep
ecode such a
subject, returning a unicode string? The use would be like
human_readable = cool_library.decode_equals(message['Subject'])
parts = email.Header.decode_header(header)
new_header = email.Header.make_header(parts)
human_readable = unicode(new_header)
--
hilse
I just happened across the page linked to below, and remembered this
thread, and, well... here you go:
http://www.lyra.org/greg/python/
Executable .pyc files
Ever wanted to drop a .pyc file right into your web server's
cgi-bin directory? Frustrated because the OS doesn't know what to do
with
Hello guys,
I am using the asyncio package (Codename 'Tulip'), which will be
available in Python 3.4, for the first time.
I want the event loop to run a function periodically (e.g. every 2
seconds). PEP 3156 suggests two ways to implement such a periodic call:
1. Using a callback that resched
Thanks a lot for your helpful posts, Terry!
On 11/23/2013 01:00 AM, Terry Reedy wrote:
* Make the task function a parameter 'func'.
I actually like subclassing, but yes I know there are some downsides :)
* Rename start to _set to better describe what is does and call it in
the _run function
, Tobias M. wrote:
>> Now putting this into a PeriodicTask class that provides a similar
>interface
>> like our callback version, I get:
>>
>>
>> import asyncio
>>
>> class PeriodicTask2(object):
>>
>> def __init__(self, func, interval):
Hello,
I am currently writing an event-driven client library for a network
protocol [1] and chose to use the new asyncio module. I have no
experience with asynchronous IO and don't understand all the concepts in
asyncio yet. So I'm not sure if asyncio is actually the right choice .
My goal:
Thanks for your answers! I didn't have the time to test any of your
suggestions so far but they already gave me something to think about. At
least now I'm much more clearer on what I am actually looking for.
On 23.12.2013 20:59, Terry Reedy wrote:
What would be easiest for user-developers wou
On 24.12.2013 17:07, vanommen.rob...@gmail.com wrote:
Hello, for the first time I'm trying te create a little Python program. (on a
raspberri Pi)
I don't understand the handling of variables in a loop with Python.
Lets say i want something like this.
x = 1
while x <> 10
var x = x
On Monday, December 28, 2015 at 10:35:41 AM UTC-5, Brian Simms wrote:
> Hi there,
>
> I have done a lot of looking around online to find out how to convert Python
> files to .exe and .dmg files, but I am confused. Could someone provide
> pointers/advice as to how I can turn a Python file into a
I'm parsing html and i'm doing:
x = root.find_class(...
y = root.find_class(..
z = root.find_class(..
all 3 are likely to fail so typically i'd have to stick it in a try. This is
a huge pain for obvious reasons.
try:
except something:
x = 'default_1'
(repeat 3 times)
Is there some other
Chris Angelico wrote:
> On Sun, Jan 31, 2016 at 3:58 PM, Veek. M wrote:
>> I'm parsing html and i'm doing:
>>
>> x = root.find_class(...
>> y = root.find_class(..
>> z = root.find_class(..
>>
>> all 3 are likely to fail so typically i&
Veek. M wrote:
> Chris Angelico wrote:
>
>> On Sun, Jan 31, 2016 at 3:58 PM, Veek. M wrote:
>>> I'm parsing html and i'm doing:
>>>
>>> x = root.find_class(...
>>> y = root.find_class(..
>>> z = root.find_class(..
>>
Thanks guys: you've given me some good ideas - I really need to re-read
the lxml docs for xpath. (basically trying to scrape ebay and score a
mobo - ebaysdk doesn't work) Also need to google those principles :)
thanks! (i knew one shouldn't overly rely on chained attribute lookups -
didn't fig
Exceptions can be raised inside a coroutine using the throw(
Exceptions raised in this manner will originate at the currently
executing yield state-ment in the coroutine.A coroutine can elect to
catch exceptions and handle them as appropriate. It is not safe to use
Veek. M wrote:
>
> Exceptions can be raised inside a coroutine using the throw(
>
> Exceptions raised in this manner will originate at the currently
> executing yield state-ment in the coroutine.A coroutine can elect to
> catch exceptions
Ian Kelly wrote:
> On Mon, Feb 8, 2016 at 2:17 AM, Veek. M wrote:
>>
>> Exceptions can be raised inside a coroutine using the throw(
>>
>> Exceptions raised in this manner will originate at the currently
>> executing yield state-ment
I'm writing a price parser. I need to do the equivalent of perl's
$$var to instantiate a class where $car is the class_name.
I'm passing 'Ebay' or 'Newegg' or 'Amazon' via cmd-line. I have a module
named ebay.py and a class called Ebay (price parser). I do something
like:
\> main.py ebay mother
Rick Johnson wrote:
> On Saturday, February 13, 2016 at 10:41:20 PM UTC-6, Veek. M wrote:
>> how do i replace the 'Ebay' bit with a variable so that I
>> can load any class via cmd line.
>
> Is this what you're trying to do?
>
> (Python2.x code)
Gregory Ewing wrote:
> Veek. M wrote:
>> I'm writing a price parser. I need to do the equivalent of perl's
>> $$var to instantiate a class where $car is the class_name.
>>
>> I'm passing 'Ebay' or 'Newegg' or 'Amazon' via c
When I do at the interpreter prompt,
repr( open('/etc/motd', 'rt').read() )
i get # 1 #:
"'\\nThe programs included with the Debian GNU/Linux system are free
software;\\nthe exact distribution terms for each program are described
in the\\nindividual files in /usr/share/doc/*/copyright.\\n\\nDe
In Doug Hellman's book on the stdlib, he does:
import threading
import logging
logging.basicConfig(level=logging.DEBUG,
format=’(%(threadName)-10s) %(message)s’,
)
class MyThreadWithArgs(threading.Thread):
def __init__(self, group=None, target=None, name=None,
args=(), kwargs=None
I want to do something like:
#!/usr/bin/env python3
fh = open('/etc/motd')
for line in fh.readlines():
print(fh.tell())
why doesn't this work as expected.. fh.readlines() should return a
generator object and fh.tell() ought to start at 0 first.
Instead i get the final count repeated for th
Terry Reedy wrote:
> On 2/27/2016 4:39 AM, Veek. M wrote:
>> I want to do something like:
>>
>> #!/usr/bin/env python3
>>
>> fh = open('/etc/motd')
>> for line in fh.readlines():
>> print(fh.tell())
>>
>> why doesn't th
MRAB wrote:
> On 2016-03-04 13:04, Veek. M wrote:
>> Terry Reedy wrote:
>>
>>> On 2/27/2016 4:39 AM, Veek. M wrote:
>>>> I want to do something like:
>>>>
>>>> #!/usr/bin/env python3
>>>>
>>>> fh = open('/etc
1. What are the rules for using __del__ besides: 'don't use it'.
2. What happens when I SystemExit? __del__ and gc are not invoked when I
SystemExit and there's a circular reference - but why? The OS is going
to reclaim the memory anyways so why be finicky about circular
references - why can't
Veek. M wrote:
> 1. What are the rules for using __del__ besides: 'don't use it'.
>
> 2. What happens when I SystemExit? __del__ and gc are not invoked when
> I SystemExit and there's a circular reference - but why? The OS is
> going to reclaim the memory anywa
Steven D'Aprano wrote:
> On Monday 07 March 2016 17:13, Veek. M wrote:
>
>> import foo
>> class Bar(object):
>> def __del__(self, foo=foo):
>> foo.bar()# Use something in module foo
>>
>> ### Why the foo=foo? import foo, would incre
import socket
class Client(object):
def __init__(self,addr):
self.server_addr = addr
self.sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
self.sock.connect(addr)
def __getstate__(self):
return self.server_addr
def __setstate__(self,value):
self.server_addr = value
self.s
What is the return value of `exec`? Would that object be then used to
iterate the sequence in 'a'? I'm reading this:
https://www.python.org/download/releases/2.2.3/descrintro/
--
https://mail.python.org/mailman/listinfo/python-list
Ben Finney wrote:
> "Veek. M" writes:
>
>> What is the return value of `exec`?
>
> You can refer to the documentation for questions like that.
> https://docs.python.org/3/library/functions.html#exec>
>
>> Would that object be then used to iterate th
Steven D'Aprano wrote:
> On Wednesday 09 March 2016 16:27, Veek. M wrote:
>
>> What is the return value of `exec`? Would that object be then used to
>> iterate the sequence in 'a'? I'm reading this:
>> https://www.python.org/download/releases/2.2.3/de
dieter wrote:
> "Veek. M" writes:
>
>> import socket
>> class Client(object):
>> def __init__(self,addr):
>> self.server_addr = addr
>> self.sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
>> self.sock.connect(addr)
>>
Ian Kelly wrote:
> On Wed, Mar 9, 2016 at 2:14 AM, Veek. M wrote:
>> what i wanted to know was, x = Client('192.168.0.1') will create an
>> object 'x' with the IP inside it. When I do:
>> pickle.dump(x)
>> pickle doesn't know where in the
A property uses the @property decorator and has @foo.setter
@foo.deleter.
A descriptor follows the descriptor protocol and implements the __get__
__set__ __delete__ methods.
But they both do essentially the same thing, allow us to do:
foo = 10
del foo
x = foo
So why do we have two ways of doin
Veek. M wrote:
> A property uses the @property decorator and has @foo.setter
> @foo.deleter.
>
> A descriptor follows the descriptor protocol and implements the
> __get__ __set__ __delete__ methods.
>
> But they both do essentially the same thing, allow us to do:
> foo
Ian Kelly wrote:
> On Fri, Mar 11, 2016 at 10:59 PM, Veek. M wrote:
>> A property uses the @property decorator and has @foo.setter
>> @foo.deleter.
>>
>> A descriptor follows the descriptor protocol and implements the
>> __get__ __set__ __delete__ methods.
>&
Thomas 'PointedEars' Lahn wrote:
>> I haven't read the descriptor protocol as yet.
>
> You should. You should also trim your quotations to the relevant
> minimum, and post using your real name.
>
I don't take advice from people on USENET who DON'T have a long history
of helping ME - unless I'
Thomas 'PointedEars' Lahn wrote:
> Veek. M wrote:
>
>> Thomas 'PointedEars' Lahn wrote:
>>>> I haven't read the descriptor protocol as yet.
>>> You should. You should also trim your quotations to the relevant
>>> minimum, and p
Thomas 'PointedEars' Lahn wrote:
>>> Nobility lies in action, not in name.
>>> —Surak
Someone called Ned.B who i know elsewhere spoke on your behalf. I'm glad
to say I like/trust Ned a bit so *huggles* to you, and I shall snip.
Also, sorry about the 'Steve' thing - bit shady dragging in
y." |
> _o__)--Christopher Hitchens |
> Ben Finney
I think he meant this:
https://pypi.python.org/pypi/sas7bdat
And here is what SAS7DAT is
https://cran.r-project.org/web/packages/sas7bdat/vignettes/sas7bdat.pdf
Judging by name it seams be related to SAS language.
Regards
Adam M.
--
https://mail.python.org/mailman/listinfo/python-list
https://github.com/Veek/Python/tree/master/junk/hello
doesn't work.
I have:
hello.c which contains: int hello(void);
hello.h
To wrap that up, i have:
hello.py -> _hello (c extension) -> pyhello.c -> method py_hello()
People using this will do:
python3.2>> import hello
python3.2>> hello.hello()
I
Fatih Güven wrote:
> 4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih Güven yazd?:
>> I want to generate a unique variable name for list using python.
>>
>> list1=...
>> list2=...
for x in range(1,10):
exec("list%d = []" % x)
--
https://mail.python.org/mailman/listinfo/python-list
Fatih Güven wrote:
> This is okay but i can't use the method ".append" for example
> list1.append("abc")
works for me
--
https://mail.python.org/mailman/listinfo/python-list
Søren wrote:
> import ctypes
Hi, yeah i kind of liked it - still reading the docs though, Beazley has the
Python.h solution so I though I'd try that first.
--
https://mail.python.org/mailman/listinfo/python-list
Jason Swails wrote:
> I've submitted a PR to your github repo showing you the changes
> necessary to get your module working on my computer.
Segfaults :p which is an improvement :)
open("./_hello.cpython-32mu.so", O_RDONLY) = 5
read(5,
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\7\0\0\0
Jason Swails wrote:
> What operating system are you running this on? It works fine for me on
> Linux:
Wheezy Debian, Linux deathstar 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3
x86_64 GNU/Linux
gcc (Debian 4.7.2-5) 4.7.2
Python 3.2.3
I ran it through gdb - not very useful:
(gdb) bt
#0 0x00
static PyMethodDef hellomethods[] = {
{"hello", py_hello, METH_VARARGS, py_hello_doc},
{NULL, NULL, 0, NULL},
};
It's basically the METH_VARARGS field that's giving the problem. Switching
it to NULL gives,
SystemError: Bad call flags in PyCFunction_Call. METH_OLDARGS is no longer
suppor
okay got it working - thanks Jason! The 3.2 docs are slightly different.
--
https://mail.python.org/mailman/listinfo/python-list
If i have two functions:
function! foo()
python3 << HERE
import mylib
pass
HERE
function! bar()
python3 << HERE
import mylib
pass
HERE
The src says:
1. Python interpreter main program
3. Implementation of the Vim module for Python
So, is the python interpreter embedded in vim AND additio
def jump_to_blockD(self):
end = len(self.b)
row, col = self.w.cursor
while row <= end:
try:
new_col = self.b[row].index('def')
self.w.cursor = row, new_col
break
except ValueError:
pa
Veek M wrote:
> new_col = self.b[row].index('def')
> self.w.cursor = row, new_col
> new_col = self.b[row].rindex('def')
> self.w.cursor = row, new_col
There's also the different methods ind
Ned Batchelder wrote:
> On 11/7/14 9:52 AM, Veek M wrote:
> and you want to end up on the "def" token, not the "def" in
yep, bumped into this :) thanks!
--
https://mail.python.org/mailman/listinfo/python-list
https://docs.python.org/3.4/library/functools.html
1. "A key function is a callable that accepts one argument and returns
another value indicating the position in the desired collation sequence."
x = ['x','z','q']; sort(key=str.upper)
My understanding is that, x, y, .. are passed to the key fun
I have a package structured like so on the file system:
PKG LIBS are stored here: /usr/lib/python3.2/
Pkg-name: foo-1.0.0
1. What is the root directory, or root-node or 'root' of my package? My
understanding is that it's: /usr/lib/python3.2/foo-1.0.0/ on the file-system
and this is referred to t
r Traceback. He goes on to say:
---
A more subtle example of exception chaining involves exceptions raised
within another exception handler. For example:
def error(msg):
print(m) # Note: typo is intentional (m undefined)
try:
statements
except ValueError as e:
error
It's been answered here:
http://stackoverflow.com/questions/26924045/python-3-x-beazley-context-vs-
cause-attributes-in-exception-handling?noredirect=1#comment42403467_26924045
--
https://mail.python.org/mailman/listinfo/python-list
Has anyone got the thing to work? I want to run some python database scripts
on nginx. Because that will have a simple web-UI, i decided to go with
uWSGI. It's proving to be a massive pain.
I found a decent book for nginx and got that bit working. The query gets
sent to uWSGI but for some reaso
Chris Warrick wrote:
> This is NOT how uwsgi works! You cannot use plain .py files with it,
> and for good reason ? CGI should be long dead.
>
> What you need to do is, you must write a webapp ? in Flask, for
> example. Then you must craft an .ini file that mentions this.
**Hi Chris, Could you
301 - 400 of 1768 matches
Mail list logo