def fetchRecord(db, form):
try:
key = form['key'].value
record = db[key]
fields = record.__dict__
fields['key'] = key
except:
fields = dict.fromkeys(fieldnames, '?')
fields['key'] = 'Missing or invalid key!'
return fields
def updateRecord(db, form):
if not 'key' in form:
On Wed, Oct 29, 2014 at 1:11 AM, Rustom Mody wrote:
> On Wednesday, October 29, 2014 11:10:06 AM UTC+5:30, Zachary Ware wrote:
>> Of course, that's 3 (progressively shorter) loops to get the names of
>> the ABCs of a class compared to 1 (fairly short in the first place)
>> loop for a map of relati
also
what does
rowshtml += (rowhtml % ((fieldname,) * 3)) expand to?
--
https://mail.python.org/mailman/listinfo/python-list
On Wednesday, October 29, 2014 11:10:06 AM UTC+5:30, Zachary Ware wrote:
> On Wed, Oct 29, 2014 at 12:15 AM, Rustom Mody wrote:
> > Maybe nicer to filter out the false's with a filter-false thus??
> >
> > def ff(d): return [n for n in d if d[n]]
>
> Sure. Or, combining things:
>
> try:
> fro
Alan Bawden :
> You might be right, because nothing in the Python 2 documentation I
> can find _explicitly_ says that file.write() is guaranteed to write
> everything I told it to, but that seems like a sufficiently surprising
> fact that I would expect the documentation to emphasize the danger.
def fetchRecord(db, form):
try:
key = form['key'].value
record = db[key]
fields = record.__dict__
fields['key'] = key
except:
fields = dict.fromkeys(fieldnames, '?')
fields['key'] = 'Missing or invalid key!'
return fields
def updateRecord(db, form):
if not 'key' in form:
Zachary Ware writes:
> […] just to avoid inconvenient line-wrapping (that I can avoid just by
> sticking to 80 column lines in the first place :).
That is a valid solution. If you have the discipline to stick to it,
congratulations :-)
--
\“If you ever drop your keys into a river of m
On Wednesday, October 29, 2014 11:14:14 AM UTC+5:30, Zachary Ware wrote:
> On Wed, Oct 29, 2014 at 12:27 AM, Ben Finney wrote:
> > Zachary Ware writes:
> >
> >> Of course, Gmail decided to wrap my long line for me. In case it's not
> >> obvious, that should be a single line.
> >
> > Right, GMail i
kindly let me know
what does
%%(%s)% mean
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, Oct 29, 2014 at 12:27 AM, Ben Finney wrote:
> Zachary Ware writes:
>
>> Of course, Gmail decided to wrap my long line for me. In case it's not
>> obvious, that should be a single line.
>
> Right, GMail is a poor choice for composing messages. You might get
> better results installing a pr
On Wed, Oct 29, 2014 at 12:15 AM, Rustom Mody wrote:
> Maybe nicer to filter out the false's with a filter-false thus??
>
> def ff(d): return [n for n in d if d[n]]
Sure. Or, combining things:
try:
from collections import abc
except ImportError:
import collections as abc
from abc import
On 29/10/2014 2:41 PM, satishmlm...@gmail.com wrote:
> kindly let me know what is $ROWS$ along with % symbol's meaning
It's a token, a static value added to the template to indicate where
additional data will be added.
So $ROW$ in this section:
key
$ROWS$
>
Will be replaced by wh
Zachary Ware writes:
> Of course, Gmail decided to wrap my long line for me. In case it's not
> obvious, that should be a single line.
Right, GMail is a poor choice for composing messages. You might get
better results installing a proper mail client, and communicating via
IMAP.
--
\“P
On Wednesday, October 29, 2014 10:29:48 AM UTC+5:30, Zachary Ware wrote:
> On Tue, Oct 28, 2014 at 11:40 PM, Rustom Mody wrote:
> > On Wednesday, October 29, 2014 9:53:46 AM UTC+5:30, Zachary Ware wrote:
> >> On Tue, Oct 28, 2014 at 11:16 PM, Zachary Ware wrote:
> >> > def get_abc_map(cls):
> >> >
On Monday, October 27, 2014 5:33:17 PM UTC-7, alex23 wrote:
It is NP-complete, meaning that there is no easy solution.
The correct answer is "Not possible".
No, that's not the correct answer. Being NP-complete doesn't
mean something is impossible, or even hard to do. All it
means is that nobo
Marko Rauhamaa writes:
> Marko Rauhamaa :
> Actually, that's mistaken as well. The sys.std* handles and pipes
> returned by subprocess are accessed using file.write() and thus may
> return partial writes.
I find this very surprising. In Python 2, where file.write() seems to
always return None,
On Tue, Oct 28, 2014 at 11:40 PM, Rustom Mody wrote:
> On Wednesday, October 29, 2014 9:53:46 AM UTC+5:30, Zachary Ware wrote:
>> On Tue, Oct 28, 2014 at 11:16 PM, Zachary Ware wrote:
>> > def get_abc_map(cls):
>> >return {n: issubclass(cls, getattr(abc, n)) for n in dir(abc) if
>> > n[0].isup
import cgi, shelve, sys, os
shelvename = 'class-shelve'
fieldnames = ('name', 'age', 'job', 'pay')
form = cgi.FieldStorage()
print('Content-type: text/html')
sys.path.insert(0, os.getcwd())
replyhtml = """
People Input Form
key
$ROWS$
"""
rowhtml = '%s\n'
rows
On Wednesday, October 29, 2014 9:53:46 AM UTC+5:30, Zachary Ware wrote:
> On Tue, Oct 28, 2014 at 11:16 PM, Zachary Ware wrote:
> > def get_abc_map(cls):
> >return {n: issubclass(cls, getattr(abc, n)) for n in dir(abc) if
> > n[0].isupper()}
>
> Of course, Gmail decided to wrap my long line fo
On Tue, Oct 28, 2014 at 11:16 PM, Zachary Ware
wrote:
> def get_abc_map(cls):
>return {n: issubclass(cls, getattr(abc, n)) for n in dir(abc) if
> n[0].isupper()}
Of course, Gmail decided to wrap my long line for me. In case it's
not obvious, that should be a single line.
--
Zach
--
https:
On Tue, Oct 28, 2014 at 10:22 PM, Rustom Mody wrote:
> How to see that list and range are both sequences?
> Or more generally how to to introspectively discover (ie not by reading
> docs!!)
> the abstract base classes -- eg sequence, iterable etc -- for an arbitrary
> object?
# Python 2/3 compat
On Wed, Oct 29, 2014 at 2:51 PM, wrote:
> def fetchRecord(db, form):
> try:
> key = form['key'].value
When you paste Python code into an email, it's absolutely crucial that
you maintain formatting. The indentation is significant. Can you paste
it again, please?
ChrisA
--
https://mail.python.or
import cgi, shelve, sys, os
shelvename = 'class-shelve'
fieldnames = ('name', 'age', 'job', 'pay')
form = cgi.FieldStorage()
print('Content-type: text/html')
sys.path.insert(0, os.getcwd())
replyhtml = """
People Input Form
key
$ROWS$
"""
rowhtml = '%s\n'
rowshtml = ''
for fieldname in fi
On Wednesday, October 29, 2014 7:47:47 AM UTC+5:30, Denis McMahon wrote:
> On Tue, 28 Oct 2014 01:29:28 +, Joshua Landau wrote:
>
> > On 28 October 2014 00:36, Denis McMahon wrote:
> >>
> >> d = [[list(range(1,13))[i*3+j] for j in range(3)] for i in range(4)]
> >
> > A quick note. Ranges (eve
On Wed, Oct 29, 2014 at 1:18 PM, Denis McMahon wrote:
> On Mon, 27 Oct 2014 10:16:43 -0700, kiuhnm03 wrote:
>
>> I'd like to write one or more scripts that analyze processes in memory
>> on Windows 7. I used to do these things in C++ by using native Win32 API
>> calls.
>> How should I proceed in p
On Mon, 27 Oct 2014 10:16:43 -0700, kiuhnm03 wrote:
> I'd like to write one or more scripts that analyze processes in memory
> on Windows 7. I used to do these things in C++ by using native Win32 API
> calls.
> How should I proceed in python? Any pointers?
This seems to be a very common request.
On Tue, 28 Oct 2014 01:29:28 +, Joshua Landau wrote:
> On 28 October 2014 00:36, Denis McMahon
> wrote:
>>
>> d = [[list(range(1,13))[i*3+j] for j in range(3)] for i in range(4)]
>
> A quick note. Ranges (even 2.7's xrange) are all indexable. The cast to
> a list isn't needed.
Until you app
On 28Oct2014 04:02, massi_...@msn.com wrote:
I'm not really sure if this is the right place to ask about regular
expressions, but since I'm usin python I thought I could give a try :-)
Here is the problem, I'm trying to write a regex in order to substitute all the
occurences in the form $"some
Cameron Simpson Wrote in message:
> On 28Oct2014 09:07, ngangsia akumbo wrote:
>>This is a sample code on how to read data from a file
>>
>>files1 {}
>>
>>result = open("file1.txt")
>>for line in result:
>>file1 = line>split()
>>files1.append(file1)
>>result.close()
>>file1.sort()
>>file1.rev
On 29/10/2014 11:28 AM, Anton wrote:
Can you elaborate why it is an NP-complete problem or maybe a link to
description of problem you are referring to?
While not the exact problem, it's tangentially related to:
http://kenlevine.blogspot.com.au/2011/03/reducing-humor-to-equation.html
--
https
satishmlm...@gmail.com Wrote in message:
> key
> rowhtml = '%s\n"
>
> what does % mean in first line of code and
> what does %%(%s)s mean in second line of code
>
> kindly explain
>
Please post Python code, and we can try to comment on it. Those
extra and thingies are really killing my menta
Hi Pythonistas,
On behalf of all Australians, I would like to apologise for this ill advised
SEO spam.
Embarrassed,
Cameron Simpson
On 28Oct2014 08:48, Eileen | Cellsix Pty Ltd wrote:
Hi,
I recently browsed through your business website and wanted to highlight some
key points for consider
On Monday, October 27, 2014 5:33:17 PM UTC-7, alex23 wrote:
> On 28/10/2014 1:10 AM, e...@gmail.com wrote:
> > Write a program that reads the contents of the two files into two
> > separate lists. The user should be able to enter a boy's
> > name, a girl's name or both, and the
On 28Oct2014 09:07, ngangsia akumbo wrote:
This is a sample code on how to read data from a file
files1 {}
result = open("file1.txt")
for line in result:
file1 = line>split()
files1.append(file1)
result.close()
file1.sort()
file1.reverse()
print('THE FILE INFO')
print(file1(0)
print(file1
On Tuesday, October 28, 2014 5:30:31 PM UTC-5, Dan Stromberg wrote:
> On Tue, Oct 28, 2014 at 3:21 PM, Rick Dooling wrote:
> > I tried to convert the code using 2to3 and it broke.
> >
> > The error I get when using Python 3 is on this line:
> >
> > _null_trans = string.maketrans("", "")
> >
> > and
On Tue, Oct 28, 2014 at 3:21 PM, Rick Dooling wrote:
> I tried to convert the code using 2to3 and it broke.
>
> The error I get when using Python 3 is on this line:
>
> _null_trans = string.maketrans("", "")
>
> and the error reads
>
> AttributeError: 'module' object has no attribute 'maketrans'
>
I'm an English major who hacks scripts together to do things as needed.
I used this code from the Python Cookbook for years.
https://www.safaribooksonline.com/library/view/python-cookbook-2nd/0596007973/ch01s12.html
Especially when I need to convert old WPD files to markdown, some of which
don'
On 28/10/2014 21:41, satishmlm...@gmail.com wrote:
key
rowhtml = '%s\n"
what does % mean in first line of code and
what does %%(%s)s mean in second line of code
kindly explain
Please refer to
https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting
--
My fellow Pytho
key
rowhtml = '%s\n"
what does % mean in first line of code and
what does %%(%s)s mean in second line of code
kindly explain
--
https://mail.python.org/mailman/listinfo/python-list
Python 3.4.2 Windows x64
PyQt4 4.11.2 Py3.4 Qt4.8.6 (x64)
PyCharm 3.4.1 Pro Edition
So, PyCharm works 100% with everything here but PyQt.
I have this folder structure:
Disk C:
> PyQt4
>> Lib/site-packages/PyQt4/(tons of files here)
> Python34 (normal/default installation)
---
I tried copying
In article
,
Cyd Haselton wrote:
> On Tue, Oct 28, 2014 at 3:11 AM, Ned Deily wrote:
> > In article
> > ,
> > Cyd Haselton wrote:
> > [...]
> >> I'm building python on an Android device in the KBOX
> >> environment...which simulates a Unix type filesystem.
> >> Python isn't installed; I'm bu
On 10/28/2014 01:34 PM, Cousin Stanley wrote:
dbf
===
dbf (also known as python dbase) is a module
for reading/writing dBase III, FP, VFP,
and Clipper .dbf database files.
Available via PyPI at ?
https://pypi.python.org/pypi/dbf/0.96.001
Ah, yes, that's the place! Althoug
On Tue, Oct 28, 2014 at 3:11 AM, Ned Deily wrote:
> In article
> ,
> Cyd Haselton wrote:
> [...]
>> I'm building python on an Android device in the KBOX
>> environment...which simulates a Unix type filesystem.
>> Python isn't installed; I'm building from sources (2.7.8) with GCC
>> 4.8.0 and mak
>
> dbf
> ===
>
> dbf (also known as python dbase) is a module
> for reading/writing dBase III, FP, VFP,
> and Clipper .dbf database files.
>
Available via PyPI at ?
https://pypi.python.org/pypi/dbf/0.96.001
--
Stanley C. Kitching
Human Being
Phoenix, Arizona
--
https://ma
On 10/28/2014 01:08 PM, Tim Chase wrote:
Just a little note to give thanks for all the work you put into such
an unglamorous-yet-backside-saving project. It *is* appreciated by
those of us who have had to disinter data from old client .dbf files.
Thank you! :)
--
~Ethan~
--
https://mail.pyt
On 2014-10-28 12:53, Ethan Furman wrote:
> dbf (also known as python dbase) is a module for reading/writing
> dBase III, FP, VFP, and Clipper .dbf database files. It's
> an ancient format that still finds lots of use
Just a little note to give thanks for all the work you put into such
an unglamo
and finally supports Python 3! :)
Versions supported are 2.5 - 2.7, and 3.2+
=
dbf
===
dbf (also known as python dbase) is a module for reading/writing
dBase III, FP, VFP, and Clipper .dbf database files. It's
an ancient format that still finds lots of
On 2014-10-28 12:28, massi_...@msn.com wrote:
Hi Chris, thanks for the reply. I tried to use look ahead assertions, in
particular I modified the regex this way:
newstring = re.sub(ur"""(?u)(\$\"[\s\w(?<=\\)\"]+\")""", subst, oldstring)
but it does not work. I'm absolutely not a regex guru so I
On Tuesday, October 28, 2014 7:03:00 AM UTC-4, mass...@msn.com wrote:
> Hi everyone,
> I'm not really sure if this is the right place to ask about regular
> expressions, but since I'm usin python I thought I could give a try :-)
> Here is the problem, I'm trying to write a regex in order to substi
This is a sample code on how to read data from a file
files1 {}
result = open("file1.txt")
for line in result:
file1 = line>split()
files1.append(file1)
result.close()
file1.sort()
file1.reverse()
print('THE FILE INFO')
print(file1(0)
print(file1(1)
--
https://mail.python.org/mail
On Wed, Oct 29, 2014 at 2:47 AM, Simon Kennedy wrote:
> On Thursday, 23 October 2014 20:02:43 UTC+1, Chris Angelico wrote:
>> I don't think it's possible to auto-solve the Google Groups formatting
>> issues at the mailing list level, as the fundamental problem is that
>> information isn't being t
On Tuesday, October 28, 2014 9:18:09 PM UTC+5:30, Simon Kennedy wrote:
> On Thursday, 23 October 2014 20:02:43 UTC+1, Chris Angelico wrote:
> > I don't think it's possible to auto-solve the Google Groups formatting
> > issues at the mailing list level, as the fundamental problem is that
> > inform
On Thursday, 23 October 2014 20:02:43 UTC+1, Chris Angelico wrote:
> I don't think it's possible to auto-solve the Google Groups formatting
> issues at the mailing list level, as the fundamental problem is that
> information isn't being transmitted. (Forcing everything to be wrapped
> and forcing
On Tuesday, October 28, 2014 12:25:13 AM UTC-4, Terry Reedy wrote:
> On 10/27/2014 11:10 AM, emmanuel...@gmail.com wrote:
>
> > THIS IS THE LIST OF BOY NAMES
> > Jacob
> > ...
>
> Writing hundreds of unnecessary lines at minimum inconsiderate. Please
> don't do it.
>
> --
> Terry Jan Reedy
Sounds like you want to use Twisted or something to implement the SMPP
protocol. That's not trivial, but probably not too difficult; if you don't
need message delivery confirmation, it should be stateless.
Bob
On Tue, Oct 28, 2014 at 8:01 AM, ngangsia akumbo wrote:
> I need to build a bu
I need to build a bulk SMS system for a particular group of users.
i WAS THINKING OF USING RAPIDSMS, AND KANNEL.
Is there not a way to use just python from scratch to build a bulk sms system
or if there are other simpler means please indicate to me.
Thanks
Ngangsi Richard
skyoe: ngangsia.ri
On Tue, Oct 28, 2014 at 4:02 AM, wrote:
> Hi everyone,
>
> I'm not really sure if this is the right place to ask about regular
> expressions, but since I'm usin python I thought I could give a try :-)
> Here is the problem, I'm trying to write a regex in order to substitute
> all the occurences i
(Please quote enough of the previous text to provide context, and
write your replies underneath the quoted text - don't assume that
everyone's read the previous posts. Thanks!)
On Tue, Oct 28, 2014 at 11:28 PM, wrote:
> Hi Chris, thanks for the reply. I tried to use look ahead assertions, in
>
Hi Chris, thanks for the reply. I tried to use look ahead assertions, in
particular I modified the regex this way:
newstring = re.sub(ur"""(?u)(\$\"[\s\w(?<=\\)\"]+\")""", subst, oldstring)
but it does not work. I'm absolutely not a regex guru so I'm surely missing
something. The strings I'm d
On Tuesday, October 28, 2014 3:37:19 AM UTC+1, Rustom Mody wrote:
> On Tuesday, October 28, 2014 12:41:40 AM UTC+5:30, kiuh...@yahoo.it wrote:
> > On Monday, October 27, 2014 6:24:19 PM UTC+1, Tim Golden wrote:
> > > psutil is definitely your friend:
> > >
> > > https://github.com/giampaolo/psut
On 27/10/2014 04:49, Ganesh Pal wrote:
Hi Team ,
Iam new to Fabric and Iam using the fab command-line tool to run a set
of task on Linux clients.
I just started coding and Iam pretty new to fabric, Iam hoping I will be
able to launch my fabric scripts from both Windows and Linux Machine
On Tue, Oct 28, 2014 at 10:02 PM, wrote:
> I'm not really sure if this is the right place to ask about regular
> expressions, but since I'm usin python I thought I could give a try :-)
Yeah, that sort of thing is perfectly welcome here. Same with
questions about networking in Python, or file I/
"Chris Angelico" a écrit dans le message de
news:mailman.15254.1414482690.18130.python-l...@python.org...
On Tue, Oct 28, 2014 at 6:35 PM, ast wrote:
That's clear to me now. Spinbox and Scale widgets behave
differently, that's all.
Command on Scale widget:
A procedure to be called every t
Hi folks
I have a little problem with a Python extension and could not find a
good solution in the documentation. So hopefully someone here has a
clever idea.
Here is the problem: I have two extensions written in C++ (bindings to
existing C++ code). Lets call this two extensions C and B which a
Hi everyone,
I'm not really sure if this is the right place to ask about regular
expressions, but since I'm usin python I thought I could give a try :-)
Here is the problem, I'm trying to write a regex in order to substitute all the
occurences in the form $"somechars" with another string. This i
Marko Rauhamaa :
> Python's sockets and pipes don't have write methods.
Actually, that's mistaken as well. The sys.std* handles and pipes
returned by subprocess are accessed using file.write() and thus may
return partial writes.
That brings up another point: Python3's file.write() returns the nu
Nobody :
> Asynchronous I/O in the sense of select(), poll(), O_NONBLOCK etc is
> meant for situations where delays could be indefinite, e.g. network
> connections or terminals. For "short" delays (i.e. disc access),
> there's not much point having a mechanism so that you can avoid
> blocking whil
Hi,
I recently browsed through your business website and wanted to highlight
some key points for consideration.
I am sure it will complement your-SEO work to help your website attract
only quality visitors and make it scale high on the search .engine results
page (SERP) gradually.
Would
In article
,
Cyd Haselton wrote:
[...]
> I'm building python on an Android device in the KBOX
> environment...which simulates a Unix type filesystem.
> Python isn't installed; I'm building from sources (2.7.8) with GCC
> 4.8.0 and make.
>
> The problem with the LDFLAGS approach is that some of
On Tue, Oct 28, 2014 at 6:35 PM, ast wrote:
> OK, but i still find very strange the choice of Python's designers to
> make the Scale behaves like that.
That's nothing to do with Python's design. That's all about Tkinter,
which presumably is imitating Tk. Python allows the callback function
to be
"Peter Otten" <__pete...@web.de> a écrit dans le message de
news:mailman.15231.1414399974.18130.python-l...@python.org...
Tanks for you answer
Python doesn't "know" it has to pass an argument, it just does it. Change
the callback to
def maj():
print("no args")
and you'll get an error.
On Tue, Oct 28, 2014 at 5:42 PM, ngangsia akumbo wrote:
> Please can someone look at my code and may be advice and may be help me with
> some correction. I have been learning python for some time now. This is my
> first project i wish to write. A hotel management system.
>
>
> http://pastebin.co
72 matches
Mail list logo