Re: [Tutor] Is it possible to archive subsets of data from an SQLite db and restore it later?

2015-08-18 Thread Alan Gauld
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

Re: [Tutor] Is it possible to archive subsets of data from an SQLite db and restore it later?

2015-08-18 Thread Ben Finney
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

Re: [Tutor] Is it possible to archive subsets of data from an SQLite db and restore it later?

2015-08-18 Thread Alan Gauld
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

Re: [Tutor] Is it possible to archive subsets of data from an SQLite db and restore it later?

2015-08-17 Thread Ben Finney
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

Re: [Tutor] Is it possible to archive subsets of data from an SQLite db and restore it later?

2015-08-17 Thread Zachary Ware
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

[Tutor] Is it possible to archive subsets of data from an SQLite db and restore it later?

2015-08-17 Thread boB Stepp
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

Re: [Tutor] Is it possible to "backport" the datetime module of Python 3.3 to Python 3.2?

2015-04-21 Thread Cameron Simpson
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

Re: [Tutor] Is it possible to "backport" the datetime module of Python 3.3 to Python 3.2?

2015-04-21 Thread Steven D'Aprano
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

Re: [Tutor] Is it possible to "backport" the datetime module of Python 3.3 to Python 3.2?

2015-04-21 Thread Albert-Jan Roskam
- 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,

Re: [Tutor] Is it possible to "backport" the datetime module of Python 3.3 to Python 3.2?

2015-04-21 Thread Mark Lawrence
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

[Tutor] Is it possible to "backport" the datetime module of Python 3.3 to Python 3.2?

2015-04-20 Thread Albert-Jan Roskam
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

Re: [Tutor] is it possible to create and amend classes during run-time?

2012-05-04 Thread Bjorn Madsen
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

Re: [Tutor] is it possible to create and amend classes during run-time?

2012-05-02 Thread Alan Gauld
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

Re: [Tutor] is it possible to create and amend classes during run-time?

2012-05-02 Thread Prasad, Ramit
> > > > 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

Re: [Tutor] is it possible to create and amend classes during run-time?

2012-05-02 Thread Jerry Hill
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

[Tutor] is it possible to create and amend classes during run-time?

2012-05-02 Thread Bjorn Madsen
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

Re: [Tutor] Is it possible to make a circle of 1 hour

2011-01-28 Thread bob gailer
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

Re: [Tutor] Is it possible to make a circle of 1 hour

2011-01-26 Thread Alan Gauld
"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?

Re: [Tutor] Is it possible to make a circle of 1 hour

2011-01-26 Thread shaheryar ali
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

Re: [Tutor] Is it possible to make a circle of 1 hour

2011-01-26 Thread shaheryar ali
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

Re: [Tutor] Is it possible to make a circle of 1 hour

2011-01-26 Thread C.Y. Ruhulessin
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

Re: [Tutor] Is it possible to make a circle of 1 hour

2011-01-26 Thread 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 trick is determining how big the circle should be. How are you travelli

[Tutor] Is it possible to make a circle of 1 hour

2011-01-26 Thread shaheryar ali
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

Re: [Tutor] Is it possible to tell, from which class an method was inherited from

2011-01-20 Thread Peter Otten
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

Re: [Tutor] Is it possible to tell, from which class an method was inherited from

2011-01-19 Thread Jojo Mwebaze
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 > >

Re: [Tutor] Is it possible to tell, from which class an method was inherited from

2011-01-19 Thread Peter Otten
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 (

Re: [Tutor] Is it possible to tell, from which class an method was inherited from

2011-01-19 Thread Corey Richardson
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): > >

[Tutor] Is it possible to tell, from which class an method was inherited from

2011-01-19 Thread Jojo Mwebaze
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

Re: [Tutor] is it possible to call a setter property during classinstantiation?

2010-08-14 Thread ALAN GAULD
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

Re: [Tutor] is it possible to call a setter property during classinstantiation?

2010-08-13 Thread Serdar Tumgoren
> > > > 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.

Re: [Tutor] is it possible to call a setter property during classinstantiation?

2010-08-13 Thread Alan Gauld
"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

Re: [Tutor] is it possible to call a setter property during class instantiation?

2010-08-12 Thread Serdar Tumgoren
> > 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

Re: [Tutor] is it possible to call a setter property during class instantiation?

2010-08-12 Thread Evert Rol
> 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

[Tutor] is it possible to call a setter property during class instantiation?

2010-08-12 Thread Serdar Tumgoren
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

Re: [Tutor] Is it possible for a Python Program to send commands to the Python Interpreter?

2010-02-19 Thread Kent Johnson
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

Re: [Tutor] Is it possible for a Python Program to send commands to the Python Interpreter?

2010-02-19 Thread ALAN GAULD
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

Re: [Tutor] Is it possible for a Python Program to send commands to the Python Interpreter?

2010-02-19 Thread Steven D'Aprano
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

Re: [Tutor] Is it possible for a Python Program to send commands to the Python Interpreter?

2010-02-19 Thread Carnell, James E
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

Re: [Tutor] Is it possible for a Python Program to send commands to thePython Interpreter?

2010-02-19 Thread Alan Gauld
"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

Re: [Tutor] Is it possible for a Python Program to send commands to the Python Interpreter?

2010-02-19 Thread Kent Johnson
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

[Tutor] Is it possible for a Python Program to send commands to the Python Interpreter?

2010-02-19 Thread Carnell, James E
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

Re: [Tutor] is it possible to traverse two lists simulatenously using python

2009-04-30 Thread Tim Johnson
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

Re: [Tutor] is it possible to traverse two lists simulatenously using python

2009-04-30 Thread Lie Ryan
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

Re: [Tutor] is it possible to traverse two lists simulatenously using python

2009-04-30 Thread Michiel Overtoom
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

Re: [Tutor] is it possible to traverse two lists simulatenously using python

2009-04-30 Thread Kent Johnson
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

Re: [Tutor] Is it possible?

2008-02-08 Thread Alan Gauld
"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

[Tutor] Is it possible?

2008-02-08 Thread Nathan McBride
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

[Tutor] Is it possible to use sockets to login to a website that uses php?

2007-11-19 Thread Lamonte Harris
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

Re: [Tutor] Is it possible to...

2005-08-15 Thread Alan G
> 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

Re: [Tutor] Is it possible to...

2005-08-15 Thread jfouhy
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

[Tutor] Is it possible to...

2005-08-14 Thread Nathan Pinno
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,

Re: [Tutor] Is it possible to...

2005-07-10 Thread Byron
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

Re: [Tutor] Is it possible to...

2005-07-10 Thread Alan G
> 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

Re: [Tutor] Is it possible to...

2005-07-09 Thread Nathan Pinno
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...

[Tutor] Is it possible to...

2005-07-09 Thread Nathan Pinno
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:/

Re: [Tutor] Is it possible to load variable into a regex string?

2005-04-27 Thread Danny Yoo
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

[Tutor] Is it possible to load variable into a regex string?

2005-04-27 Thread Tom Tucker
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 ___