Re: PyGame migrating to JavaScript

2010-04-02 Thread Gary Herron
? Cheers, -Xav It's a joke -- see http://en.wikipedia.org/wiki/April_Fools%27_Day -- Gary Herron, PhD. Department of Computer Science DigiPen Institute of Technology (425) 895-4418 -- http://mail.python.org/mailman/listinfo/python-list

Re: pythonrag

2010-04-05 Thread Gary Herron
will be used. Python, the C implementation, does both, choosing the second option for small integers (those less 100 last time I checked). Gary Herron -- Gary Herron, PhD. Department of Computer Science DigiPen Institute of Technology (425) 895-4418 -- http://mail.python.org/mailman/listinfo/python

Re: Generating a rainbow?

2010-04-08 Thread Gary Herron
hsv_to_rgb from the standard Python library to convert to RGB. Enjoy! Gary Herron from colorsys import hsv_to_rgb for hue : rgb = hsv_to_rgb(hue, saturation, value) Let 'hue' run from 0 (red) through 2/3 (blue) Hues from 2/3 to 1 get into purples and magentas, which are not spectral (i.e

Re: Pythonic list reordering

2010-04-08 Thread Gary Herron
: int(s.split('_')[1])) (Which is not necessarily elegant, but it is short.) Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Line Intersection

2010-04-09 Thread Gary Herron
*d) If the denominator is zero then the lines are parallel, and there is no (unique) solution. (There are other was of solving the system, but they will all amount to the same arithmetic, and will, of course, produce the same result.) Gary Herron

Re: Deleting more than one element from a list

2010-04-21 Thread Gary Herron
are equivalent. The reason it fails is that, by the time it gets around to the third delete, there is no longer in index [6] in the list. The element you were thinking of is now at index [4]. This, however, will work as you expected: del z[6], z[3],z[2] -- Gary Herron, PhD. Department

Re: NameError: how to get the name?

2010-04-24 Thread Gary Herron
, but not in class blocks. Note: The contents of this dictionary should not be modified; changes may not affect the values of local and free variables used by the interpreter. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: how to select column

2010-04-26 Thread Gary Herron
to do Thanks Do you know how to open a file, and how to read individual lines from it? If so, then you can split a line at the spaces into a list by using fields = line.split() Then print fields[0], fields[3] would do what you ask. Gary Herron -- http://mail.python.org/mailman

Re: CGI python 3 write RAW BINARY

2010-04-28 Thread Gary Herron
Dodo wrote: Help! this is driving me crazy lol I want to print raw binary data to display an image file BUT python3 outputs b'binary data' instead of binary data so the browser can't read the image!! f = open(/some/path/%s % x, 'rb') print(f.read()) any idea? Dorian Huh??? In

Re: Teaching Programming

2010-05-04 Thread Gary Herron
a decade or so before discovering Python in the mid 90's, but I never forgot that paper nor lost my eager anticipation waiting for language design to catch up with that idea. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: struct

2010-05-19 Thread Gary Herron
On 05/19/2010 02:53 PM, Back9 wrote: Can anyone explain the difference between f and d in struct unpack? When using them, some data work in either one not both. To me it seems to be same, TIA 'f' is single precision float (32 bits), and 'd' is a double precision float (64 bits) Gary

Re: How to unescape a raw string?

2010-05-20 Thread Gary Herron
on.Various methods of output may or may not convert those characters back into \n and \t and so on. But that's a matter of output not internal storage. So tell us what you're trying to accomplish -- and better also tell us Python2 or Python3? Gary Herron -- http://mail.python.org

Re: Import Module

2010-05-20 Thread Gary Herron
] Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: |help| python 3.12

2010-05-23 Thread Gary Herron
to look. Show us how you created that file. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Error

2010-05-26 Thread Gary Herron
... ... mpmath.whatever ... Gary Herron Trash the search function fro the regular expression module? I'm running Python 2.6.2 on Mac running OS 10.6.3. Thanks! Buff Miner -- Enig Associates, Inc. Suite 500, Bethesda Crescent Bldg. 4600 East West Hwy Bethesda, Maryland 20814 Tel:(301)680

Re: Qt with PyDev

2011-01-04 Thread Gary Herron
-webkit-box-shadow border-radius Other overflow cursor visibility ... Rohit See either of these packages: PyQt: http://qt.nokia.com/products/ PySide: http://www.pyside.org/ Either one should work with PyDev. Gary Herron -- http://mail.python.org/mailman

Re: compute the double square...... :(

2011-01-08 Thread Gary Herron
be written as the sum of two squares. For example, 10 can only be written as 32 + 12 (we don't count 12 + 32 as being different). On the other hand, 25 can be written as 52 + 02 or as 42 + 32. Huh? In what number system does 10 = 32 + 12? And how do either 32 or 12 qualify as perfect squares? Gary

Re: Errors while using strip and remove on a variable.

2011-02-03 Thread Gary Herron
in place.In your code, you print a and print c, but you should have done print b, where you will find the result you expect. Gary Herron == Anand Jeyahar http://sites.google.com/a/cbcs.ac.in/students/anand

Re: Why can function definitions only use identifiers, and not attribute references or any other primaries?

2009-04-23 Thread Gary Herron
Jeremy Banks wrote: Hi. I'm sure there've been debates about this before, but I can't seem to figure out what to search for to pull them up, so I'm asking here. It seems to me that a lot of things could be made much easier if you could use primaries other than basic identifiers for the target

Re: Why can function definitions only use identifiers, and not attribute references or any other primaries?

2009-04-23 Thread Gary Herron
Jeremy Banks wrote: Thanks for your comments. On Thu, Apr 23, 2009 at 11:52, Gary Herron gher...@islandtraining.com wrote: [...] There's no need for a specific addition to the syntax to do this. Try this: def foo_bar(): return(...) foo.bar = foo_bar

Re: Python 2.6 worth the hassle?

2009-05-06 Thread Gary Herron
the differences -- they are minor and evolutionary not revolutionary.) Gary Herron My essential question is Is Python 2.6 similar enough to Python 3.0 to justify its complexity of installation? Upgrading to Jaunty is NOT an option (http://welcome2obscurity.blogspot.com/2009/05/jaunty-jackalope

Re: Best practice for operations on streams of text

2009-05-07 Thread Gary Herron
on using generators for building and linking together individual stream filters. Its very cool and surprisingly eye-opening. See Generator Tricks for Systems Programmers at http://www.dabeaz.com/generators/ Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Assigning a list to a key of a dict

2009-05-14 Thread Gary Herron
Wells wrote: Why can't I do this? teams = { SEA: Seattle Mariners } for team, name in teams.items(): teams[team][roster] = [player1, player2] Because, team will be SEA, so teams[team] will be Seattle Mariners and Seattle Mariners[roster] makes no sense. Gary Herron I

Re: tarfile doesn't work with tgz files?

2009-05-16 Thread Gary Herron
contents. Now, what is it you were trying to do? Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding a Par construct to Python?

2009-05-17 Thread Gary Herron
. For instance A+B+C+D could be calculated sequentially as implied by ((A+B)+C)+D or with some parallelism as implied by (A+B)+(C+D) That's an application of the associativity of addition. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: 4 hundred quadrillonth?

2009-05-21 Thread Gary Herron
with the OP's division of 4 by 5.0, but rather that the value of 0.8 itself cannot be represented exactly in IEEE 754. Just try print repr(0.8) # No division needed '0.80004' Gary Herron I have the same feeling towards databases. -- http://mail.python.org/mailman/listinfo/python

Re: 4 hundred quadrillonth?

2009-05-21 Thread Gary Herron
R. David Murray wrote: Gary Herron gher...@islandtraining.com wrote: MRAB wrote: Grant Edwards wrote: On 2009-05-21, Christian Heimes li...@cheimes.de wrote: seanm...@gmail.com schrieb: The explaination in my introductory Python book is not very satisfying

Re: What is the difference between init and enter?

2009-05-26 Thread Gary Herron
guesswork. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: extract to dictionaries

2009-05-28 Thread Gary Herron
, and see if someone is willing to make suggestions or answer specific question about your attempt at a solution? Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: extract to dictionaries

2009-05-29 Thread Gary Herron
Marius Retegan wrote: Hi, On Fri, May 29, 2009 at 2:09 AM, Gary Herron gher...@islandtraining.com mailto:gher...@islandtraining.com wrote: Marius Retegan wrote: Hello I have simple text file that I have to parse. It looks something like

Re: Have a variable column length in printf

2009-05-31 Thread Gary Herron
width, and then supply the actual width as a separate parameter: print '%*d' % (5,123) 123 Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Get the class name

2009-06-08 Thread Gary Herron
so, perhaps this will answer your question class Foo: ... pass ... print Foo.__name__ Foo c = Foo print c.__name__ Foo ob = Foo() print ob.__class__.__name__ Foo Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: how to import a name from a module-path?

2009-06-16 Thread Gary Herron
Gary Herron -- bjorn -- http://mail.python.org/mailman/listinfo/python-list

Re: Executing a python script while it is running

2009-06-16 Thread Gary Herron
Zach Hobesh wrote: Hi everybody, Here's my situation: I have a batch file that calls a python script. This batch file is triggered by an outside application when the application completes a task. The problem is that while the batch file (and pythons script) is running, the application will

Re: Has anyone gotten Pyglet to work

2013-07-29 Thread Gary Herron
On 07/29/2013 01:56 PM, Devyn Collier Johnson wrote: I tried Pyglet in a Python3 and a Python2 script, but both fail. The error code is below and the script is attached. The 'boot.ogg' file is Ubuntu's default bootup sound. I got my code from this link

Re: binary key in dictionary

2013-07-30 Thread Gary Herron
you set it: d[2] = 0 # for instance You may want to look at defaultdict from the collections module. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: static typing?

2013-08-05 Thread Gary Herron
%20also%20a%20strongly%20typed%20language Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: How Do I get my Python script to attach multiple files and send as a single email

2013-08-08 Thread Gary Herron
). It's far, FAR, easier than rolling your message, especially when attachments are needed. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Basic Doubt

2013-08-10 Thread Gary Herron
use is until you understand this: q:~ python3 Python 3.3.1 (default, Apr 17 2013, 22:32:14) [GCC 4.7.3] on linux Type help, copyright, credits or license for more information. 101 is 1+100 True 1001 is 1+1000 False Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Basic Doubt

2013-08-10 Thread Gary Herron
On 08/10/2013 03:09 PM, Chris Angelico wrote: On Sat, Aug 10, 2013 at 10:48 PM, Gary Herron gary.her...@islandtraining.com wrote: This is an oversimplification, but generally useful for all beginner (and most advanced) programmers: Don't use is for comparisons. Use ==. It 20 years

Re: Python Basic Doubt

2013-08-10 Thread Gary Herron
On 08/10/2013 08:09 PM, Krishnan Shankar wrote: Thanks Tim, This takes me to one more question. 'is' operator is used to compare objects and it should not be used to compare data. So can it be compared with 'False'. i.e. Is this code possible if a is False: print 'Yes' if b is False:

Re: Python Basic Doubt

2013-08-10 Thread Gary Herron
On 08/10/2013 06:00 PM, Chris Angelico wrote: On Sun, Aug 11, 2013 at 1:42 AM, Gary Herron gary.her...@islandtraining.com wrote: On 08/10/2013 03:09 PM, Chris Angelico wrote: _notpassed = object() def frob(appendage, device=_notpassed): Use some appendage to frob some device, or None

Re: Python Basic Doubt

2013-08-10 Thread Gary Herron
On 08/10/2013 08:43 PM, Chris Angelico wrote: On Sun, Aug 11, 2013 at 4:21 AM, Gary Herron gary.her...@islandtraining.com wrote: On 08/10/2013 06:00 PM, Chris Angelico wrote: Wrong. If you do equality comparisons, it's entirely possible for something to be passed in that compares equal

Re: .split() Qeustion

2013-08-13 Thread Gary Herron
to a reader of your program. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Encapsulation unpythonic?

2013-08-17 Thread Gary Herron
of behavior. However, *hiding* the members of a class is not considered Pythonic. There is no private/public as in C++, however, there are way to achieve that effect. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Setting the value of True

2013-08-23 Thread Gary Herron
On 08/23/2013 04:38 PM, jeangaw...@gmail.com wrote: Python allows you set the value of True True = 1.3 Now this is consistent with the decision to let you set the value of various builtin names. But why is this case different: None = 1.3 File stdin, line 1 SyntaxError: cannot assign to

Re: semicolon at end of python's statements

2013-08-29 Thread Gary Herron
come to like Python's indentation eventually. Many (most?) of the rest of here have. Gary Herron -- Dr. Gary Herron Department of Computer Science DigiPen Institute of Technology (425) 895-4418 -- http://mail.python.org/mailman/listinfo/python-list

Re: Encapsulation unpythonic?

2013-08-31 Thread Gary Herron
* at all to do with objects and encapsulation. Please don't confuse: the binding of names to objects and the existence of objects and their encapsulated behavior They are very different things. -- Dr. Gary Herron Department of Computer Science DigiPen Institute of Technology (425) 895-4418

Re: Send alt key to subprocess.PIPE stdin

2013-09-11 Thread Gary Herron
in response. By calling it a _command_, you seem to expect some particular behavior out of the receiving process. Please tell us *what* that might be, and we'll see what we can do to help out. Gary Herron -- Dr. Gary Herron Department of Computer Science DigiPen Institute of Technology (425

Re: Help me with Python please (picture)

2013-09-27 Thread Gary Herron
were you trying to achieve? Since you are asking volunteers to help, it would be polite to take the time to explain things carefully. Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: Barcode printing

2013-09-29 Thread Gary Herron
package might offer the remaining functionality easily. Thanks for any pointers! jlc For creating PDFs from Python, consider: ReportLab: Open Source Python Libraries for PDF creation at http://www.reportlab.com/software/opensource/ I've used it successfully. Gary Herron -- https

Re: Image manipulation

2013-10-04 Thread Gary Herron
. Try again with a full description of what you want, and we'll try to provide a useful answer. Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: basic maze problem with turtle

2013-10-13 Thread Gary Herron
aesthetically pure, and hence far superior to any solution more mundane coders might produce. That was uncalled for. There is already too much Nikos-bashing and Nikos-basher-bashing (and so on) in this newsgroup without dredging up even more in this completely unrelated request. Gary Herron

Re: Testing BlockHosts

2013-10-17 Thread Gary Herron
. The OP had best ask the authors of the application about using the application. Actual Python questions are welcome here and will probably generate answers. Gary Herron -- Dr. Gary Herron Department of Computer Science DigiPen Institute of Technology (425) 895-4418 -- https

Re: Function for the path of the script?

2013-10-26 Thread Gary Herron
got os.path.dirname aliased to dn, so its dn(_code_file()) that I find myself reaching for fairly often... Huh? In what kind of a workflow are you running a python file without knowing *what* file you are runnung? Or am I just misinterpreting what this code does? Confused but curious, Gary

Re: Help - Exercise Decision

2013-11-10 Thread Gary Herron
. Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: Help - Exercise Decision

2013-11-10 Thread Gary Herron
On 11/10/2013 04:48 PM, Kennedy Salvino wrote: Em domingo, 10 de novembro de 2013 21h34min39s UTC-3, Gary Herron escreveu: On 11/10/2013 02:56 PM, kennedysalvino...@gmail.com wrote: I'm trying to make a ranking of 3 numbers and say which the greatest and consider whether there is a tie

Re: Please help with this

2013-11-12 Thread Gary Herron
volunteer help from this group, but the question, as you've asked it, is a misuse (or even an *abuse*) of this group. Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: python CAD libraries?

2012-09-10 Thread Gary Herron
recommend some good ones for me? Thanks a lot!! Try PythonCAD: http://sourceforge.net/projects/pythoncad/ (Google would have been faster. :-) ) Gary Herron -- Dr. Gary Herron Department of Computer Science DigiPen Institute of Technology (425) 895-4418 -- http://mail.python.org/mailman/listinfo

Re: how to insert random error in a programming

2012-10-15 Thread Gary Herron
On 10/15/2012 06:55 AM, Debashish Saha wrote: how to insert random error in a programming? Drink several beers before you start programming. :-) -- Dr. Gary Herron Department of Computer Science DigiPen Institute of Technology (425) 895-4418 -- http://mail.python.org/mailman/listinfo

Re: date and time comparison how to

2012-10-29 Thread Gary Herron
= datetime.datetime.fromtimestamp(mtime) -- Dr. Gary Herron Department of Computer Science DigiPen Institute of Technology (425) 895-4418 -- http://mail.python.org/mailman/listinfo/python-list

Re: Conversion of List of Tuples

2012-12-04 Thread Gary Herron
On 12/03/2012 11:58 AM, subhabangal...@gmail.com wrote: [(1,2), (3,4)] L=[(1,2), (3,4)] [b for a in L for b in a] [1, 2, 3, 4] -- Dr. Gary Herron Department of Computer Science DigiPen Institute of Technology (425) 895-4418 -- http://mail.python.org/mailman/listinfo/python-list

Re: Python, email temperature

2012-12-22 Thread Gary Herron
spot you refer to it as cpu_temperature and in another as cputemp. If that's not it, you'd probably better show us your *real* code, otherwise we're just guessing. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

Re: Python, email temperature

2012-12-22 Thread Gary Herron
On 12/22/2012 12:54 PM, KarlE wrote: On Saturday, December 22, 2012 9:44:39 PM UTC+1, Joel Goldstick wrote: On Sat, Dec 22, 2012 at 3:36 PM, Alexander Ranstam ran...@gmail.com wrote: Hi! Im totally new to Python, and im using it on my Raspberry pi. I found a program that sends an email,

Re: Newbie - Trying to Help a Friend

2013-11-19 Thread Gary Herron
, these are extremely simple beginner problems, each requiring only a few lines of code. Any programming class that assigned these must have included some lectures on the basics of programming. That's where he should start. Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: Newbie - Trying to Help a Friend

2013-11-21 Thread Gary Herron
to start the sequence off with [n] rather than [] so as to match the suggested output. Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: Newbie - Trying to Help a Friend

2013-11-21 Thread Gary Herron
. Then perhaps we can get to the bottom of this. Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: Extending the 'function' built-in class

2013-12-01 Thread Gary Herron
are you trying to extend it? Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: Eliminate extra variable

2013-12-06 Thread Gary Herron
of time. In fact, with what you've shown us, you can eliminate the variable dateStrs, and both loops and be no worse off. Perhaps there is more to your code than you've shown to us ... Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: python programming help

2013-12-08 Thread Gary Herron
certainly need a loop (through the dictionary entries), an 'if' conditional to test for the age matching the given age, and a print, Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Script

2013-12-12 Thread Gary Herron
what that project is. In fact, I can't even figure out if your trouble is with the script, or with using the script in this unknown project. Also, if you repost, please include the script in the email, not as a pointer to somewhere else. Gary Herron -- https://mail.python.org/mailman/listinfo

Re: Knapsack Problem Without Value

2013-12-12 Thread Gary Herron
. Does your problem have anything to do with Python? * Is this a homework problem? We generally don't solve homework problems here (since you don't learn anything that way), but we are certainly happy to help you learn. Gary Herron -- Dr. Gary Herron Department of Computer Science DigiPen

Re: Wrapping around a list in Python.

2013-12-15 Thread Gary Herron
what you want, but you'll have to do a much better job telling is what you want. While you are at it, tell us what you've already done, and how it fails to do whatever it is you want. Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: Pygame vector handling?

2013-12-21 Thread Gary Herron
incorrect results? * I'm not likely to read your hundred+ lines of code trying to find a bug. Please reduce you question to one or several lines of code, what you expect them to do, and what they are doing that you consider incorrect. Gary Herron -- https://mail.python.org/mailman

Re: cascading python executions only if return code is 0

2013-12-22 Thread Gary Herron
On 12/22/2013 10:37 AM, Frank Cui wrote: hey guys, I have a requirement where I need to sequentially execute a bunch of executions, each execution has a return code. the followed executions should only be executed if the return code is 0. is there a cleaner or more pythonic way to do this

Re: 2nd Try: Trouble writing lines to file that include line feeds - Newbie

2013-12-23 Thread Gary Herron
/functions.html#open for a list of other modes available for the open call. Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

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

2013-12-23 Thread Gary Herron
to several variables, try: def fn(...): # calculate a and b return a,b p,q = fn(...) All these comma-separated sequences are tuples, often written with parentheses as (x,y)=(y,x) and (p,q)=fn(...), but as here, the parentheses are often not necessary. Gary Herron -- https

Re: Ifs and assignments

2014-01-02 Thread Gary Herron
Python is. Gary Herron handleMatch1(m) elif m = r2.search(w): handleMatch2(m) else: print(No match) If the regular expressions are complex, running them multiple times (once to test, another to capture groups) isn't ideal. On the other hand, at present, one has to either do: m

Re: Ifs and assignments

2014-01-02 Thread Gary Herron
the whole post. That's never a good idea. After reading to the end, I rather like your suggestion. It works well in your example, , nicely avoids the C/C++ trap, and has some consistency with other parts of Python. Gary Herron On 02/01/2014 19:27, Gary Herron wrote: On 01/02/2014 09:20 AM

Re: gotta love radio buttons

2014-01-05 Thread Gary Herron
by r -- expected to be an integer). Either of these remove the redundancy (but the first is more Pythonic) for r in var: helper = r.get() or for i in range(len(var)): helper = var[i].get() Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: gotta love radio buttons

2014-01-05 Thread Gary Herron
tracebacks are skills well worth trying to develop. Good luck. Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: converting a string to a function parameter

2014-01-05 Thread Gary Herron
names in two different namespaces. Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: buggy python interpretter or am I missing something here?

2014-01-26 Thread Gary Herron
.) Perhaps printing a traceback along with the exception would help. Add traceback.print_exc() Gary Herron

Re: buggy python interpretter or am I missing something here?

2014-01-26 Thread Gary Herron
On 01/26/2014 10:17 PM, me wrote: On Sun, 26 Jan 2014 21:04:57 -0800, Gary Herron wrote: Never *ever* have a bare except like that. If it gets invoked, you have no idea why. A simple typo like ixd instead of idx or a(idx) instead of a[idx] would raise an exception but give you no idea why

Re: buggy python interpretter or am I missing something here?

2014-01-26 Thread Gary Herron
have there, this jumping to (incorrect) conclusions so quickly. We'd like to get to the bottom of this. (And correct your mis-interpretations while we're at it :-)But we need to see your test *and* the results. Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: Calculator Problem

2014-02-02 Thread Gary Herron
clearly not what you intended. Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: [newbie] copying identical list for a function argument

2014-02-03 Thread Gary Herron
a sequence into individual parameters: fn(*(4*[[1,2,3]])) # note extra * preceding the arg willl be a valid call for def fn(a,b,c,d): ... I'm sure other interpretations of your question are possible. Gary Herron what is the prefered method to realize this in Python? any help would

Re: Calculator Problem

2014-02-03 Thread Gary Herron
On 02/03/2014 10:04 AM, Charlie Winn wrote: On Sunday, February 2, 2014 9:46:24 PM UTC, Gary Herron wrote: ... Sorry, but in fact you did *not* run this program as you claim. It's full of syntax errors. Any attempt to run it will display syntax errors immediately, and never actually run

Re: kivy

2014-02-04 Thread Gary Herron
an answer here, but I think you'd have much better luck if you found a kivy specific newsgroup. Good luck, Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: TypeError: 'list' object is not callable

2014-02-06 Thread Gary Herron
? That is: cut and paste the *full* traceback instead of hiding useful information when you are asking for help. Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: Dictionaries

2014-02-08 Thread Gary Herron
. If a and b had different keys, then you would get an error: a = {'a':1} b = {'b':2} for x in a: ... print x ... print a[x] ... print b[x] ... a 1 Traceback (most recent call last): File stdin, line 4, in module KeyError: 'a' Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: Flag control variable

2014-02-11 Thread Gary Herron
tell us, but that's where the trouble is. Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: Flag control variable

2014-02-11 Thread Gary Herron
in such a manner that sys.argv[3] has such an odd value. What does your command line look like? You didn't tell us, but that's where the trouble is. Gary Herron how do you meen what does your command line look like? When you run this python script, *how* do you do so? Perhaps you type

Re: Flag control variable

2014-02-11 Thread Gary Herron
to on this list. Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: Flag control variable

2014-02-11 Thread Gary Herron
and runs Python with the rest of the command line arguments is in control of this. If you can find a way to tell your shell to not expand '*' characters, or find a shell that does not do so, then yes, you can dispense with the back-slash. Gary Herron -- https://mail.python.org/mailman/listinfo

Re: Flag control variable

2014-02-11 Thread Gary Herron
is what you are doing. (And it just repeats the string a number of times -- not what you want.) Your code used to have int(...) to convert the string supplied by sys.argv into integers. What happened to them? Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: Flag control variable

2014-02-11 Thread Gary Herron
On 02/11/2014 01:18 PM, luke.gee...@gmail.com wrote: Would it be possible to make an int(sys.argv[1]) Not needed and set value 0 ( or in another script 1) For example a = int(sys.argv[1]) b = int(sys.argv[2]) c = int(sys.argv[3]) And I run Python ./script.py 2 3 It just set c automaticly to 0

Re: How does python know?

2014-02-12 Thread Gary Herron
. The process is called string interning. Google and wikipedia have lots to say about it. Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: Best practices to overcome python's dynamic data type nature

2014-02-14 Thread Gary Herron
strategy to find them is a good testing strategy. Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

Re: Quick Help

2014-02-15 Thread Gary Herron
. (But don't ask us to write the program for you.) Gary Herron -- https://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   >