Re: best way to share an instance of a class among modules?

2013-02-06 Thread Michael Torrie
On 02/06/2013 03:41 PM, CM wrote: > Thank you. But, I'm sorry, I'm not following this enough to get it to > work. Shouldn't it be a little more like this: No, not exactly. > > # in utilities module > shared_cursor = DatabaseAccess_instance #but how? see my question > below... How what? > #

Re: best way to share an instance of a class among modules?

2013-02-06 Thread Michael Torrie
On 02/06/2013 05:03 PM, Michael Torrie wrote: > Every function in a module has access to the module's global namespace. > And your shared_cursor is there, inside of the utilities reference, > since utilities was imported into your module, "importer." Just to

Re: best way to share an instance of a class among modules?

2013-02-06 Thread Michael Torrie
On 02/06/2013 05:45 PM, CM wrote: > But the function in the module is also within a *class* so I don't > think the function does have access to the module's global namespace. > Here's the hierarchy: > > -- Module namespace > class namespace (DatabaseAccess is the name of the class) >

Re: best way to share an instance of a class among modules?

2013-02-07 Thread Michael Torrie
On 02/07/2013 07:14 PM, Rick Johnson wrote: > On Wednesday, February 6, 2013 7:36:28 PM UTC-6, Ethan Furman wrote: >> As Michael Torrie pointed out, the 'global' keyword is needed: > > Wrong. The global keyword is in fact NOT needed and something i > consider to be

Re: PyWart: Namespace asinitiy and the folly of the global statement

2013-02-07 Thread Michael Torrie
On 02/07/2013 09:30 PM, Rick Johnson wrote: > count = 0 > class Blah: > def meth(): > for x in range(100): > count = x > > Where is count living? > > Of course in this simplistic example we can see that count is @ > module level Except that it's not after the "count=

Re: Implicit conversion to boolean in if and while statements

2013-02-07 Thread Michael Torrie
On 02/07/2013 11:16 PM, Rick Johnson wrote: > He is so accustomed to "guessing" that it has become second nature > for him. I think most of us are guessing as to what you're talking about since you're responding to a 7 month old thread that I think most people have long since deleted from their e-

Re: PyWart: Namespace asinitiy and the folly of the global statement

2013-02-08 Thread Michael Torrie
On 02/08/2013 04:45 AM, Steven D'Aprano wrote: > Rick Johnson wrote: >> Of course in this simplistic example we can see that count is @ module >> level > > But it isn't. It is a local variable. > > Rick, I appreciate your honesty in telling us that you have no idea how to > read Python code and r

Re: best way to share an instance of a class among modules?

2013-02-08 Thread Michael Torrie
On 02/07/2013 07:14 PM, Rick Johnson wrote: > So if you want to use "global variables" , (bka: Module level > variables), then simply declare them with a None value like this: > > globalVariable = None This is a nice convention, but at best it's just a helpful notation that helps a programmer kn

Re: Is Python programming language?

2013-02-09 Thread Michael Torrie
On 02/09/2013 04:26 PM, Tim Roberts wrote: > Most people would call bash a "scripting language", but it is also clearly > a programming language. It has syntax, variables and expressions. I > suspect it is Turing-complete, although I haven't seen a proof of that. > > I would assert that scriptin

Re: Is Python programming language?

2013-02-09 Thread Michael Torrie
On 02/09/2013 07:40 PM, Terry Reedy wrote: > If the language has arrays, conditional execution, and explicit (while) > loops or recursion, you can be pretty sure it is Turing complete. I > presume this covers awk and bash. Something like the game of Life, where > the looping in implicit in the o

Re: Statistics...help with numpy/scipy install

2013-02-10 Thread Michael Torrie
On 02/10/2013 10:35 AM, Rex Macey wrote: > I'm new to Python with a new windows 8 machine (64-bit OS). Learning > programming mainly for fun. Naturally I downloaded Python 3.3 (who > doesn't want the latest and greatest). What I want involves > functions related to the normal distribution. Based

Re: PyWart: Namespace asinitiy and the folly of the global statement

2013-02-11 Thread Michael Torrie
On 02/11/2013 11:32 AM, Jason Swails wrote: > > Perhaps that's your problem ;). Tkinter was the first--and only--GUI > toolkit I learned [1] (I do almost exclusively CLI, and GUI only for fun -- > and I program as a result of the work I do). Having no previous knowledge > of any other GUI toolki

Re: Awsome Python - chained exceptions

2013-02-12 Thread Michael Torrie
On 02/12/2013 07:47 PM, Rick Johnson wrote: > ...Oh Steven, if you only knew how we interpreted the "Oops!", more like > "Doh!". "You keep using that word. I do not think it means what you think it means." > Got any more bright ideas DeAprano? (Oh gawd tha

Re: Awsome Python - chained exceptions

2013-02-12 Thread Michael Torrie
On Feb 13, 2013 12:00 AM, "Chris Angelico" wrote: > Which word? "we"? I'm not entirely sure, given that non-monospaced > fonts get in the way. Normally people would put exactly as many > carets/tildes as there are letters in the word, but aligning the text > in a mono font puts the carets under "

Re: Struggling with program

2013-02-17 Thread Michael Torrie
On 02/17/2013 07:29 PM, maiden129 wrote: > I'm trying to do this assignment and it not working, I don't > understand why... > > This is what I have to do: > > Write the definition of a class Player containing: An instance > variable name of type String , initialized to the empty String. An > i

Re: improving performance of writing into a pipe

2013-02-18 Thread Michael Torrie
On 02/18/2013 10:00 AM, mikp...@gmail.com wrote: > [..] >> >> I don't see an exception in your answer. Where did you put it for us? >> > > well I just did print a message: > > PIPEPATH = ["/tmp/mypipe"] > > [..] > try: > self.process = os.popen( self.PIPEPATH, 'w') >

Re: improving performance of writing into a pipe

2013-02-19 Thread Michael Torrie
On 02/19/2013 02:24 AM, mikp...@gmail.com wrote: > Or rather: what would you try to catch in this particular case? As Peter said, nothing for now. But you seem very resistant to telling us what exception was raised. Though looking at your code more closely I can see that likely the error is rela

Re: Is there a graphical GUI builder?

2013-02-19 Thread Michael Torrie
On 02/19/2013 07:53 PM, Roland Koebler wrote: > Hi, > >> I'm new to Python and only a hobbyist programmer. A long time ago >> I used Microsoft's Visual Basic which had a nice (graphical) >> facility for creating GUIs which was part of the development >> environment. I'm wondering if there's a ut

Re: Is there a graphical GUI builder?

2013-02-20 Thread Michael Torrie
On 02/20/2013 12:44 AM, Steve Simmons wrote: > 2. Qt isn't 'free' (depending on what you are going to be doing with it) > - read the licensing rules. How so? It's LGPL. You can't get much freer than that. Both in terms of code and developer freedom, and proprietary freedom. -- http://mail.pyth

Re: PyQT app accessible over network?

2013-02-21 Thread Michael Torrie
On 02/21/2013 09:22 AM, Monte Milanuk wrote: > What I was wondering is what would be a good way of handling this with a > PyQt app? Build the desktop app first, and add some sort of > functionality to enable a lightweight web server and framework for the > additional data entry 'clients'? Or

Re: PyQT app accessible over network?

2013-02-22 Thread Michael Torrie
On 02/22/2013 02:49 PM, Monte Milanuk wrote: > Web2py does seem pretty attractive in that it seems to come with a lot > of functionality rolled in already. It seems to be pretty easy to > deploy... since this would be more of a case where the volunteer match > directors are not necessarily comp

Re: Python Newbie

2013-02-23 Thread Michael Torrie
On 02/21/2013 02:26 PM, Piterrr wrote: > Hi folks. I am a long time C sharp dev, just learning Python now due > to job requirements. My initial impression is that Python has got to > be the most ambiguous and vague language I have seen to date. I have > major issues with the fact that white space m

Re: Python Newbie

2013-02-23 Thread Michael Torrie
On 02/21/2013 04:34 PM, piterrr.dolin...@gmail.com wrote: > Thanks for this. Regarding ambiguity, you will never find me write > ambiguous code. I don't sabotage my own work. But the reality is > that in addition to writing my own code, I have to maintain existing. > I find it incredibly confusing

Re: Python Newbie

2013-02-23 Thread Michael Torrie
On 02/23/2013 11:44 AM, jmfauth wrote: > Very easy to explain: wrong, incorrect, naive unicode > handling. You should get together with ranging rick so that his python fork can have unicode done properly then. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Newbie

2013-02-23 Thread Michael Torrie
On 02/23/2013 11:10 AM, Steve Simmons wrote: > I'm using Rapid GUI Programming with Python & Qt (Mark Summerfield ISBN > 978-0-13-235418-9) - it fits for me because I needed something that > covered GUI development but also had an intro to the language. Sounds fun. One thing about PyQt is tha

Re: Python Newbie

2013-02-23 Thread Michael Torrie
On 02/22/2013 02:37 PM, piterrr.dolin...@gmail.com wrote: > Thanks to everyone for all the posts, some friendly some not. I read > all of them with genuine interest. I just finished reading this entire thread and I don't see any posts that are unfriendly. Perhaps some of them are calling you on y

Re: Python Newbie

2013-02-23 Thread Michael Torrie
On 02/23/2013 02:38 PM, Chris Angelico wrote: > On Sun, Feb 24, 2013 at 5:29 AM, Dennis Lee Bieber > wrote: >> Error codes under DEC VAX/VMS used odd integers for >> "success/information" and even integers for "warning/error" (been too >> many years, I think positive integers were success/

Re: Python Newbie

2013-02-23 Thread Michael Torrie
On 02/21/2013 03:40 PM, piterrr.dolin...@gmail.com wrote: > Chris, you are (almost) spot on with the if blocks indentation. This > is what I do, and it has served me well for 15 years. Most companies, development teams have unified coding style standards that all programmers must adhere to in the

Re: Basic Listview Example

2013-02-23 Thread Michael Torrie
On 02/23/2013 07:18 PM, Xx7 wrote: > Thanks all! > > I believe C# appears to be a better language for this type of GUI > creation. Better Listview Express has a tonne of options. It's a common misconception that a language has anything to do with a GUI. I know of at least 3 different GUI framew

Re: Python Newbie

2013-02-23 Thread Michael Torrie
On 02/23/2013 04:46 PM, piterrr.dolin...@gmail.com wrote: > Yes, it's true that I am trying to write C# code in Python. It is not > going to change any time soon, if at all - I have done too much > C#ing, C++ing before that and C-ing earlier still. Unfortunately as long as do, you'll find Python

Re: intX.__str__() ??

2013-02-24 Thread Michael Torrie
On 02/24/2013 09:23 AM, Ethan Furman wrote: > On 02/24/2013 07:46 AM, piterrr.dolin...@gmail.com wrote:> Hi guys, >> >> Question. Have this code >> >> intX = 32 # decl + init int var >> intX_asString = None # decl + init with NULL string var >> >> intX_asStrin

Re: Python Newbie

2013-02-24 Thread Michael Torrie
On 02/24/2013 10:37 AM, Dennis Lee Bieber wrote: > Decided to look up the VAX/VMS scheme... > > """ > If you know the condition code for a message, you can use F$MESSAGE to > translate the code to its associated message. For example: > $ WRITE SYS$OUTPUT F$MESSAGE(%X0001) > %SYSTEM-S-NOR

Re: Python Newbie

2013-02-24 Thread Michael Torrie
On 02/24/2013 03:40 PM, Mitya Sirenef wrote: > But if block doesn't have to be inside a function, right? It needs > to be inside a module, but then again everything is inside a module, but > it wouldn't be very object-oriented if the module was the only object in > Python :-). A module indeed fits

Re: Python Newbie

2013-02-24 Thread Michael Torrie
On 02/24/2013 06:04 PM, Steven D'Aprano wrote: > Variables do not have types in Python. > > Reset your thinking. Python is a dynamic language with name bindings and > strongly-typed objects, not a static language with strongly-typed > variables. If you don't understand the difference, ask. But s

Re: Python Newbie

2013-02-24 Thread Michael Torrie
On 02/24/2013 03:43 PM, piterrr.dolin...@gmail.com wrote: > I wanted Python to register what type of variable I'm after. So I > init my vars accordingly, int might be 0, float 0.0 and string with > null, err... None. As several people on the list have pointed out, there are no variables in Python.

Re: Shebang line on Windows?

2013-02-25 Thread Michael Torrie
On 02/25/2013 06:14 AM, Dave Angel wrote: > It's not Python that needs dos2unix, it's bash or equivalent. For some > reason, bash shebang processing still isn't tolerant of a trailing cr on > the line. Python doesn't care. Actually, the shell isn't involved in parsing the shebang line at all. T

Re: Shebang line on Windows?

2013-02-25 Thread Michael Torrie
On 02/25/2013 10:29 AM, D'Arcy J.M. Cain wrote: > So much the wrong solution. First of all, I don't think that Linus is > on the bash development team so he can't help there. Also, bash is not > the only shell in the world. Ooops you didn't read what I said. The shebang parsing is not done by

Re: Shebang line on Windows?

2013-02-25 Thread Michael Torrie
On 02/25/2013 10:29 AM, D'Arcy J.M. Cain wrote: > I don't run Windows myself so I can't test it but doesn't Python on > Windows work fine with Unix style EOL? So why not strip out the CR and > run the same file everywhere? As has been said on this thread, python is perfectly happy on windows with

Re: Shebang line on Windows?

2013-02-25 Thread Michael Torrie
On 02/25/2013 05:52 PM, Steven D'Aprano wrote: > Nobody is asking anyone to support "every Windows wart out there". > Windows-style line separators are not a wart, it is a convention used by > many, many tools, operating systems, data formats (e.g. email), etc. It > is an old, old convention, go

Re: Nuitka now supports Python 3.2

2013-02-27 Thread Michael Torrie
On 02/26/2013 05:18 AM, Steven D'Aprano wrote: > Nuitka now supports Python 3.2 syntax and compiles the full CPython 3.2 > test suite. Interestingly, GvR seemed to be quite critical of it in his comment at the end of this post: https://ep2013.europython.eu/conference/talks/nuitka-the-python-compi

Re: How would you do this?

2013-02-27 Thread Michael Torrie
On 02/27/2013 08:32 PM, eli m wrote: > How would you find the slope, y intercept, and slope-intercept form > equation for a line in python? Well, how do you do it by hand? Once you have the basic formula or algorithm down, just translate it into python. Math is math. We can answer specific ques

Re: Python newbie trying to embed in C++

2013-02-28 Thread Michael Torrie
On 02/28/2013 03:47 AM, Gisle Vanem wrote: > I saw you uses Thunderbird on Windows. I'm not sure how it by default handles > a reply-to when there is no "Reply-to" field in the header. To the address in > "From" / "Sender" or what? Thunderbird has a handy, "reply to list" button that works every

Re: Twisted or Tornado?

2013-02-28 Thread Michael Torrie
On 02/28/2013 05:28 PM, Jake Angulo wrote: > My requirements for this framework in descending order: 1) Easy to > use API 2) Widely available documentation / Examples / Community > contributions 3) Feature-wise - kinda most that you commonly need is > there By this I take it you mean you want to e

Re: QT Inspired web development framework for python

2013-02-28 Thread Michael Torrie
On 02/28/2013 06:48 PM, timothy crosley wrote: > I've been working on a web development framework that integrates several > popular QT features (such as a graphical template builder, signal / slots, > ui's built by objects) for the last few years, and I was hoping that some > people here might f

Re: Store a variable permanently

2013-03-01 Thread Michael Torrie
On 03/01/2013 03:19 AM, Jean-Michel Pichavant wrote: > I would serialize the data. > > http://docs.python.org/2/library/pickle.html > > funds=5 pickle.dump(funds, 'funds.pickle') > > # to reload funds: > > funds = pickle.load('funds.pickle') > > > The good thing with pickle is that it seriali

Re: i need help

2013-03-02 Thread Michael Torrie
On 02/21/2013 03:18 AM, leonardo wrote: > thanks, problem solved Apparently not. The shift key on your keyboard still seems to be non-functional. ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python in web development

2013-03-03 Thread Michael Torrie
On 03/03/2013 07:18 AM, Sarbjit singh wrote: > 1. Can I use Python (I want to use personally :)) over PHP/Perl? Yes of course. > 2. If Yes, I want to know the modules that I should learn for > achieving my requirement. I searched internet and found Python > provides CGI, Django etc. > > I don't

Re: How to install development package on linux?

2013-03-03 Thread Michael Torrie
On 03/02/2013 11:39 PM, Sarbjit singh wrote: > Yes, I configured the makefile for mod_wsgi as without any error : > ./configure --prefix=/opt/lampp/ --with-apxs=/opt/lampp/bin/apxs > --with-python=/opt/lampp/python/bin/python2.7 > --with-mutex-dir=/opt/lampp/var/run/wsgi This is not quite right

Re: Twisted or Tornado?

2013-03-03 Thread Michael Torrie
On 03/03/2013 04:35 PM, Jake Angulo wrote: > All, > > Thanks for your reply - I thought I would share the outcome of my choice: > > I have chosen to use twisted. The API is very decent to learn, though the > clincher is theres huge community / docs, and many projects used on > production. > >

Re: Embedding a for inside an html template for substitution

2013-03-04 Thread Michael Torrie
On 03/04/2013 08:14 AM, Ferrous Cranus wrote: > Instead of writing the above html data inside my html template how > would i write it with a for that then will be substituted by the > python script? What templating system are you using? Django's? > can you please write an example for me that use

Re: Embedding a for inside an html template for substitution

2013-03-04 Thread Michael Torrie
On 03/04/2013 01:06 PM, Ferrous Cranus wrote: > What do you advise me to do? > Generate html via python code like print '''stuf..''' or use an > html templating system? > Up until now i was using the first method and i though it would be a > nice idea to seperate design from code. > > But p

Re: pyqt4 & qt license

2013-03-09 Thread Michael Torrie
On 03/09/2013 07:08 PM, pitsa...@gmail.com wrote: > hello, > > i want to develop a GUI application that will be sold. i want to use > pyqt4. can i download and use the GPL version during the development > and then buy the commercial verion beofore i distribute the > application ? > > commercial v

Re: pyqt4 & qt license

2013-03-09 Thread Michael Torrie
On 03/09/2013 09:45 PM, Vito De Tullio wrote: > D. Xenakis wrote: > >> Can someone develop a closed source but NON-commercial software, by using >> PyQT4 GPL license? > > no, by definition of GPL: if you are using a GPL library, you must > distribute your software as GPL. > > (the GPL does not

Re: This mail never gets delivered. Any ideas why?

2013-03-09 Thread Michael Torrie
On 03/09/2013 02:25 PM, Νίκος Γκρ33κ wrote: > mail = form.getvalue('mail') > > id what the user types in an html form and click submits. this can be > a non valid email of course i just check if there is a '@' in the > mail address. > > But will the mail, gets delivered even if mail's value is in

Re: This mail never gets delivered. Any ideas why?

2013-03-10 Thread Michael Torrie
On 03/09/2013 10:10 PM, Νίκος Γκρ33κ wrote: > I'am using smtplib and i ahve contacted the hostgator administrators > and they say that Sendmail is ebaled for my reseller account. You need to post the code snippet that's failing (possibly changing private details like smtp server ip address for sec

Re: This mail never gets delivered. Any ideas why?

2013-03-10 Thread Michael Torrie
On 03/10/2013 11:53 AM, Νίκος Γκρ33κ wrote: > Michael may i send you an email with my reseller account password so > you can try things for yourself because i'am not sure what exactly i > must do in the remote jailed unix prompt ? It's never a good idea to share that kind of information with folks

Re: Running external module and accessing the created objects

2013-03-11 Thread Michael Torrie
On 03/11/2013 06:48 PM, Dave Angel wrote: > I hope you're just kidding. execfile() and exec() are two of the most > dangerous mechanisms around. import or __import__() would be much > better, as long as your user hasn't already run myapp.py as his script. It's not possible to setuid a python s

Re: PyWart: NameError trackbacks are superfluous

2013-03-16 Thread Michael Torrie
On 03/16/2013 06:11 PM, Rick Johnson wrote: > No, the "ACTUAL PROBLEM" is in the author. Surely any NameException can also be blamed on the author then, by your logic? -- http://mail.python.org/mailman/listinfo/python-list

Re: "monty" < "python"

2013-03-20 Thread Michael Torrie
On 03/20/2013 01:40 PM, jmfauth wrote: > I forgot Py33 is now optimized for ascii user, it is no more > unicode compliant and I stupidely tested/sorted lists of French > words... Just because you keep saying it does not make it true. How is Py33 not unicode compliant anymore? And maybe you ought

Re: how does the % work?

2013-03-23 Thread Michael Torrie
On 03/23/2013 01:38 AM, Steven D'Aprano wrote: > Just to add confusion, the two lines are exactly the same in Python 2, > where Print is not a function! Perhaps this is a good reason use the slightly more complicated but easier to get right format method. print ("{0}, {1}, {2}".format(1,2,3))

Re: I hate you all

2013-04-05 Thread Michael Torrie
On 04/05/2013 11:36 PM, Timothy Madden wrote: > I guess a discussion like this thread is the price to be paid for > relying solely on white space to delimit code blocks, like the python > syntax does. I've always been taught that in Python using tabs, particularly in the way that you use them (w

Re: I hate you all

2013-04-05 Thread Michael Torrie
On 04/05/2013 11:53 PM, Ian Kelly wrote: >> The new rules may look flexible at first sight, but the net effect they have >> is they push me to use non-default tab size (which is not good), > > What makes that not good? There is no law anywhere that says tabs are > 8 characters. That's just an ar

Re: I hate you all

2013-04-05 Thread Michael Torrie
On 04/05/2013 11:28 PM, Benjamin Kaplan wrote: > http://www.xkcd.com/1172/ How did I ever miss this before? That is truly awesome. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python module vs library

2013-04-09 Thread Michael Torrie
On 04/09/2013 03:58 AM, k.lykour...@gmail.com wrote: > Hi, what is the difference between python module and library ? "library" doesn't really mean anything specifically to Python's interpreter. It's not a valid keyword and is only used by humans to describe the abstract function and nature of a

Re: Python module vs library

2013-04-09 Thread Michael Torrie
On 04/09/2013 08:29 AM, rusi wrote: > I guess Michael meant "...module or package." > Else the next question is going to be "Can you explain recursion in > python?" :-) You're right. On both counts. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: performance of script to write very long lines of random chars

2013-04-10 Thread Michael Torrie
On 04/10/2013 07:21 PM, gry wrote: > from sys import stdout > from array import array > import random > nchars = 3200 > rows = 10 > avail_chrs = > '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%& > \'()*+,-./:;<=>?@[\\]^_`{}' > a = array('c', 'X' * nchars) > > for l in ran

Re: People in the python community [was Re: Unicode issue with Python v3.3]

2013-04-11 Thread Michael Torrie
On 04/10/2013 10:50 AM, Νίκος Γκρ33κ wrote: > I'am not sure i follow you. How did my topic changed?! Is this > possible? This is a mailing list/nntp newsgroup. The subject line can be changed arbitrarily by anyone replying to another message. Normally this is done to indicate a natural progressi

Re: Message passing syntax for objects | OOPv2

2013-04-13 Thread Michael Torrie
On 04/13/2013 12:28 AM, Mark Janssen wrote: >> Mark, this proposal is out of place on a Python list, because it proposes an >> object methodology radically different from any that is implemented in >> Python now, or is even remotely likely to be implemented in Python in the >> future. > > Wow, you

Re: Process tuple contents on the fly

2013-04-15 Thread Michael Torrie
On 04/15/2013 02:35 PM, Tobiah wrote: > On 04/15/2013 11:25 AM, Gnarlodious wrote: >> Say I have a tuple I want to expand assigning to variables: >> >> tup = *func() > > What is the asterisk for? I assume it's a python 3 > thing, because I get a syntax error, but I'm having > trouble Googling it.

Re: Calling python script in dos and passing arguments

2013-04-16 Thread Michael Torrie
On 04/16/2013 08:14 AM, PEnergy wrote: > Greetings, > > I am trying to write a python script that, when called from the DOS > prompt, will call another python script and pass it input variables. > My current code will open the other python script but doesn't seem to > pass it any values: > > impo

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-18 Thread Michael Torrie
On 04/16/2013 04:38 PM, Mark Janssen wrote: > (Note this contrasts starkly with Java(script), which doesn't seem > to be based on anything -- can anyone clarify where Java actually > comes from?) Java is not equal in any way with JavaScript. The only thing they share are semicolons and braces.

Re: ask for note keeper tomboy's style

2013-04-21 Thread Michael Torrie
On 04/21/2013 12:20 AM, LordMax wrote: > Hi to all. > > I am new to python and I was asked to implement a system of notes in > tomboy's style for my company. > > As one of the requirements is the ability to synchronize notes > between multiple PC (program level or through cloud-folder does not >

Re: WebScraping

2006-11-04 Thread Michael Torrie
On Sun, 2006-11-05 at 13:40 +1100, Steven D'Aprano wrote: > On Sun, 05 Nov 2006 08:09:52 +1000, Graham Feeley wrote: > > > Can someone steer me to scripts / modules etc on webscraping please??? > > The definitive documentation on the built-in Python modules can be found > here: http://docs.python

Re: Python v PHP: fair comparison?

2006-11-14 Thread Michael Torrie
On Tue, 2006-11-14 at 18:55 -0800, Luis M. González wrote: > > > - Python is more readable, and more general purpose > > Yes, php is only for web. Absolutely false. Most of my standalone, command-line scripts for manipulating my unix users in LDAP are written in PHP, although we're rewriting th

Re: Why are slice indices the way they are in python?

2006-11-30 Thread Michael Torrie
On Thu, 2006-11-30 at 08:58 -0800, [EMAIL PROTECTED] wrote: > And if talking about dates, then I suggest NEVER use 2006-12-31 > 23:59:59 in data, always 2007-01-01 00:00:00 instead. Forgive me for my ignorance, but isn't "2006-12-31 23:59:59" actually one entire second earlier than "2007-01-01 00

Re: How do I write to a CD?

2007-06-16 Thread Michael Torrie
On Sat, 2007-06-16 at 11:50 -0400, [EMAIL PROTECTED] wrote: > Hello: > >I am looking for Python code to open, read, write, close, > and make bootable the following: > CD > DVD > USB Drive There will be no cross-platform way to do this. Certainly no python libraries. The closest thing

Re: GUI apps in Windows with native widgets?

2007-06-18 Thread Michael Torrie
On Tue, 2007-06-19 at 04:13 +0200, Gilles Ganault wrote: > Hello > > I'd like to write a GUI app in Python exclusively for Windows. > Apparently, development of PythonWin has stopped a long time ago. > > Is there another thin wrapper to write apps in Windows? I'd rather not > have to ship e

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-13 Thread Michael Torrie
On Sun, 2007-05-13 at 21:01 +0200, Stefan Behnel wrote: > For example, I could write > > def zieheDreiAbVon(wert): > return zieheAb(wert, 3) > > and most people on earth would not have a clue what this is good for. However, > someone who is fluent enough in German could guess from the na

Re: Python compared to other language

2007-05-19 Thread Michael Torrie
On Fri, 2007-05-18 at 22:28 -0400, Steve Holden wrote: > Surely the fact that Python is available on so many platforms implies > that C is a fairly portable language. I realise that you have to take > platform specifics into account much more than you do in Python, but I > do feel you are being

Re: Memory utilization (linux v. openbsd)

2007-07-28 Thread Michael Torrie
[EMAIL PROTECTED] wrote: > My problem is that the two process under OpenBSD are going to fail with > a MemoryError becaause the size just keeps getting larger and larger. > ulimit -d is 1G for each process. The problem is that you can't get accurate memory use readings from top. The reality is

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Michael Torrie
On Sun, 2007-04-01 at 02:49 +, Dennis Lee Bieber wrote: > Take that up with ACT... GNAT 3.15p was explicitly unencumbered, but > the current version of GNAT, in the GPL (no-service contract) form has > gone the other direction, claiming that executables must be released > GPL. The no-ser

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Michael Torrie
On Sat, 2007-03-31 at 20:47 -0700, Paul Rubin wrote: > Michael Torrie <[EMAIL PROTECTED]> writes: > > The no-service contract version of the GPL is not the same as the > > standard GPLv2. > > I don't see how that can be--we're talking about a GCC-based compil

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Michael Torrie
On Sat, 2007-03-31 at 20:47 -0700, Paul Rubin wrote: > Michael Torrie <[EMAIL PROTECTED]> writes: > > The no-service contract version of the GPL is not the same as the > > standard GPLv2. > > I don't see how that can be--we're talking about a GCC-based compil

Re: supplying password to subprocess.call('rsync ...'), os.system('rsync ...')

2007-10-07 Thread Michael Torrie
timw.google wrote: > Hi > > I want to write a python script that runs rsync on a given directory > and host. I build the command line string, but when I try to run > subprocess.call(cmd), or p=subprocess.Popen(cmd, shell=True),or > os.system(cmd), I get prompted for my login password. I expected t

Re: Interactive apps with Python

2008-02-21 Thread Michael Torrie
[EMAIL PROTECTED] wrote: > Folks, > I am trying to build an interactive test application. I > would like to generate interactive commands to an existing > server(ftpd) > so commands like ftp 192.68.20.1 > ace>login: > ace >password : > I should be able to mimic human intervent

Re: How to subclass a built-in int type and prevent comparisons

2008-03-01 Thread Michael Torrie
[EMAIL PROTECTED] wrote: > Tell Wall. But why not [ 2, 3 ]>= 2? Back to your question, another > option is to not subclass. Umm, no. You need to actually read the posts before you respond to them. His question was whether or not to throw an exception in this case. He's *already* subclassed th

Question about lambda and variable bindings

2008-03-01 Thread Michael Torrie
I need to use a lambda expression to bind some extra contextual data (should be constant after it's computed) to a call to a function. I had originally thought I could use something like this demo (but useless) code: funcs=[] def testfunc(a,b): print "%d, %d" % (a,b) for x in xrange(10):

Re: Question about lambda and variable bindings

2008-03-01 Thread Michael Torrie
poof65 wrote: > An idea, i don't know if it will work in your case. > > for x in xrange(10): > funcs.append(lambda p,z=x: testfunc(z+2,p)) Good idea. I will try it. I also figured out a way to architecture my program differently to avoid this problem. But this idiom might be handy in certain

popening a process in a specific working directory

2008-03-04 Thread Michael Torrie
I have a small multi-threaded program that spawns a number of threads that each spawn a particular process in a particular temporary directory. My problem is that using os.chdir to change the working directory before popening the process doesn't always work because another thread might change the

Protocol for thread communication

2008-03-04 Thread Michael Torrie
Does anyone have any recommended ideas/ways of implementing a proper control and status protocol for communicating with threads? I have a program that spawns a few worker threads, and I'd like a good, clean way of communicating the status of these threads back to the main thread. Each thread (wrap

Re: Python 2.6.1 @executable_path

2009-01-10 Thread Michael Torrie
googler.1.webmas...@spamgourmet.com wrote: > Thanks for the link but I don't want to do a make a python script as > an applicatin, I want to embedd python into a C++ app so thats the > reason why I have to compile Python. If you are embedding python, then all you have to do is stick the python mo

Re: Python 2.6.1 @executable_path

2009-01-11 Thread Michael Torrie
googler.1.webmas...@spamgourmet.com wrote: > Thank you, I found PySys_SetPythonHome() to set the path where the lib > folder of Python is, but I guess they are not really implemented > because they are fixed compiled with an absolute path, aren't they? I'm afraid I'm not following you here. What

Re: Python 2.6.1 @executable_path

2009-01-11 Thread Michael Torrie
googler.1.webmas...@spamgourmet.com wrote: > yeap, okay, its just the beginning so I didn't know that the framework > is still the dylib file. > Well, I only want to compile python and put the framework in the > subdirectory. Thats all. > And the current state is, that the framework is not found be

Re: Dynamic methods and lambda functions

2009-01-24 Thread Michael Torrie
unine...@gmail.com wrote: > The attributes are right, but the getter are not working. The problem > is that the lambda function always execute the last parameter passed > for all instances of the methods. How could it be done the right way? Basically, don't use a lambda. Create a real, local clos

Re: unable to print Unicode characters in Python 3

2009-01-26 Thread Michael Torrie
jefm wrote: >> Hmm this works for me, >> it's a self compiled version: >> ~ $ python3 >> Python 3.0 (r30:67503, Dec 29 2008, 21:35:15) >> [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2 > > You are running on Linux. Mine is on Windows. > Anyone else have this issue on Windows ? As Benjamin Kaplin

Re: is python Object oriented??

2009-01-29 Thread Michael Torrie
M Kumar wrote: > but still I am not clear of the execution of the code, when we write or > execute a piece of python code without defining class, predefined class > attributes are available (not all but __name__ and __doc__ are available). > does it mean anything to this topic. Is it necessory to h

Re: is python Object oriented??

2009-01-30 Thread Michael Torrie
Hung Vo wrote: > I'm new to Python and also wondering about OOP in Python. > > I want to justify the above question (is Python Object-Oriented?). > Does Python follow the concepts/practices of Encapsulation, > Polymorphism and Interface, which are quite familiar to Java > programmers? I'd say tha

Re: is python Object oriented??

2009-01-30 Thread Michael Torrie
Veerendra Ganiger wrote: > Python is not purely object oriented programming, because we can write > functions without any class. > You are right, predefined class attributes are available when we write or > execute a piece of python code without defining class, that means it's just > using objects

Re: is python Object oriented??

2009-01-31 Thread Michael Torrie
thmpsn@gmail.com wrote >> This allows people to meddle with internals, at their own risk, >> if it ends up being absolutely necessary. > > If it ends up being necessary, the class's design is flawed. (Though > in this case, the flaw is easily solved by simply providing a getter.) No the class

Re: is python Object oriented??

2009-01-31 Thread Michael Torrie
thmpsn@gmail.com wrote: >> To be clear, python does not force you to lay out your code according to >> some strict object-oriented paradigm. But Python itself is still purely >> object-oriented, as is your script when parsed. > > But it's only a faking, and things such as inheritance and > pol

<    10   11   12   13   14   15   16   17   18   19   >