Re: passing a socket to a spawned process.

2004-11-28 Thread Dave Cole
convinced to use a Python style license? This would mean that some time in the (hopefully not too distant) future the code could be added to the standard socket module. - Dave -- http://www.object-craft.com.au -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie MySQLdb / MySQL version problem, I think

2004-11-29 Thread Dave Merrill
r I'd borked it up somehow. Bless the problems you can fix, easily, even... Dave Merrill > I'm using MySQLdb with mysql 4.1 and I've seen this too - to get > around it go to the following link: > > http://dev.mysql.com/doc/mysql/en/Old_client.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Protecting Python source

2004-11-29 Thread Dave Reed
On Monday 29 November 2004 14:13, Grant Edwards wrote: > On 2004-11-29, Peter Maas <[EMAIL PROTECTED]> wrote: > > > If the "reverse engineering" argument boils down to "protecting source > > doesn't make sense" then why does Microsoft try so hard to protect > > its sources? > > To avoid embaras

Re: Python Design Patterns

2004-11-30 Thread Dave Cook
sure is this the right news group to post this request. Yup, this is the place. Dave Cook -- http://mail.python.org/mailman/listinfo/python-list

Re: Python GTK import error

2004-11-30 Thread Dave Cook
config -v Dave Cook -- http://mail.python.org/mailman/listinfo/python-list

Re: comment out more than 1 line at once?

2004-11-30 Thread Dave Cook
once you've marked the rectangle.) Dave Cook -- http://mail.python.org/mailman/listinfo/python-list

Re: RELEASED Python 2.4 (final)

2004-11-30 Thread Dave Merrill
Newb question: Is it possible/recommended to have multiple versions of Python installed simultaneously? Earlier, I installed 2.4rc1, and a number of things in my 2.3.3 install stopped working. Are there known techniques for managing multiple versions? Thanks, Dave Merrill -- http

Re: RELEASED Python 2.4 (final)

2004-11-30 Thread Dave Merrill
SPE did the same thing. After I uninstalled 2.4, SPE ran again under 2.3.3, and that's what I'm using now. What caused this kind of interaction between installs? SPE and wxWindows both live in site-packages, which I would have thought would make them Python-version specific. Dave Merril

Re: RELEASED Python 2.4 (final)

2004-11-30 Thread Dave Merrill
Used the packaged Windows (win2k) installs of Python and all components I described. Not a C guy, no compiler, minimal knowledge about them. Dave Merrill "Anthony Baxter" wrote: > > Newb question: Is it possible/recommended to have multiple versions of > > Python in

Re: Syntax for extracting multiple items from a dictionary

2004-12-01 Thread Dave Merrill
"anton muhin" wrote: > Stefan Behnel wrote: > > > > > > shark schrieb: > > > >> row = {"fname" : "Frank", "lname" : "Jones", "city" : "Hoboken", > >> "state" : > >> "Alaska"} > >> cols = ("city", "state") > >> > >> Is there a best-practices way to ask for an object containing only the > >> keys > >

Re: Python 3000 and "Python Regrets"

2004-12-01 Thread Dave Benjamin
r from __past__ import __mistakes__ LOL! Better yet: import __past__ del __past__.__mistakes__ Boy, what a load off! Merry Christmas in advance, Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Design Patterns

2004-12-02 Thread Dave Cook
"Tony Ha" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Hello Dave, > > Thanks for pointing me to the Cookbook website. > > On 2004-11-29, Tony Ha <[EMAIL PROTECTED]> wrote: > > > > > I wonder, can any Python

Audio interviews of Guido or other Python advocates?

2004-12-04 Thread Dave Benjamin
27;s about the closest I've found so far. -- .:[ dave benjamin: ramen/[sp00] -:- spoomusic.com -:- ramenfest.com ]:. "talking about music is like dancing about architecture." -- http://mail.python.org/mailman/listinfo/python-list

Re: Audio interviews of Guido or other Python advocates?

2004-12-04 Thread Dave Benjamin
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: > Dave Benjamin wrote: > >> I looked around for recordings of Guido, but couldn't find any. > > http://www.python.org/~guido/guido.au I found a few--slightly longer--video interviews here today: http://technet

Re: Audio interviews of Guido or other Python advocates?

2004-12-04 Thread Dave Benjamin
In article <[EMAIL PROTECTED]>, Jimmy Retzlaff wrote: > Dave Benjamin wrote: >> I looked around for recordings of Guido, but couldn't find any. Does >> anyone know of any streamable audio (or video) interviews or speeches >> featuring Guido, the bots, or any

Re: Quixote+Nevow+LivePage

2004-12-04 Thread Dave Brueck
to know for sure. I did a quick perusal of the code and thought that all the communication was via the XmlHttpRequest functionality available in a lot of modern browsers (IE, Mozilla, Safari). -Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: system requirements for python 2.4

2004-12-13 Thread Dave Reed
/configure; make;make install" assuming you have write permissions on /usr/local; if not su to root before doing "make install". Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: Redirecting ./configure --prefix

2004-12-13 Thread Dave Reed
tcsh setenv LD_LIBRARY_PATH /some/private/dir/lib If that works, you can put this in the appropriate dot file so you don't have to retype them each time you login/create a new shell. For bash I think it's ~/.bashrc or ~/.profile and for csh it's ~/.cshrc and ~/.tcshrc for tcsh. HTH, Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: lies about OOP

2004-12-15 Thread Dave Benjamin
t across all styles of programming. Interestingly, Python's main unit of modularity is the "module", not the "class". A direct translation of a typical Python module to Java would look something like a Java class containing only static methods and inner classes. Even this would

Re: Python + Newspipe

2004-12-10 Thread Dave Kuhlman
pipe.py on line 895 in function/method LeerConfig. 3. It's looking for a section named "NewsPipe" in your options/config file. Check your config file. Is that section name misspelled? Is the section missing? Does the NewsPipe documentation tell you where the config f

Re: A rational proposal

2004-12-19 Thread Dave Benjamin
t impression that the results of the operation are > precise. Decimals will be converted to rationals before the > operation. [Open question: is this the right thing to do?] Sounds right to me. Cheers, Dave -- .:[ dave benjamin: ramen/[sp00] -:- spoomusic.com -:- ramenfest.com ]:

Re: Best GUI for small-scale accounting app?

2004-12-21 Thread Dave Cook
evelopment (particularly the new UIManager), and that the list widget is relatively slow. Lately I've been evaluating jython and Swing, though. Dave Cook -- http://mail.python.org/mailman/listinfo/python-list

Re: Best GUI for small-scale accounting app?

2004-12-21 Thread Dave Cook
as simple as a combo box (i.e. an editable entry with a drop down), let alone the rich set of widgets something like wxwidgets offers. Also web development doesn't seem as coherent to me as development with a good GUI framework. Dave Cook -- http://mail.python.org/mailman/listinfo/python-list

ANN: generateDS.py 8a available

2004-12-22 Thread Dave Kuhlman
write the instance (and any nested sub-instances) to a file object as XML text. - An "exportLiteral" method that will write the instance (and any nested sub-instances) to a file object as Python literals (text). Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman -- http://mail.python.org/mailman/listinfo/python-list

Re: Why no list heritable type?

2004-12-22 Thread Dave Benjamin
dict", I'd appreciate it if we didn't deprecate (or depreciate =) UserList/Dict just yet. I maintain several modules that are portable to both implementations. Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: Best GUI for small-scale accounting app?

2004-12-23 Thread Dave Cook
On 2004-12-21, Paul Rubin wrote: > Dave Cook <[EMAIL PROTECTED]> writes: >> Web browser "widgets" seem pretty limited to me, though. > > You might not care. And in that case Tk is much simpler than just about anything else, unless looks are really important. &

Re: what would you like to see in a 2nd edition Nutshell?

2004-12-30 Thread Dave Cook
On 2004-12-29, Alex Martelli <[EMAIL PROTECTED]> wrote: > the coverage of Twisted and adding just a few things (numarray -- I'd rather have a whole book on Twisted :p. But I'll take a more extensive section in PiaN if I can't have it. Dave Cook -- http://mail.pyt

Re: what would you like to see in a 2nd edition Nutshell?

2004-12-30 Thread Dave Reed
what would be really nice is an advanced Python book that discusses many of the topics mentioned in this message and earlier messages in the thread. I'd rather see an in-depth advanced book than light coverage of the topics added to a Nutshell book. I own at least 8 or 9 Pytho

Sybase module 0.37pre2 released

2005-03-20 Thread Dave Cole
shows that the problem is probably in the CT emulation layer as tsql displays the correct value, but sqsh displays 0. * Output hook patch from Ty Sarna has been applied. * Applied patch from Andre Sedinin to improve error handling. * Improved detection of SYBASE_OCS. - Dave -- http://www.object-craft.com.au -- http://mail.python.org/mailman/listinfo/python-list

Re: [DB-SIG] Sybase module 0.37pre2 released

2005-03-20 Thread Dave Cole
Dave Cole wrote: The module is available here: http://www.object-craft.com.au/projects/sybase/download/sybase-0.37pre1.tar.gz Ooops. Make that: http://www.object-craft.com.au/projects/sybase/download/sybase-0.37pre2.tar.gz - Dave -- http://www.object-craft.com.au -- http://mail.python.org

Re: Distributing closed source modules

2005-03-24 Thread Dave Brueck
encrypted archive file, you could download it on the fly from a remote server over a secure connection, etc. -Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: Distributing closed source modules

2005-03-25 Thread Dave Brueck
Fuzzyman wrote: Dave Brueck wrote: It's certainly something lot's of people are interested in. I guess it depends who your audience is. If ytour code isn't for *mass* distribution - the chances of people putting a lot of effort into breaking it are greatly reduced. I don't ht

__getslice__ passed INT_MAX rather than sys.maxint for missing endpoint?

2005-03-26 Thread Dave Huang
never got executed, causing problems -- Name: Dave Huang | Mammal, mammal / their names are called / INet: [EMAIL PROTECTED] | they raise a paw / the bat, the cat / FurryMUCK: Dahan | dolphin and dog / koala bear and hog -- TMBG Dahan: Hani G Y+C 29 Y++ L+++ W- C++ T++ A+ E+ S++

Re: What's the best GUI toolkit in Python,Tkinter,wxPython,QT,GTK?

2005-03-28 Thread Dave Cook
e best cross-platform support among CPython toolkits, but it never seemed very Pythonic to me. There's a higher-level package called wax that aims to remedy that. Dave Cook -- http://mail.python.org/mailman/listinfo/python-list

Re: Distributing closed source modules

2005-03-29 Thread Dave Brueck
Fuzzyman wrote: Dave Brueck wrote: By "futile" I meant that, if the code ends up running on a user's machine, then a sufficiently motivated person could crack it wide open, regardless of implementation language - the only way to truly protect the code is to never let it out of

Attributes and built-in types

2005-04-01 Thread Dave Opstad
y, which is why (presumably) the attribute assignment worked for Test but not for int. Just curious... Dave -- http://mail.python.org/mailman/listinfo/python-list

Sybase module 0.37 released

2005-04-06 Thread Dave Cole
WHAT IS IT: The Sybase module provides a Python interface to the Sybase relational database system. It supports all of the Python Database API, version 2.0 with extensions. NOTES: The 0.37 release is identical to 0.37pre3 as no problems were reported with the prerelease. This release contains a nu

Manipulating Peach Tree (accounting) Btrieve database

2005-04-07 Thread Dave Boland
ll is done, I need to do some good looking cross-tab reports and maybe make the info available by web page. Thanks, Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: Sockets

2005-04-08 Thread Dave Brueck
;\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x00H\x00H\x00\x00\xff\xdb\x00C\x00 \x05\x03\x04\x04\x04\x03\x05\x04\x04\x04\x05\x05\x05\x06\x07\x0c\x08\x07\x07\x07 \x07\x0f\x0b\x0b\t' >>> So, the fact that you're getting the data from a database is probably immaterial. HTH, Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: Are circular dependencies possible in Python?

2005-04-09 Thread Dave Brueck
) ... >>> B(0) B 0 A 1 B 2 ... See - all that matters is that they exist before you call them. -Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: Distributing Python Apps and MySQL

2005-04-10 Thread Dave Cook
gle DLL for the engine, a single file for the data, and the license couldn't be more liberal. http://www.sqlite.org Dave Cook -- http://mail.python.org/mailman/listinfo/python-list

Re: workaround for generating gui tools

2005-04-10 Thread Dave Cook
XRC files instead of Python? I admit I've never tried it with wxGlade, so I don't know how well it works, but with the original Glade one only uses XML, you can't generate Python at all. Dave Cook -- http://mail.python.org/mailman/listinfo/python-list

Re: semicolons

2005-04-11 Thread Dave Brueck
hon syntax too. Don't punish Python for the shortcomings of other languages! :) -Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't Stop Process On Windows

2005-04-12 Thread Dave Brueck
Dan wrote: I have a python script running under Windows XP that I need to terminate from the keyboard. A control-c works fine under Linux, but not under Windows. I'm pretty sure that the culprit is 'select' that I'm using to multiplex socket i/o, which seems to be blocking the keyboard interrupt.

Re: Python 2.4 killing commercial Windows Python development ?

2005-04-12 Thread Dave Brueck
n disk, and so what if it doesn't fit on a floppy, for example. 3) As soon as you get started on such a project, almost immediately you will be overwhelmed with a desire to create a CPAN-like system while you're at it, at which point your project's status will shift from "making good

Re: Python 2.4 killing commercial Windows Python development ?

2005-04-12 Thread Dave Brueck
Thomas Heller wrote: Dave Brueck <[EMAIL PROTECTED]> writes: Terry Reedy wrote: If there is something about the default install of Python on Windows that makes it less desireable or less easy than other platforms, then maybe that can be fixed. To make installation easier, maybe someone

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Apr 11)

2005-04-14 Thread Dave Brueck
ght it was for emphasis. -Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: Glade for Windows and Python

2005-04-15 Thread Dave Cook
On 2005-04-15, Richard Lyons <[EMAIL PROTECTED]> wrote: > Has anyone been successful in using Glade for Windows with Python? Yes, it works fine. http://gladewin32.sourceforge.net/ http://www.pcpm.ucl.ac.be/~gustin/win32_ports/ Dave Cook -- http://mail.python.org/mailman/listinfo/python-list

Re: (PHP or Python) Developing something like www.tribe.net

2005-04-26 Thread Dave Benjamin
n popping up quite a bit lately, and they don't seem unreasonably slow to me. (CPUs have of course exploded in speed in the past few years.) -- .:[ dave benjamin: ramen/[sp00] -:- spoomusic.com -:- ramenfest.com ]:. "talking about music is like dancing about architecture." -- http://mail.python.org/mailman/listinfo/python-list

Re: Which IDE is recommended?

2005-04-27 Thread Dave Cook
pse to get them. I use XEmacs. Once upon a time emacs was considered bloated, but it's tiny compared to eclipse. Dave Cook -- http://mail.python.org/mailman/listinfo/python-list

Re: python equivalent of php implode

2005-04-27 Thread Dave Cook
".join(keys) valueList = ["%%(%s)s" % key for keys] sql = "INSERT INTO %s (%s) VALUES (%s)" % (table, columnList, valueList) cursor.execute(sql, params) Though you would probably want to go further and filter out keys that don't belong in the table, something li

Re: anonymous functions/expressions without lambda?

2005-04-28 Thread Dave Benjamin
, value) return _return_func Or, if you want to delay binding of the "value" parameter: def attrsetter(obj, name): def _return_func(value): return setattr(obj, name, value) return _return_func Cheers, Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: anonymous functions/expressions without lambda?

2005-04-28 Thread Dave Benjamin
Paul Miller wrote: Michael Hoffman wrote: Dave Benjamin wrote: I think you meant to write something like this: def attrsetter(obj, name, value): def _return_func(): return setattr(obj, name, value) return _return_func Sure did. Sorry. You guys have been very helpful! While on the

Re: anonymous functions/expressions without lambda?

2005-04-28 Thread Dave Benjamin
Dave Benjamin wrote: You could use a combination of bound methods and the "curry" function defined in the Python Cookbook: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52549 The examples in the discussion do just that. Also, in the CVS version of Python, there's a ne

Re: anonymous functions/expressions without lambda?

2005-04-28 Thread Dave Benjamin
blem. We'll see how this all pans out in the next few years. I'm not too fond of removing features from a language for purely aesthetic reasons, but lambda's really stuck in a syntactic quandry due to the statement/expression dichotomy, so I can understand to some extent Guido's desire to remove it. Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: OOP

2005-04-28 Thread Dave Cook
would be nice to have something like that for Python. Dave Cook -- http://mail.python.org/mailman/listinfo/python-list

Re: I forgot to wind up my example .... ; (

2005-04-29 Thread Dave Rose
write the lines directly into Python, like maybe at the IDLE interpreter. Like maybe you're testing the functionality of the routine for correctness, not actual implementation. You have a ShoppingCartClass(), and three users-> Dave, Tommy, Bryan. ShoppngCartClass() has 3 methods: .Add

Re: Please help with this

2013-11-12 Thread Dave Angel
On Tue, 12 Nov 2013 20:18:58 -0800 (PST), saad imran wrote: Could you point out any errors in my code: que1 = "4481 *2" ans1 = "8962" que2 = "457 * 21" ans2 = "9597" These values should all be in a single named structure, probably a list of tuples. Then all that duplicated code could be cond

Re: The Spirit of Python

2013-11-14 Thread Dave Angel
On Thu, 14 Nov 2013 13:11:08 -0500, Roy Smith wrote: Intriguing subject line but an empty message body. Please post in text not html if you want everyone to see it. Thanks -- DaveA -- https://mail.python.org/mailman/listinfo/python-list

Re: Implementing #define macros similar to C on python

2013-11-14 Thread Dave Angel
On Thu, 14 Nov 2013 18:29:48 -0800 (PST), JL wrote: One of my favorite tools in C/C++ language is the preprocessor macros. One example is switching certain print messages for debugging use only #ifdef DEBUG_ENABLE DEBUG_PRINT print #else DEBUG_PRINT Is it possible to implement some

Re: The Spirit of Python

2013-11-14 Thread Dave Angel
On Fri, 15 Nov 2013 15:16:09 +1100, Ben Finney wrote: Dave Angel writes: > On Thu, 14 Nov 2013 13:11:08 -0500, Roy Smith wrote: > Intriguing subject line but an empty message body. Please post in text > not html if you want everyone to see it. My message agent also

Re: Question regarding 2 modules installed via 'pip'

2013-11-16 Thread Dave Angel
On Sat, 16 Nov 2013 07:15:01 -0800 (PST), Ferrous Cranus wrote: 'locate pythοn3.4 | rm -rf' will this help or do any accidental damage? The files deleted by the rm -rf have nothing to do with the results of locate. Since you don't understand that , your system is at high risk till you

Re: Data structure question

2013-11-17 Thread Dave Angel
On Mon, 18 Nov 2013 02:03:38 +, "Joseph L. Casale" wrote: I have a need for a script to hold several tuples with three values, two text strings and a lambda. I need to index the tuple based on either of the two strings. Normally a database would be ideal but for a self-contained script

Re: Oh look, another language (ceylon)

2013-11-18 Thread Dave Angel
On 18 Nov 2013 14:30:54 GMT, Steven D'Aprano wrote: - 15 bits for a length. 15 bits give you a maximum length of 32767. There are ways around that. E.g. a length of 0 through 32766 means exactly what it says; a length of 32767 means that the next two bytes are part of the length too, givi

Re: Building a tree-based readline completer

2013-11-18 Thread Dave Angel
On Mon, 18 Nov 2013 08:55:05 -0800 (PST), roey.k...@gmail.com wrote: On Monday, November 18, 2013 11:54:43 AM UTC-5, roey wrote: > Thank you. In looking over these classes, I see though that even them, I would run against the same limitations, though. Please don't double space your quotes. A

Re: Newbie - Trying to Help a Friend

2013-11-19 Thread Dave Angel
On 20 Nov 2013 00:17:23 GMT, Steven D'Aprano wrote: problem by hand. I'll get you started by solving the problem for 7. Positive integers less than 23 are 1, 2, 3, 4, 5, 6. So let's start checking them for divisors: Where did 23 come from? - 1 is not divisible by 2, 3 or 5, so we coun

Re: Newbie - Trying to Help a Friend

2013-11-19 Thread Dave Angel
On 20 Nov 2013 03:52:10 GMT, Steven D'Aprano wrote: 2 does count because it isn't divisible by 3. The question states, "[count] how many positive integers less than N are not divisible by 2,3 or 5". Two is not divisible by 3, so "not divisible by 2,3 or 5" is true, so two gets counted. Th

Re: using getattr/setattr for local variables in a member function

2013-11-21 Thread Dave Angel
On Fri, 22 Nov 2013 00:52:21 +, MRAB wrote: > If I have a class that has some member functions, and all the functions > define a local variable of the same name (but different type), is there > some way to use getattr/setattr to access the local variables specific > to a given function

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-22 Thread Dave Angel
Try posting in text, as some of us see nothing in your message. This is a text newsgroup, not html. Also make a subject line that summarizes your issue, not the urgency. -- DaveA -- https://mail.python.org/mailman/listinfo/python-list

Re: Help me to print to screen as well as log

2013-11-23 Thread Dave Angel
On Sat, 23 Nov 2013 05:11:11 -0800 (PST), Himanshu Garg wrote: How can I write to the same file from two different scripts opened at same time? Using what version of python and on what OS? Sone OS's will open the file exclusively by default. Others will let you stomp all over some other proc

Re: Excute script only from another file

2013-11-24 Thread Dave Angel
On Sun, 24 Nov 2013 17:55:08 -0800 (PST), Himanshu Garg wrote: Like, I have two scripts "scrip1.py" and "script2.py" and there is a line in "script1.py" to call "script2.py" as subprocess.call(["python", "script2.py"]). Then this is should call script2 but I should not be able to directly

Re: Excute script only from another file

2013-11-25 Thread Dave Angel
On Mon, 25 Nov 2013 02:52:46 -0800 (PST), Himanshu Garg wrote: My motive is "I will give scripts to somebody else and he should not run the script directly without running the parent script". Perhaps it should be a module, not a script. Have it protect itself with the usual if __name__ == "_

Re: error

2013-11-27 Thread Dave Angel
On Wed, 27 Nov 2013 16:37:37 -0800 (PST), speen saba wrote: p = [1,2] And below is the error. Evrything works fine untill class polar point, but when I try to pick point (instance) p in the list i.e x,y (1,2,3,1). It does not work. I mean p.x gets the error where it should give me the value

Re: Python project

2013-11-27 Thread Dave Angel
On Wed, 27 Nov 2013 17:43:27 -0800 (PST), ngangsia akumbo wrote: I a beginner in python. The first project is to build an online city guide start with my own city. I will need some support on where to get started. Are you experienced in other languages, in html? Is this your first time prog

Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Dave Angel
On Fri, 29 Nov 2013 21:28:47 -0500, Roy Smith wrote: In article , Chris Angelico wrote: > On Sat, Nov 30, 2013 at 1:08 PM, Roy Smith wrote: > > I would certainly expect, x.lower() == x.upper().lower(), to be True for > > all values of x over the set of valid unicode codepoints. Having >

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-03 Thread Dave Angel
On Tue, 3 Dec 2013 09:14:49 -0800 (PST), Piotr Dobrogost wrote: I find global getattr() function awkward when reading code. Me too. What is the reason there's no "natural" syntax allowing to access attributes with names not being valid Python identifiers in a similar way to other attributes

Re: The input and output is as wanted, but why error?

2013-12-03 Thread Dave Angel
On Tue, 3 Dec 2013 08:35:20 -0800 (PST), geezl...@gmail.com wrote: really, i dont know why.. :( How about because you do a system exit on the first line of their input? The one that's all digits. And even if you get past that, you only process one of their words. -- DaveA -- https://mail.p

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-04 Thread Dave Angel
On Wed, 4 Dec 2013 14:05:11 -0800 (PST), Piotr Dobrogost wrote: Object's attributes and dictionary's keys are quite different things. Right. So if you need arbitrary keys, use a dict. Attributes are keyed by identifiers, which are constrained. No problem. -- DaveA -- https://mail.python.or

Re: [newbie] struggling wth tkinter

2013-12-07 Thread Dave Angel
On Sat, 7 Dec 2013 08:52:08 -0800 (PST), Jean Dubois wrote: I'm trying to go through a tutorial on tkinter which has the code below as an example. The only thing I see when running it is a little popup with "Click mouse here to quit" which works as expected but always shows the following error

Re: [newbie] struggling wth tkinter

2013-12-08 Thread Dave Angel
On Sat, 7 Dec 2013 23:45:06 -0800 (PST), Jean Dubois wrote: This is what I get: Traceback (most recent call last): File "./feet2meters.py", line 2, in from tkinter import * File "/home/jean/tkinter.py", line 2, in import Tkinter as tk ImportError: No module named Tkinter Regardle

Re: Fwd: Eliminate "extra" variable

2013-12-08 Thread Dave Angel
On Sun, 8 Dec 2013 12:58:18 -0800, Igor Korot wrote: It's input is the query result, so there is no looping when the function is called. It is called only once. Then why save part of the result in an instance attribute? Just return all of the results as a tuple. -- DaveA -- https://mail.py

Re: squeeze out some performance

2013-12-09 Thread Dave Angel
On Mon, 09 Dec 2013 15:54:36 +, Robin Becker wrote: On 06/12/2013 22:07, Joel Goldstick wrote: > end, start = start, end a similar behaviour for simple assignments for less than 4 variables the tuple method is faster. What does speed have to do with it? When you want to swap tw

Re: grab dict keys/values without iterating ?!

2013-12-10 Thread Dave Angel
On Wed, 11 Dec 2013 02:02:20 +0200, Tamer Higazi wrote: Is there a way to get dict by search terms without iterating the entire dictionary ?! I want to grab the dict's key and values started with 'Ar'... Your wording is so ambiguous that each respondent has guessed differently. I'm gue

Re: load_module for import entire package

2013-12-11 Thread Dave Angel
On Tue, 10 Dec 2013 23:28:31 -0800 (PST), Sergey wrote: def get_obj(): pkg = load_package_strict("tmp", basedir) from tmp import main return main.TTT() It is working, but if package code changes on disc at runtime and I call get_obj again, it returns instance of class, loaded for the

Re: Movie (MPAA) ratings and Python?

2013-12-12 Thread Dave Angel
On Wed, 11 Dec 2013 23:22:14 -0700, Michael Torrie wrote: From what I can see gmail is producing a multipart message that has a plaint text part and an html part. This is what gmail normally does and as far as I know it's RFC-compliant and that's what gmail always does. "Always does" does

Re: [newbie] trying socket as a replacement for nc

2013-12-12 Thread Dave Angel
On Thu, 12 Dec 2013 13:27:16 -0800, Dan Stromberg wrote: On Thu, Dec 12, 2013 at 6:16 AM, Grant Edwards wrote: I haven't done a lot of UDP, but are you pretty sure UDP can't at least fragment large packets? What's a router or switch to do if the Path MTU isn't large enough for an original

Re: Eliminate "extra" variable

2013-12-15 Thread Dave Angel
On Sun, 15 Dec 2013 18:43:53 -0800, Igor Korot wrote: On Sun, Dec 15, 2013 at 4:58 PM, MRAB wrote: > When writing paths on Windows, it's a good idea to use raw string > literals or slashes instead of backslashes: > > conn = sqlite3.connect(r'c:\Documents and > Settings\Igor.FORDANWORK

Re: Wrapping around a list in Python.

2013-12-16 Thread Dave Angel
On Sun, 15 Dec 2013 21:26:49 -0800 (PST), shengjie.sheng...@live.com wrote: The idea is to grab the last 4 elements of the array. However i have an array that contains a few hundred elements in it. And the values continues to .append over time. How would i be able to display the last 4 elements

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Dave Angel
On Mon, 16 Dec 2013 10:26:14 -0800 (PST), Jean Dubois wrote: File "./test.py", line 7 def flush() ^ SyntaxError: invalid syntax A definition line needs to end with a colon (fix the other as well) -- DaveA -- https://mail.python.org/mailman/listinfo/python-list

Re: Python and MIDI

2013-12-17 Thread Dave Angel
On Tue, 17 Dec 2013 08:45:28 -0800, Tobiah wrote: Is there a module out there that would let me send a predetermined list of midi messages to a MIDI device in such a way that the timing would be precise enough for music? Probably. I haven't tried it but I'd look first at pygame. Maybe first

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Dave Angel
On 18 Dec 2013 08:22:58 GMT, Steven D'Aprano wrote: On Wed, 18 Dec 2013 13:11:58 +1100, Chris Angelico wrote: > The one differentiation that I don't like is between the . and -> > operators. The distinction feels like syntactic salt. There's no context > when both are valid, save in C++ where

Re: Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Dave Angel
On Thu, 19 Dec 2013 01:55:10 +1100, Chris Angelico wrote: Sure, but you can figure out whether p is a local struct or a local pointer to some other struct by looking at its declaration. Do you also need to look at every usage of it? C is a glorified macro assembler. So the -> operator is not

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Dave Angel
On Thu, 19 Dec 2013 19:41:00 +1300, Gregory Ewing wrote: But it's not above inferring a dereferencing operation when you call a function via a pointer. If f is a pointer to a function, then f(a) is equivalent to (*f)(a) If the compiler can do that for function calls, ther

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread Dave Angel
On Thu, 19 Dec 2013 16:32:37 +0100, Wolfgang Keller wrote: With Windows it *is* "normal". An experienced software developer once even explained the reason to me. When a single process on Windows does I/O, then the system essentially falls back to "single tasking". Or (non-)"cooperative mult

Re: How can i return more than one value from a function to more than one variable

2013-12-22 Thread Dave Angel
On Sun, 22 Dec 2013 15:41:06 -0800 (PST), Bob Rashkin wrote: On Sunday, December 22, 2013 4:54:46 PM UTC-6, dec...@msn.com wrote: > How am I supposed to do so I can return also a value to the variable y WITHOUT printing 'Now x =', w, 'and y = ' , z a second time ? You are apparently aski

Re: Variables in a loop, Newby question

2013-12-24 Thread Dave Angel
On Tue, 24 Dec 2013 09:54:48 -0800 (PST), vanommen.rob...@gmail.com wrote: You should always start by mentioning python version and o.s. import time global Sens_Raw1, Sens_Raw2, Sens_Raw3, Sens_Raw4, Sens_Raw5, Sens_Raw6, Sens_Raw7, Sens_Raw8, Sens_Raw9, Sens_Raw10 The global statement make

Re: Variables in a loop, Newby question

2013-12-26 Thread Dave Angel
On Thu, 26 Dec 2013 16:41:57 +1100, Steven D'Aprano wrote: Chris Angelico wrote: > Does anyone else have the vague feeling that the OP's problem might be > better served by simply importing the script (thus making those values > available to another Python script) than by any of these rat

Re: need to print seconds from the epoch including the millisecond

2013-12-26 Thread Dave Angel
On Thu, 26 Dec 2013 14:06:17 -0800 (PST), matt.doolittl...@gmail.com wrote: On Thursday, December 26, 2013 2:22:10 PM UTC-5, Dan Stromberg wrote: > In [1]: import time > In [2]: time.time() > Out[2]: 1388085670.1567955 OK i did what you said but I am only getting 2 decimal places. You're

Re: need to print seconds from the epoch including the millisecond

2013-12-26 Thread Dave Angel
On Thu, 26 Dec 2013 20:03:34 -0500, Terry Reedy wrote: On 12/26/2013 5:48 PM, Dave Angel wrote: > You're probably on Windows, which does time differently. With 3.3 and 3.4 on Windows 7, time.time() gives 6 fractional digits. >>> import time; time.time() 1388105935.9

Re: unicode to human readable format

2013-12-27 Thread Dave Angel
On Fri, 27 Dec 2013 02:43:58 -0800 (PST), tomasz.kaczo...@gmail.com wrote: can I ask you for help? when I try to print s[0] i vane the message: UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128). how to solve my problem, please? First, what v

<    7   8   9   10   11   12   13   14   15   16   >