On 18/08/15 10:02, Ben Finney wrote:
Alan Gauld writes:
A flag column that can be used to include/exclude students from
reports.
So better than a boolean in the database, would be a timestamp (or just
a date) indicating *when* the status changes. Either an ‘enrolled’
timestamp, or a ‘departe
Alan Gauld writes:
> A flag column that can be used to include/exclude students from
> reports.
Boolean flags very commonly indicate something that can be different at
different times. When the name is of the form “currently_foo”, that's
almost certainly something that is different at different
On 18/08/15 04:51, Zachary Ware wrote:
On Mon, Aug 17, 2015 at 10:44 PM, boB Stepp wrote:
My wife had an interesting request tonight: Would it be possible to
have two dbs, one that is the current working db, and the other an
archival db for students who have left the school?
i think rather t
boB Stepp writes:
> My wife had an interesting request tonight: Would it be possible to
> have two dbs, one that is the current working db, and the other an
> archival db for students who have left the school?
(Note that this isn't anything to do with Python per se, and would be
better discussed
On Mon, Aug 17, 2015 at 10:44 PM, boB Stepp wrote:
> My wife had an interesting request tonight: Would it be possible to
> have two dbs, one that is the current working db, and the other an
> archival db for students who have left the school? If yes, then the
> archival db would need to be able
My wife had an interesting request tonight: Would it be possible to
have two dbs, one that is the current working db, and the other an
archival db for students who have left the school? If yes, then the
archival db would need to be able to serve two functions:
1) If the teacher gets a request fo
On 21Apr2015 22:50, Steven D'Aprano wrote:
On Tue, Apr 21, 2015 at 12:31:53PM +0100, Mark Lawrence wrote:
Python is very strong in guaranteeing backward compatibility, so why not
copy the 3.3 pure Python code to your 3.2 setup and see what happens?
Normally backwards compatibility refers to
On Tue, Apr 21, 2015 at 12:31:53PM +0100, Mark Lawrence wrote:
> Python is very strong in guaranteeing backward compatibility, so why not
> copy the 3.3 pure Python code to your 3.2 setup and see what happens?
Normally backwards compatibility refers to the other way: 3.3 will run
3.2 code. To h
- Original Message -
> From: Mark Lawrence
> To: tutor@python.org
> Cc:
> Sent: Tuesday, April 21, 2015 1:31 PM
> Subject: Re: [Tutor] Is it possible to "backport" the datetime module of
> Python 3.3 to Python 3.2?
>
> On 20/04/2015 21:05,
On 20/04/2015 21:05, Albert-Jan Roskam wrote:
Hi,
My Raspberry Pi 2 comes with Python 3.2 (and 2.7). I run some code that uses
the datetime module but I get an error:
"AttributeError: 'datetime.datetime' object has no attribute 'timestamp'". On
https://docs.python.org/3/whatsnew/3.3.html I se
Hi,
My Raspberry Pi 2 comes with Python 3.2 (and 2.7). I run some code that uses
the datetime module but I get an error:
"AttributeError: 'datetime.datetime' object has no attribute 'timestamp'". On
https://docs.python.org/3/whatsnew/3.3.html I see: "New
datetime.datetime.timestamp() method: R
Sorry I didn't get back earlier. But in short: Thank you!
Kind Regards,
Bjorn
On 3 May 2012 00:01, Alan Gauld wrote:
> Does anyone know if it is possible during run-time to:
>>> a) add attributes to classes, which will unknown at program start, but
>>> "emerge" later whilst the program is runnin
Does anyone know if it is possible during run-time to:
a) add attributes to classes, which will unknown at program start, but
"emerge" later whilst the program is running?
Yes, but its not very useful since the rest of your code won't know how
to access those attributes. There are ways around t
> >
> > Does anyone know if it is possible during run-time to:
> > a) add attributes to classes, which will unknown at program start, but
> > "emerge" later whilst the program is running?
> > b) add subclasses to class (also during runtime)
>
> As far as I understand your questions, the answer to
On Wed, May 2, 2012 at 3:56 PM, Bjorn Madsen
wrote:
> Hi,
> I have been studying http://docs.python.org/tutorial/classes.html for a
> while, but still have two questions which I could not answer. Perhaps you
> could help?
>
> Does anyone know if it is possible during run-time to:
> a) add attribut
Hi,
I have been studying http://docs.python.org/tutorial/classes.html for a
while, but still have two questions which I could not answer. Perhaps you
could help?
Does anyone know if it is possible during run-time to:
a) add attributes to classes, which will unknown at program start, but
"emerge" l
In future please start a new thread instead of hijacking an existing one.
We track things by thread, and I almost missed your question!
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscrip
"shaheryar ali" wrote
Well its gonna be by foot (walk) and it could be any place, road,
city center,
countryside, preferably you can say a leisure.
OK, so if we limit it to on foot by any means then the circle
would be about 3 miles (5km) in radius.
but how to proceed with it, any Idea?
No,
From: C.Y. Ruhulessin
To: Alan Gauld
Cc: tutor@python.org
Sent: Wed, January 26, 2011 8:37:45 PM
Subject: Re: [Tutor] Is it possible to make a circle of 1 hour
Do time machines count to?
2011/1/26 Alan Gauld
>"shaheryar ali" wrote
random route is generated
Thanks for the reply tho
BR
Ali
From: Alan Gauld
To: tutor@python.org
Sent: Wed, January 26, 2011 7:47:23 PM
Subject: Re: [Tutor] Is it possible to make a circle of 1 hour
"shaheryar ali" wrote
> I was wondering, Is i
Do time machines count to?
2011/1/26 Alan Gauld
>
> "shaheryar ali" wrote
>
>
> I was wondering, Is it possible to generate a circle on Google maps using
>> python, such that distance in the created circle could be travel in 1
>> hour.
>>
>
> Technically it would be possible I'm sure. The tric
"shaheryar ali" wrote
I was wondering, Is it possible to generate a circle on Google maps
using
python, such that distance in the created circle could be travel in
1 hour.
Technically it would be possible I'm sure. The trick is determining
how
big the circle should be. How are you travelli
Hi every body,
I was wondering, Is it possible to generate a circle on Google maps using
python, such that distance in the created circle could be travel in 1 hour.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription o
Jojo Mwebaze wrote:
> Thanks guys for the responses,
>
> inspect.classify_class_attrs(klass)
>
> does the magic
Argh, undocumented functions. How did you find that gem?
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription opt
Thanks guys for the responses,
inspect.classify_class_attrs(klass)
does the magic
Regards
On Wed, Jan 19, 2011 at 3:58 PM, Peter Otten <__pete...@web.de> wrote:
> Jojo Mwebaze wrote:
>
> > Is it possible to tell, from which class an method was inherited from.
> > take an example below
> >
Jojo Mwebaze wrote:
> Is it possible to tell, from which class an method was inherited from.
> take an example below
>
> class A:
>def foo():
> pass
> class B(A):
>def boo(A):
> pass
> class C(B):
>def coo()
> pass
> class D(C):
>def doo()
> pass
>
dir (
On 01/19/2011 03:55 AM, Jojo Mwebaze wrote:
> Is it possible to tell, from which class an method was inherited from.
> take an example below
>
> |class A:
>
>def foo():
> pass
> class B(A):
>
>def boo(A):
> pass
>
> class C(B):
>def coo()
>
> pass
> class D(C):
>
>
Is it possible to tell, from which class an method was inherited from. take
an example below
class A:
def foo():
pass
class B(A):
def boo(A):
pass
class C(B):
def coo()
pass
class D(C):
def doo()
pass
>>> dir (D)
['__doc__', '__module__', 'boo', 'coo', 'doo', 'foo
so we don't usually care too much about types. Are you sure you
>>really need all that type checking code?
...I included a type check for a string to make sure that a future programmer
(or myself) wouldn't try to pass in a list of lines after a text has been
split.
Other code internal to th
>
>
>
> I have a class with an init method that is getting bloated with
>> error-checking guard clauses.
>>
>
> Thats very strange. We don't usually have to check types in Python,
> it is a dynamic language and we can use duck-typing and exceptions
> so we don't usually care too much about types.
"Serdar Tumgoren" wrote
Does anyone know if it's possible to call a property setter inside
of a
class's init method? Below is a code sample of what I'm trying to
do.
Yes and that bit has been answered.
But...
I have a class with an init method that is getting bloated with
error-checking g
> > def __init__(self, value):
> > self.text(value)
>
> self.text = value # is the way to do this, if you're using it as a
> property.
>
> That worked perfectly! So it seems I was botching the syntax. Many thanks
for the quick response!!
Serdar
> Does anyone know if it's possible to call a property setter inside of a
> class's init method? Below is a code sample of what I'm trying to do.
Just a quick guess:
> class Question(object);
replace the semi-colon with a colon (I assume it's just a typo, since you don't
get an error for th
Hey all,
Does anyone know if it's possible to call a property setter inside of a
class's init method? Below is a code sample of what I'm trying to do.
class Question(object);
def __init__(self, value):
self.text(value)
@property
def text(self):
return self._text
On Fri, Feb 19, 2010 at 7:07 PM, Steven D'Aprano wrote:
> On Sat, 20 Feb 2010 06:33:04 am Kent Johnson wrote:
>
>> It sounds like you are looking for eval()
>>
>> (Standard warning - use eval() only on trusted data)
>
>
> This is the tutor list, aimed at beginners to Python, many of whom are
> als
Looks like the eval() will work great. Thanks so much for telling me.
>
>We normally warn against using eval/exec because
they form a security risk. But in your case you
are in control of the code that they execute so
its ok. That is the kind of usage where they
are the best solution.
Be ve
On Sat, 20 Feb 2010 06:33:04 am Kent Johnson wrote:
> It sounds like you are looking for eval()
>
> (Standard warning - use eval() only on trusted data)
This is the tutor list, aimed at beginners to Python, many of whom are
also beginners to programming as well. Even experienced programmers
of
Thanks Kent and Alan!!
Problem solved, eval() will work great!
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
"Carnell, James E" wrote
I am trying to teach a computer program - to program. It builds grammars
and procedural memories on dictionary networks. How do I get the program
to be able to input to the interpreter/command line and read the
results?
You probably don;t want to do that. I suspect
On Fri, Feb 19, 2010 at 1:56 PM, Carnell, James E
wrote:
>
> I am trying to teach a computer program - to program. It builds grammars and
> procedural memories on dictionary networks. How do I get the program to be
> able to input to the interpreter/command line and read the results? I have
> done
I am trying to teach a computer program - to program. It builds grammars
and procedural memories on dictionary networks. How do I get the program
to be able to input to the interpreter/command line and read the
results? I have done this a wee bit with making a dictionary of
functions, but in a sen
On Wednesday 29 April 2009, mobiledream...@gmail.com wrote:
> Python
> for i,j in topgirls, richgirls:
> print i,j
>
>
> Cheetah
> #for $i,$j in $topgirls, $richgirls$i, $j
> #end for
> This doesnt work
Hello -
Please do not send email to the python ML via "undisclosed recipients".
It's really
Michiel Overtoom wrote:
Kent Johnson wrote:
Use zip() or itertools.izip():
And when the sequences are of unequal length:
On python3.x, use itertools.zip_longest()
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tut
Kent Johnson wrote:
Use zip() or itertools.izip():
And when the sequences are of unequal length:
topgirls=["Ann","Mary","Casey","Zoe"]
richgirls=["Britt","Susan","Alice"]
print "\nUsing zip()"
for i,j in zip(topgirls,richgirls):
print i,j
print "\nUsing map()"
for i,j in map(None,topgir
On Thu, Apr 30, 2009 at 2:31 AM, wrote:
> Python
> for i,j in topgirls, richgirls:
> print i,j
Use zip() or itertools.izip():
for i, j in zip(topgirls, richgirls):
print i, j
Kent
___
Tutor maillist - Tutor@python.org
http://mail.python.org/m
"Nathan McBride" <[EMAIL PROTECTED]> wrote
> Is it possible to write a program that you pipe other programs
> through
> and it measures the MBs per second of data moved? Like I could pipe
> it
> a cp and find out how fast the cp is working?
Not in any kind of general sense.
Even for cp its not
Is it possible to write a program that you pipe other programs through
and it measures the MBs per second of data moved? Like I could pipe it
a cp and find out how fast the cp is working?
Thanks,
Nate
___
Tutor maillist - Tutor@python.org
http://mail
I need to some how make a script that logs into a website from my desktop
and I can do the rest and grab the information on my on hopefully. How
would I login to a website using sockets with python?
___
Tutor maillist - Tutor@python.org
http://mail.pyt
> Is it possible to create a def that not only deals cards, but also
> assigns a value to each rank, except that the Jacks, Queens, and
> Kings
> all are the same value as the 10s?
Yes. And you probably need to use a dictionary to hold the value
against
the card.
> Sorry if I'm asking what for
Quoting Nathan Pinno <[EMAIL PROTECTED]>:
> Is it possible to create a def that not only deals cards, but also
> assigns a value to each rank, except that the Jacks, Queens, and Kings
> all are the same value as the 10s?
> If this is possible, how should I go about doing this?
Nearly everything i
Is it possible to create a def that not only deals cards, but also assigns
a value to each rank, except that the Jacks, Queens, and Kings all are the same
value as the 10s?
If this is possible, how should I go about doing this?
Sorry if I'm asking what for most people is a basic question,
Alan G wrote:
>> I was just wondering if it is possible to use Python as a language to
>> password protect a webpage?
>
>
> Yes it is possible but you will need to have a web server that can run
> Pyhon and there aren't too many of those on the internet...
>
>
However, there are some hoste
> I was just wondering if it is possible to use Python as a language
> to password protect a webpage?
Yes it is possible but you will need to have a web server that can
run Pyhon and there aren't too many of those on the internet...
OTOH if its a privately owned web server then password protec
Could you send me the code if possible, or show me the way to go?
- Original Message -
From: "nephish" <[EMAIL PROTECTED]>
To: "Nathan Pinno" <[EMAIL PROTECTED]>
Sent: Saturday, July 09, 2005 12:32 PM
Subject: Re: [Tutor] Is it possible to...
Hi all,
I was just wondering if it is possible to use Python as a language to
password protect a webpage? If it is possible, I wouldn't mind learning how, it
would enable me to add a member-only section to my website.
Thanks,
Nathan PinnoCrew, McDonalds Restaurant, Camrose, AB Canadahttp:/
On Wed, 27 Apr 2005, Tom Tucker wrote:
> Hello all! I am trying to pass a variable to my re.compile string (see
> broken example below). Is something like this possible? Thanks!
>
> regexstring = 'H\sb'
> textstring = 'BLAH blah'
> match = re.compile((%s) % (regexstring)) # ?
Hi Tom,
Ah, I t
Hello all! I am trying to pass a variable to my re.compile string (see
broken example below). Is something like this possible? Thanks!
regexstring = 'H\sb'
textstring = 'BLAH blah'
match = re.compile((%s) % (regexstring)) # ?
if match.search(line):
print "I found it!"
Tom
___
57 matches
Mail list logo