Re: [Tutor] Opening and closing SQLite db

2010-12-28 Thread Timo
On 26-12-10 19:31, Noah Hall wrote: >Which is suggestible just in case the app or program crashes during use. (To O.P) Indeed, though in such cases you must rely on your programmers instinct to make the right decision - what applies for certain instances of an application doesn't alwa

Re: [Tutor] Opening and closing SQLite db

2010-12-28 Thread Noah Hall
> > > But to be sure, it is perfectly safe and valid to open the database on > program startup, commit changes during the process and close it > on exit (or unhandled exception)? As long as it makes sense to do so, yes. There's no point having an open connection to a database if there doesn't ne

[Tutor] Choice of Python

2010-12-28 Thread Abdulhakim Haliru
Hi Guys, I am pretty new to python as this is just my 5th day reading through God knows how many books. I am really not new to programming, I come from a Cakephp, zend framework angle cutting through ASP.net,VB and C# at an intermediate level. However, for some reason, I am thinking pytho

Re: [Tutor] Choice of Python

2010-12-28 Thread Joel Goldstick
Python, to me, is much more self consistent. It is a language that was designed with a plan. PHP to me feels like its more cobbled together. Python is easier to read, you get much more done in less code. The build in data structures are intrinsically connected to coding patterns. This may seem

Re: [Tutor] Choice of Python

2010-12-28 Thread Stefan Behnel
Abdulhakim Haliru, 28.12.2010 13:38: I come from a Cakephp, zend framework angle cutting through ASP.net,VB and C# at an intermediate level. [...] Is python really worth the pain or should I just skip it ? Given that you already invested your time into learning all of the above (which basicall

Re: [Tutor] Choice of Python

2010-12-28 Thread Octavian Rasnita
From: "Abdulhakim Haliru" > Hi Guys, > > I am pretty new to python as this is just my 5th day reading through God > knows how many books. I am really not new to programming, > > I come from a Cakephp, zend framework angle cutting through ASP.net,VB and > C# at an intermediate level. > > Howeve

Re: [Tutor] Choice of Python

2010-12-28 Thread Emile van Sebille
On 12/28/2010 4:38 AM Abdulhakim Haliru said... Is python really worth the pain or should I just skip it ? I think exactly the same thing about PHP each time I run into a PHP app that I need to tweak. Mostly I just skip it... For me, there wasn't any pain in learning python. Of course, I

Re: [Tutor] Choice of Python

2010-12-28 Thread Brett Ritter
On Tue, Dec 28, 2010 at 7:38 AM, Abdulhakim Haliru wrote: > Unlearn my php ways (as that must certainly happen J)  and learn python and > web development woth python, Jquery etal ? ... > Is python really worth the pain or should I just skip it ? If you accept that you'll continue to learn new syn

Re: [Tutor] Choice of Python

2010-12-28 Thread Wayne Werner
On Tue, Dec 28, 2010 at 10:05 AM, Brett Ritter wrote: > (though I have to constantly reteach myself not to > use semicolons :) ). Technically speaking, you *can* use semicolons in Python: if 3 == int('3'): print('Cool'); works the same sans semicolon. -Wayne _

Re: [Tutor] Choice of Python

2010-12-28 Thread शंतनू
On 28-Dec-2010, at 10:14 PM, Wayne Werner wrote: > On Tue, Dec 28, 2010 at 10:05 AM, Brett Ritter wrote: > (though I have to constantly reteach myself not to > use semicolons :) ). > > Technically speaking, you *can* use semicolons in Python: > > if 3 == int('3'): >print('Cool'); > > wo

Re: [Tutor] Choice of Python

2010-12-28 Thread Knacktus
Am 28.12.2010 14:41, schrieb Stefan Behnel: Abdulhakim Haliru, 28.12.2010 13:38: I come from a Cakephp, zend framework angle cutting through ASP.net,VB and C# at an intermediate level. [...] Is python really worth the pain or should I just skip it ? Given that you already invested your time in

Re: [Tutor] Choice of Python

2010-12-28 Thread Marc Tompkins
I love, love, love me some Python - it fits the way I think better than any other language I've used - but there is one consideration that occurs to me: Python is nearly ubiquitous on Linux/Mac, and easy to download and install on Windows - but most bargain-basement Web hosts don't support it (I'm

Re: [Tutor] Choice of Python

2010-12-28 Thread Emile van Sebille
On 12/28/2010 9:46 AM Marc Tompkins said... I love, love, love me some Python - it fits the way I think better than any other language I've used - but there is one consideration that occurs to me: Python is nearly ubiquitous on Linux/Mac, and easy to download and install on Windows - but most bar

Re: [Tutor] Choice of Python

2010-12-28 Thread Marc Tompkins
On Tue, Dec 28, 2010 at 9:46 AM, Marc Tompkins wrote: > I love, love, love me some Python - it fits the way I think better than any > other language I've used - but there is one consideration that occurs to me: > Python is nearly ubiquitous on Linux/Mac, and easy to download and install > on Windo

Re: [Tutor] Choice of Python

2010-12-28 Thread Marc Tompkins
On Tue, Dec 28, 2010 at 9:56 AM, Emile van Sebille wrote: > On 12/28/2010 9:46 AM Marc Tompkins said... > > I love, love, love me some Python - it fits the way I think better than >> any >> other language I've used - but there is one consideration that occurs to >> me: >> Python is nearly ubiqui

Re: [Tutor] Choice of Python

2010-12-28 Thread python
Marc/Emile, If you're looking for a good hosting service that supports Python, I strongly recommend webfaction.com. I've worked with a lot of hosting companies and webfaction gets my highest endorsement: Great support, helpful user community, very flexible support for hosting Python applications

Re: [Tutor] Choice of Python

2010-12-28 Thread Jeff Johnson
On 12/28/2010 10:46 AM, Marc Tompkins wrote: I love, love, love me some Python - it fits the way I think better than any other language I've used - but there is one consideration that occurs to me: Python is nearly ubiquitous on Linux/Mac, and easy to download and install on Windows - but most

[Tutor] blank space after a number

2010-12-28 Thread Enih Gilead
Hi, Abrahamsen! Would you mind tell me a way to eliminate the blank space in front of "a" [int number] ? Just as an example, the 'a' that is made = to '0', when printed, it comes with a blank space after... a, b = 0, 1 while b < 10: print a, b, a, b = a, b + 1 ... do you think is the

Re: [Tutor] blank space after a number

2010-12-28 Thread Hugo Arts
On Tue, Dec 28, 2010 at 2:54 PM, Enih Gilead wrote: > Hi, Abrahamsen! > > Would you mind tell me a way to eliminate the blank space in front of "a" > [int number] ? > Just as an example, the 'a' that is made = to '0', when printed, it comes > with a blank space after... > > a, b = 0, 1 > while b <

Re: [Tutor] blank space after a number

2010-12-28 Thread bob gailer
On 12/28/2010 8:54 AM, Enih Gilead wrote: Hi, Abrahamsen! Would you mind tell me a way to eliminate the blank space in front of "a" [int number] ? Just as an example, the 'a' that is made = to '0', when printed, it comes with a blank space after... a, b = 0, 1 while b < 10: print a, b,

Re: [Tutor] blank space after a number

2010-12-28 Thread Alan Gauld
"Enih Gilead" wrote Just as an example, the 'a' that is made = to '0', when printed, it comes with a blank space after... a, b = 0, 1 while b < 10: print a, b, a, b = a, b + 1 ... do you think is there any reasonable way to transform the '0' number into string and then back to nume

Re: [Tutor] Choice of Python

2010-12-28 Thread Marc Tompkins
On Tue, Dec 28, 2010 at 10:32 AM, wrote: > > Most of the hosting companies I've investigated support older versions of > Python and only support CGI access. > > Ah yes - that's what it was. To use Django (or most other frameworks) you need some processes to be running more or less constantly, as

Re: [Tutor] Choice of Python

2010-12-28 Thread Jeff Johnson
On 12/28/2010 12:48 PM, Marc Tompkins wrote: On Tue, Dec 28, 2010 at 10:32 AM, > wrote: Most of the hosting companies I've investigated support older versions of Python and only support CGI access. Ah yes - that's what it was. To use Django (or most other fr

Re: [Tutor] Choice of Python

2010-12-28 Thread Brett Ritter
On Tue, Dec 28, 2010 at 3:06 PM, Jeff Johnson wrote: > Webfaction supports long processes and that is why they are the largest > Django hosting site.  They support a ton of software, too.  SVN, Trac are > two I use. I didn't see git hosting among their software. Is it available without hoop-jump

Re: [Tutor] Choice of Python

2010-12-28 Thread Jeff Johnson
On 12/28/2010 01:35 PM, Brett Ritter wrote: On Tue, Dec 28, 2010 at 3:06 PM, Jeff Johnson wrote: Webfaction supports long processes and that is why they are the largest Django hosting site. They support a ton of software, too. SVN, Trac are two I use. I didn't see git hosting among their so

Re: [Tutor] blank space after a number

2010-12-28 Thread bob gailer
On 12/28/2010 2:36 PM, Alan Gauld wrote: "Enih Gilead" wrote Just as an example, the 'a' that is made = to '0', when printed, it comes with a blank space after... a, b = 0, 1 while b < 10: print a, b, a, b = a, b + 1 ... do you think is there any reasonable way to transform the '0'

[Tutor] Python 2.7.1 interpreter passing function pointer as function argument and Shedskin 0.7

2010-12-28 Thread Frank Chang
Good afternoon. I want to thank everyone who helped me fix the global name 'levinshtein_automata' is not defined error. When I run the Shedskin 0.7 Python to C+++ compiler on the same python program, I receive the error message * Error * automata_test.py:148 : unbound identifier 'lookup_f

Re: [Tutor] blank space after a number

2010-12-28 Thread Enih Gilead
Thanks a lot, Hugo Yoshi! As a beginner in Python, I do my best to satisfy my curiosity about some features in the language; and, this one was the most difficult among my "projects"! :c) Best regards, Enih Gil'ead # Formatting numbers from '01,' to '100' # Many thanks to Bob Gailer and to

Re: [Tutor] blank space after a number

2010-12-28 Thread Noah Hall
I'll just add there's a better way to do both of the examples you've done there - > > a, b = 0, 1 > > while b < 10: > >print '%i%i' % (a,b) + ',', > >b = b+1 An easier way of doing this is to instead do the following, including the a (although not needed, as simply using 0 would work) -

Re: [Tutor] blank space after a number

2010-12-28 Thread bob gailer
Now that I understand what you want - for b in range(120): print '%0*i' % (max(2,int(math.log10(b))), b) -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.pyth

Re: [Tutor] blank space after a number

2010-12-28 Thread Alan Gauld
"Enih Gilead" wrote a, b = 0, 1 while b < 10: print '%i%i' % (a,b) + ',', b = b+1 If you are using string formatting it's best to get the format string to do as much of the work as possible. In this case forget about 'a' and just insert the zero into the string, and similarly don'

Re: [Tutor] Python 2.7.1 interpreter passing function pointer as function argument and Shedskin 0.7

2010-12-28 Thread Alan Gauld
"Frank Chang" wrote When I run the Shedskin 0.7 Python to C+++ compiler on the same python program, I receive the error message * Error * automata_test.py:148 : unbound identifier 'lookup_func'. lookup_func is a python function pointer passed as an argument to a python function. I

Re: [Tutor] blank space after a number

2010-12-28 Thread bob gailer
On 12/28/2010 8:09 PM, bob gailer wrote: Now that I understand what you want - for b in range(120): print '%0*i' % (max(2,int(math.log10(b))), b) Sorry forgot to add import math -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tuto

Re: [Tutor] Opening and closing SQLite db

2010-12-28 Thread David Hutto
But in the case you need the db constantly open(such as tracking something, where you update the db through some other offsite db), then just committing the current would be suggestible(in my opinion), and keeping the update live to check periodically for changes in the timestamps of data from the

Re: [Tutor] Opening and closing SQLite db

2010-12-28 Thread David Hutto
On Tue, Dec 28, 2010 at 9:18 PM, David Hutto wrote: > But in the case you need the db constantly open(such as tracking > something, where you update the db This assumes you don't connect directly to, but update from, for data analysis, not real time tracking. through some other offsite db), > th

Re: [Tutor] Opening and closing SQLite db

2010-12-28 Thread David Hutto
So in the end it boils down to: What you want the db to hold? When do you need the db to hold it? And... When and where is it necessary to access it by the user? Ah! Not an algorithm. Many paths, same destination...grasshoppa. ___ Tutor maillist

Re: [Tutor] Java Virtual Machine Launcher Question

2010-12-28 Thread Walter Prins
I'm guessing this question has something to do with this: http://isatab.sourceforge.net/validator.html Which appears to be some sort of Java application that validates "isatab" files, which appear to be related to mentioned magetab files. I'm further guessing that you thought a .jar file (A Java

Re: [Tutor] Python 2.7.1 interpreter passing function pointer as function argument and Shedskin 0.7

2010-12-28 Thread bob gailer
On 12/28/2010 4:35 PM, Frank Chang wrote: Good afternoon. I want to thank everyone who helped me fix the global name 'levinshtein_automata' is not defined error. When I run the Shedskin 0.7 Python to C+++ compiler on the same python program, I receive the error message * Error * autom

Re: [Tutor] Python 2.7.1 interpreter passing function pointer as function argument and Shedskin 0.7

2010-12-28 Thread Stefan Behnel
Frank Chang, 28.12.2010 22:35: Good afternoon. I want to thank everyone who helped me fix the global name 'levinshtein_automata' is not defined error. When I run the Shedskin 0.7 Python to C+++ compiler on the same python program, I receive the error message * Error * automata_test.py