Re: Fortran (Was: The does Python have variables? debate)

2014-05-11 Thread Dave Angel
On 05/11/2014 02:54 PM, Mark H Harris wrote: julia sin(BigFloat(π/4)) 7.0710678118654750275194295621751674626154323953749278952436611913748 20215180412e-01 with 256 bits of precision That answer doesn't seem to come anywhere near 256 bits of precision. Using Python 3.2,

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-10 Thread Dave Angel
On 05/10/2014 07:23 PM, Chris Angelico wrote: There is a broad convention that spaces in file names get protected with quotes, though (for instance, tab completion will put quotes around them), so it's not complete chaos. Complete chaos is a pretty good description, especially since MS

Re:Python Image Registration and Cropping?

2014-05-04 Thread Dave Angel
mikejohnrya...@gmail.com Wrote in message: Hello, Is there a Python tool or function that can register two images together (line them up visually), and then crop them to the common overlap area? I'm assuming this can probably be done with Python Imaging Library but I'm not very familiar

Re:Significant digits in a float?

2014-04-28 Thread Dave Angel
Roy Smith r...@panix.com Wrote in message: I'm using Python 2.7 I have a bunch of floating point values. For example, here's a few (printed as reprs): 38.0 41.2586 40.752801 49.25 33.7951994 36.8371996 34.1489 45.5 Fundamentally, these numbers have

Re:Convert numpy array to single number

2014-04-28 Thread Dave Angel
mboyd02...@gmail.com Wrote in message: I have a numpy array consisting of 1s and zeros for representing binary numbers: e.g. binary array([ 1., 0., 1., 0.]) I wish the array to be in the form 1010, so it can be manipulated. I do not want to use built in binary

Re:problem with regex

2014-04-28 Thread Dave Angel
dimm...@gmail.com Wrote in message: i want to find a specific urls from a txt file but i have some issus. First when i take just two lines from the file with copy paste and assign it to a variable like this and it works only with triple quotes

Re: how to write list in a file

2014-04-23 Thread Dave Angel
Terry Reedy tjre...@udel.edu Wrote in message: On 4/23/2014 3:53 AM, Dhananjay wrote: Hello everyone, I am trying hard to write a list to a file as follows: def average_ELECT(pwd): os.chdir(pwd) I would 'print pwd' to make sure where files are being opened. files =

Re:Moving to an OOP model from an classically imperitive one

2014-04-23 Thread Dave Angel
tim.thel...@gmail.com Wrote in message: I don't really understand your problem or your examples, but others apparently do. So I'll just make a few comments. There is one problem though. Currently, I have these functions logically organized into source files, each between 40 and 170

Re:TeX $\times$ symbol not working in matplotlib?

2014-04-18 Thread Dave Angel
gwhite gwh...@ti.com Wrote in message: Hi, I am trying to understand how to get the TeX \times symbol to work. It is in the title() string in the code I pasted in. The \circ symbol seems fine, by comparison. \times ends up as imes in the figure title. I am probably doing something

Re:module and namespace

2014-04-18 Thread Dave Angel
Egon Frerich e...@frerich.eu Wrote in message: I have a problem with a namespace. So you started 4 separate threads to complain about it? Keep any further remarks on the thread where you got a useful response. -- DaveA -- https://mail.python.org/mailman/listinfo/python-list

[issue21289] make.bat not building documentation

2014-04-18 Thread Dave Sawyer
Dave Sawyer added the comment: Thanks Zach, I'm used to Git and this was my first foray with Hg and trying to rebase (I knew I shoulda branched before starting on another patch). BTW, the devs at PyCon Montreal said Zach's a good guy. One of maybe 4 Windows devs. -Dave

[issue21289] make.bat not building documentation

2014-04-17 Thread Dave Sawyer
New submission from Dave Sawyer: With Python 3.5, some refactoring of the documentation structure has been done. Building the documentation targets directly works, but using the supplied make.bat fails, not finding the sphinx python file. -- assignee: docs@python components

[issue21289] make.bat not building documentation

2014-04-17 Thread Dave Sawyer
Changes by Dave Sawyer dsaw...@box.com: -- type: compile error - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21289 ___ ___ Python-bugs

[issue21289] make.bat not building documentation

2014-04-17 Thread Dave Sawyer
Changes by Dave Sawyer dsaw...@box.com: -- keywords: +patch Added file: http://bugs.python.org/file34954/mywork.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21289

[issue21289] make.bat not building documentation

2014-04-17 Thread Dave Sawyer
Dave Sawyer added the comment: Removed the use of python in the make, calling the sphinx-build executable. Also the Doc directory was called Docs in the readme.txt -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21289

[issue15414] os.path.join behavior on Windows (ntpath.join) is unexpected and not well documented

2014-04-17 Thread Dave Sawyer
Dave Sawyer added the comment: http://bugs.python.org/issue1669539 has been partially fixed. On Windows os.path.join('foo', 'a:bar') gives 'a:bar' not 'foo\\a:bar'. However os.path.isabs('a:bar') returns False yet it causes a reset in the join like an absolute path. '\foo' is considered

[issue15414] os.path.join behavior on Windows (ntpath.join) is unexpected and not well documented

2014-04-17 Thread Dave Sawyer
Changes by Dave Sawyer dsaw...@box.com: -- keywords: +patch Added file: http://bugs.python.org/file34956/joindoc.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15414

[issue15414] os.path.join behavior on Windows (ntpath.join) is unexpected and not well documented

2014-04-17 Thread Dave Sawyer
Changes by Dave Sawyer dsaw...@box.com: -- versions: +Python 3.4, Python 3.5 -Python 2.7, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15414

[issue21289] make.bat not building documentation

2014-04-17 Thread Dave Sawyer
Changes by Dave Sawyer dsaw...@box.com: Added file: http://bugs.python.org/file34957/mywork.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21289

[issue21289] make.bat not building documentation

2014-04-17 Thread Dave Sawyer
Dave Sawyer added the comment: Thanks Zach! The bug tracker was nice enough to prompt me to go look in my email for the agreement too. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21289

[issue21151] winreg.SetValueEx causes crash if value = None

2014-04-16 Thread Dave Odell
Dave Odell added the comment: Patch works on my end. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21151 ___ ___ Python-bugs-list mailing list

Re:Learner looking for assistance

2014-04-14 Thread Dave Angel
Anthony Smith jackie.walkab...@gmail.com Wrote in message: Hi All I am probably doing something wrong but don't know what Any help would great As Ben pointed out, you should be more careful with your copy/paste, and especially with your indentation. I'll assume these are all methods

Re:MemoryError in data conversion

2014-04-14 Thread Dave Angel
Mok-Kong Shen mok-kong.s...@t-online.de Wrote in message: The code attached below produces in one of the two IMHO similar cases (excepting the sizes of the lists involved) MemoryError. Could experts kindly tell why that's so and whether there is any work-around feasible. Where's your stack

Re:Python, Linux, and the setuid bit

2014-04-14 Thread Dave Angel
Ethan Furman et...@stoneleaf.us Wrote in message: For anyone in the unenviable position of needing [1] to run Python scripts with the setuid bit on, there is an suid-python wrapper [2] that makes this possible. When I compiled it I was given a couple warnings. Can any one shed light on

Re:Unpacking U-Boot image file

2014-04-09 Thread Dave Angel
trewio laguna...@mail.com Wrote in message: How to extract files from U-Boot image file, LZMA-compressed? Is there a Python script that can do this properly? Use the lzma module in Python 3.3 for starters -- DaveA -- https://mail.python.org/mailman/listinfo/python-list

Re: Unpacking U-Boot image file

2014-04-09 Thread Dave Angel
trewio laguna...@mail.com Wrote in message: U-Boot format: hmm, I'm not sure, can someone specify Python script that will help me deterermine U-boot format used? [for Python for Windows OS] Note: I need Python script for Python under Windows OS. - Original Message - From:

Re:If statement issue driving me nuts

2014-04-06 Thread Dave Angel
Anthony Smith jackie.walkab...@gmail.com Wrote in message: Hi I have a small project and I have been unable to get the following statement to work. Any help would great. User inputs can either self_sale_head which is a $ value,if a $ value is not add a self.estimated_weight_hd is used to

Re: Default mutable parameters in functions

2014-04-04 Thread Dave Angel
Dennis Lee Bieber wlfr...@ix.netcom.com Wrote in message: On Fri, 04 Apr 2014 10:00:25 -0400, random...@fastmail.us declaimed the following: I can't imagine a language that would work that way. For one, it would also imply that passing a value would change the default for future calls even

Re: Test post via gmane.

2014-04-03 Thread Dave Angel
Terry Reedy tjre...@udel.edu Wrote in message: On 4/3/2014 9:48 AM, Chris Angelico wrote: On Thu, Apr 3, 2014 at 10:39 AM, Terry Reedy tjre...@udel.edu wrote: Gmane has stopped receiving mail from the lists it mirrors at about 0:30 apr 2 (utc, I presume). I want to see what happens if I send

converting strings to hex

2014-04-03 Thread dave em
k=m1^c1 TypeError: unsupported operand type(s) for ^: 'str' and 'long' Any help is most appreciated. Dave -- https://mail.python.org/mailman/listinfo/python-list

Re: converting strings to hex

2014-04-03 Thread dave em
On Thursday, April 3, 2014 8:31:42 PM UTC-6, Tim Chase wrote: On 2014-04-03 19:10, dave em wrote: So my first step is to compute the key. I suspect my error below is because c1 is a float and m1 is a string but I don't know how to turn the string into a float. For the record

Re: converting strings to hex

2014-04-03 Thread dave em
You haven't seen nothing yet, wait till M.L. catches you on the flip side for using gg. {running for cover} Who is ML? -- https://mail.python.org/mailman/listinfo/python-list

[issue21151] winreg.SetValueEx causes crash if value = None

2014-04-03 Thread Dave Odell
New submission from Dave Odell: Here's a small program that crashes Python 3. import winreg winreg.SetValueEx(winreg.HKEY_CURRENT_USER, 'Value', 0, 3, None) I get a 0xC374 exception (STATUS_HEAP_CORRUPTION) when trying to run this. Here's a stack dump: (snip) ntdll.dll!RtlpLogHeapFailure

Re: Keyboard standards

2014-03-29 Thread Dave Angel
Larry Hudson org...@yahoo.com Wrote in message: On 03/28/2014 09:26 PM, Mark H Harris wrote: PS Thunderbird puts *both* the list and the news group addys in the to: header field on reply-to-list. ~nice, huh. Must be the way YOU set it up. MY Thunderbird (currently version 24.4.0 on

Re: checking if two things do not equal None

2014-03-29 Thread Dave Angel
Roy Smith r...@panix.com Wrote in message: In article lh7cb4$ntu$2...@news.albasani.net, Johannes Bauer dfnsonfsdu...@gmx.de wrote: On 29.03.2014 20:05, Steven D'Aprano wrote: On Sat, 29 Mar 2014 11:56:50 -0700, contact.trigon wrote: if (a, b) != (None, None): or if a != None !=

Re: Python language hack for C-style programmers [DO NOT USE!] :-)

2014-03-27 Thread Dave Angel
Chris Angelico ros...@gmail.com Wrote in message: On Fri, Mar 28, 2014 at 3:08 AM, Tim Chase python.l...@tim.thechases.com wrote: Multiple times, I've seen someone want something like what C-style languages offer where assignment is done in a test, something like if (m =

Re:SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC

2014-03-27 Thread Dave Angel
tade.an...@gmail.com Wrote in message: hei , I am a newcome to Python. I am trying to create a python script which will connect to an SSL URL and using the HEAD request will get the status of URL. For one the link I am getting following error [SSL:

Re: [newbie] confusion concerning fetching an element in a 2d-array

2014-03-25 Thread Dave Angel
Jean Dubois jeandubois...@gmail.com Wrote in message: Op dinsdag 25 maart 2014 12:01:37 UTC+1 schreef Steven D'Aprano: py values = [float(s) for s in data.split()] py print values [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0] py array_lines = np.array(values) py array_lines =

Re:unicode as valid naming symbols

2014-03-25 Thread Dave Angel
Mark H Harris harrismh...@gmail.com Wrote in message: greetings, I would like to create a lamda as follows: √ = lambda n: sqrt(n) On my keyboard mapping the problem character is alt-v which produces the radical symbol. When trying to set the symbol as a name within the name-space

Re: [newbie] confusion concerning fetching an element in a 2d-array

2014-03-25 Thread Dave Angel
Jean Dubois jeandubois...@gmail.com Wrote in message: Op dinsdag 25 maart 2014 15:42:13 UTC+1 schreef Dave Angel: If your instructor wanted you to copy examples, he would have given you one. please Dave leave that belittling tone behind, there's no instructor whatsoever involved here

Re:gdb python how to output integer for examine memory

2014-03-24 Thread Dave Angel
Wesley nisp...@gmail.com Wrote in message: Hi all, I am trying to use gdb debug python script. I am using gdb7.7 and python2.7.6, here is my simple test script: import time def next(i): time.sleep(10) i = 1 - i i = 1 while True: next(i) When this script running, gdb

Re:terminate a program gracefully from a thread

2014-03-22 Thread Dave Angel
Jabba Laci jabba.l...@gmail.com Wrote in message: Hi, I have a script (see below) that I want to terminate after X seconds. The main loop of the program is waiting for user input. The program enters the main loop and I try to shut down the program after X seconds from a thread but I can't

Re:User prompt as file to read

2014-03-22 Thread Dave Angel
kjaku...@gmail.com Wrote in message: I'm trying to create a program that will prompt the user for a list of text files to read from, then read those text files and build a dictionary of all the unique words found. Then finally put those unique words into another file and make it

Re: Question about Source Control

2014-03-22 Thread Dave Angel
Albert-Jan Roskam fo...@yahoo.com Wrote in message: In addition to posting in html format, you have also set the font size too small for me to easily read. Reason number 12 for posting in text mode in a text newsgroup. -- DaveA -- https://mail.python.org/mailman/listinfo/python-list

Re: Decorator

2014-03-20 Thread Dave Angel
Peter Otten __pete...@web.de Wrote in message: In your code change fib1 = isOddMy(fib) to fib = isOddMy(fib) and the without@ version will produce the same output as the with@ version. I expect that one more thing is needed, since the above is inside a function:

Re:Dictionaries

2014-03-20 Thread Dave Angel
Please don't leave new questions in an existing thread, and especially without changing subject line. Compose a new message with meaningful subject line. ishish ish...@domhain.de Wrote in message: Hi, This might sound weird, but is there a limit how many dictionaries a can create/use

Re:Python - Caeser Cipher Not Giving Right Output

2014-03-20 Thread Dave Angel
dtran...@gmail.com Wrote in message: Hello good people I am working on a caeser cipher program for class. However, I ran into a problem with my outputs. Up to a certain point for example: 1. two('y', 'z') Would give a '\x92' output instead of a 'x' output. Currently this is my code so

Re: Python - Caeser Cipher Not Giving Right Output

2014-03-20 Thread Dave Angel
dtran...@gmail.com Wrote in message: On Thursday, March 20, 2014 11:16:50 PM UTC-4, Dave Angel wrote: dtran...@gmail.com Wrote in message: def two(c1 , c2): c1 = chartonum(c1) c2 = chartonum(c2) return numtochar(c1 + c2 %26) You're missing some parentheses

Re: Question about Source Control

2014-03-18 Thread Dave Angel
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info Wrote in message: On Tue, 18 Mar 2014 19:08:17 +1100, Chris Angelico wrote: On Tue, Mar 18, 2014 at 6:55 PM, Steven D'Aprano st...@pearwood.info wrote: I don't think that *version* control is the right model to describe what hg and git

Re:Save to a file, but avoid overwriting an existing file

2014-03-12 Thread Dave Angel
zoom z...@yahoo.com Wrote in message: Hi! I would like to assure that when writing to a file I do not overwrite an existing file, but I'm unsure which is the best way to approach to this problem. As I can see, there are at least two possibilities: 1. I could use fd = os.open(x,

Re:Testing interactive code using raw_input

2014-03-10 Thread Dave Angel
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info Wrote in message: Does anyone have any good hints for testing interactive code that uses raw_input, or input in Python 3? A simple technique would be to factor out the interactive part, e.g. like this: # Before def spam():

Re:find and replace string in binary file

2014-03-05 Thread Dave Angel
loial jldunn2...@gmail.com Wrote in message: How do I read a binary file, find/identify a character string and replace it with another character string and write out to another file? Its the finding of the string in a binary file that I am not clear on. Any help appreciated I see from

Re: Working with the set of real numbers

2014-03-05 Thread Dave Angel
Oscar Benjamin oscar.j.benja...@gmail.com Wrote in message: On 4 March 2014 23:20, Dave Angel da...@davea.name wrote: One problem with complexity claims is that it's easy to miss some contributing time eaters. I haven't done any measuring on modern machines nor in python, but I'd assume

Re: Working with the set of real numbers

2014-03-05 Thread Dave Angel
Dave Angel da...@davea.name Wrote in message: Oscar Benjamin oscar.j.benja...@gmail.com Wrote in message: On 4 March 2014 23:20, Dave Angel da...@davea.name wrote: If anyone is curious, I'll be glad to describe the algorithm; I've never seen it published, before or since. I got my

Re: Working with the set of real numbers

2014-03-04 Thread Dave Angel
Oscar Benjamin oscar.j.benja...@gmail.com Wrote in message: On 4 March 2014 21:18, Chris Angelico ros...@gmail.com wrote: It does not take O(n*n) time. This is Newton iteration and for well-behaved problems such as this it generates more than n digits after n iterations. I modified my code

Re: [OT] Can global variable be passed into Python function?

2014-03-02 Thread Dave Angel
Chris Angelico ros...@gmail.com Wrote in message: On Sun, Mar 2, 2014 at 3:02 PM, Dave Angel da...@davea.name wrote: The quote you make from the C standard doesn't mention malloc, so you're arguing different things. It's not the compiler that casts the malloc return value to the struct

Re: [OT] Can global variable be passed into Python function?

2014-03-02 Thread Dave Angel
Chris Angelico ros...@gmail.com Wrote in message: On Mon, Mar 3, 2014 at 12:22 AM, Dave Angel da...@davea.name wrote: Sure, for some definition of usable. Overhead such as block size, freelist pointer etc., are obviously outside of the returned block. But the array size that's specified

Re: [OT] Can global variable be passed into Python function?

2014-03-02 Thread Dave Angel
Chris Angelico ros...@gmail.com Wrote in message: } so in that case, the array size is inside the malloc'd block, but it's still invisible to the calling function. Please quit using negative language when you're so vehemently agreeing with me. The data is sometimes not at the

Re:Origin of 'self'

2014-03-02 Thread Dave Angel
Westley Martínez aniko...@gmail.com Wrote in message: I understand that in an object method the first argument in the object itself, called self. However, it doesn't have to be called self, and can be called anything. So my question is why is it called self and not this like from C++

Re: Help with Guess the number script

2014-03-02 Thread Dave Angel
Scott W Dunning swdunn...@cox.net Wrote in message: Here are the directions I’m stuck on and what I have so far, I’ll bold the part That assumes that people can see which parts of your message are bold. Rather a poor assumption in a text list like these two python forums. You should be

Re: Boxes of O's

2014-03-01 Thread Dave Angel
genius...@gmail.com Wrote in message: Well, This is what i got n = int(input(enter number of o: )) for i in range(n): print(O, end = '') for j in range(n* 2): print(O, end = '') print() Are you permitted to write and call functions? If so, then write

Re: [OT] Can global variable be passed into Python function?

2014-03-01 Thread Dave Angel
Grant Edwards invalid@invalid.invalid Wrote in message: On 2014-02-24, Michael Torrie torr...@gmail.com wrote: Why would you think that? The address of the start of your malloc'ed structure is the same as the address of the first element. Surely this is logical? Not only is it logical,

Re:How to run multiple virtualenv in product server

2014-02-27 Thread Dave Angel
YE SHANG hendi...@gmail.com Wrote in message: I'm starting to learn virtualenv, I wonder how run python project developed in virtualenv. Here is my situation, there is a server we can access with a common user name and password, there are many py scripts wrote by different people on this

Re: posting code snippets

2014-02-27 Thread Dave Angel
Mark H. Harris harrismh...@gmail.com Wrote in message: my isp withdrew the post service (nntp) from their server at end of 2011... and I didn't notice till now! ha! So, I'm not using seamonkey any longer... using google groups/ and that has been a fit to get used to, but I'm making

Re: exec and locals

2014-02-26 Thread Dave Angel
Steven D'Aprano st...@pearwood.info Wrote in message: On Wed, 26 Feb 2014 14:46:39 +0100, Peter Otten wrote: Steven D'Aprano wrote: I have to dynamically generate some code inside a function using exec, but I'm not sure if it is working by accident or if I can rely on it. I eventually

Re:intersection, union, difference, symmetric difference for dictionaries

2014-02-25 Thread Dave Angel
mauro ma...@gmail.com Wrote in message: Dictionaries and sets share a few properties: - Dictionaries keys are unique as well as sets items - Dictionaries and sets are both unordered - Dictionaries and sets are both accessed by key - Dictionaries and sets are both mutables So I wonder why

Re: Mac vs. Linux for Python Development

2014-02-23 Thread Dave Cook
are very popular among the members of pythonsd. I think this is particularly true of the Django developers. Dave Cook -- https://mail.python.org/mailman/listinfo/python-list

Re: Can global variable be passed into Python function?

2014-02-22 Thread Dave Angel
Mark Lawrence breamore...@yahoo.co.uk Wrote in message: On 22/02/2014 02:47, Dennis Lee Bieber wrote: BASIC, C, FORTRAN, COBOL, Assembly... A variable is synonym for an address [a box that holds things]. In C. int xyz = 1; xyz is placed in a register. What is xyz called now as

Re:TypeError: can't multiply sequence by non-int of type 'tuple'

2014-02-21 Thread Dave Angel
Jaydeep Patil patil.jay2...@gmail.com Wrote in message: HI, I have a tuple. I need to make sqaure of elements of tuple and after that i want add all suared tuple elements for total. When i trying to do it, below error came. Code: seriesxlist1 = ((0.0,), (0.01,), (0.02,), (0.03,),

Re:New to working with APIs, any good tutorials/books/guides?

2014-02-21 Thread Dave Angel
ApathyBear nircher...@gmail.com Wrote in message: I don't understand how APIs work to save my life. I am a complete beginner. In fact, I am a bit confused on what API even means and what the meaning entails. I am fairly competent with python, though I do lack some real world experience.

Re: Function and turtle help

2014-02-21 Thread Dave Angel
Scott W Dunning swdunn...@cox.net Wrote in message: On Feb 20, 2014, at 11:30 PM, Dave Angel da...@davea.name wrote: Look at turtle.begin_fill and turtle.end_fill That's after making sure your star is a closed shape. So, this is what I have so far and it “works” but, it fills

Re: Function and turtle help

2014-02-21 Thread Dave Angel
On 02/21/2014 10:38 PM, Scott W Dunning wrote: On Feb 21, 2014, at 7:13 PM, Dave Angel da...@davea.name wrote: Scott W Dunning swdunn...@cox.net Wrote in message: On Feb 20, 2014, at 11:30 PM, Dave Angel da...@davea.name wrote: Look at turtle.begin_fill and turtle.end_fill That's after

Re: Cannot figure out line of code, also not understanding error

2014-02-20 Thread Dave Angel
ApathyBear nircher...@gmail.com Wrote in message: On Thursday, February 20, 2014 12:54:54 AM UTC-8, Chris Angelico wrote: Calling a class will create a new instance of it. [1] What you do with it afterwards is separate. Okay. So what you are saying is that

Re:The sum of numbers in a line from a file

2014-02-20 Thread Dave Angel
kxjakkk kjaku...@gmail.com Wrote in message: Let's say I have a sample file like this: Name1 2 34 5 6 78 name1099-66-7871 A-FY10067815998 name2

Re:Function and turtle help

2014-02-20 Thread Dave Angel
Scott W Dunning swdunn...@cox.net Wrote in message: Hello, I am trying to make a function that allows me to color in a star that was drawn in Turtle. I just keep having trouble no matter what I do. I’ll post the code I have for the star (just in case). The ultimate goal is to

Re: Import order question

2014-02-17 Thread Dave Angel
Terry Reedy tjre...@udel.edu Wrote in message: On 2/17/2014 8:01 AM, Nagy László Zsolt wrote: I have a class hierarchy like this: Widget - VisualWidget - BsWidget and then BsWidget has many descendants: Desktop, Row, Column, Navbar etc. Widgets can have children. They are stored in a

Re:ipython

2014-02-15 Thread Dave Angel
greymausg greym...@mail.com Wrote in message: using IPython, is there any way of recording the commands I have entered? Try the history command. http://ipython.org/ipython-doc/rel-1.1.0/api/generated/IPython. core.magics.history.html -- DaveA --

Re:Python version problem for rpm

2014-02-14 Thread Dave Angel
anju tiwari anjutiwa...@gmail.com Wrote in message: I have two version of python 2.4 and 2.7. By default python version is 2.4 . I want to install need to install some rpm which needs python 2.7 interpreter. how can I enable 2.7 interpreter for only those packages which are requiring

Re: A curious bit of code...

2014-02-14 Thread Dave Angel
Terry Reedy tjre...@udel.edu Wrote in message: On 2/13/2014 1:37 PM, forman.si...@gmail.com wrote: I ran across this and I thought there must be a better way of doing it, but then after further consideration I wasn't so sure. if key[:1] + key[-1:] == '': ... if key[:1] == '' and

Re: Working with the set of real numbers

2014-02-14 Thread Dave Angel
Chris Angelico ros...@gmail.com Wrote in message: On Fri, Feb 14, 2014 at 5:37 PM, Gregory Ewing If it's a quantum computer, it may be able to execute all branches of the iteration in parallel. But it would only have a probability of returning the right answer (in other cases it would

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

2014-02-14 Thread Dave Angel
Sam lightai...@gmail.com Wrote in message: Dynamic data type has pros and cons. It is easier to program but also easier to create bugs. What are the best practices to reduce bugs caused by Python's dynamic data-type characteristic? Can the experienced Python programmers here advise?

Explanation of list reference

2014-02-14 Thread dave em
to the memory location of the list reference. And all of those variable can act upon the list reference. Question: Is my explanation correct? If not please set me straight :) And does anyone have an easier to digest explanation? Thanks in advance, Dave -- https://mail.python.org/mailman/listinfo/python

Re: Explanation of list reference

2014-02-14 Thread dave em
On Friday, February 14, 2014 11:26:13 AM UTC-7, Jussi Piitulainen wrote: dave em writes: He is asking a question I am having trouble answering which is how a variable containing a value differs from a variable containing a list or more specifically a list reference. My

Re:Generator using item[n-1] + item[n] memory

2014-02-14 Thread Dave Angel
Nick Timkovich prometheus...@gmail.com Wrote in message: def biggen():     sizes = 1, 1, 10, 1, 1, 10, 10, 1, 1, 10, 10, 20, 1, 1, 20, 20, 1, 1     for size in sizes:         data = [1] * int(size * 1e6)         #time.sleep(1)         yield data def consumer():     for

Re: Explanation of list reference

2014-02-14 Thread dave em
All, Thanks for the excellent explanations and for sharing your knowledge. I definitely have a better understanding than I did this morning. Best regards, Dave -- https://mail.python.org/mailman/listinfo/python-list

Re: Combination Function Help

2014-02-12 Thread Dave Angel
kjaku...@gmail.com Wrote in message: def choices(n, k): if k == 1: return n if n == k: return 1 if k == 0: return 1 return choices(n - 1, k) + choices(n - 1, k - 1) print (Total number of ways of choosing %d out of %d courses: % (n, k)) n =

Re: Flag control variable

2014-02-12 Thread Dave Angel
luke.gee...@gmail.com Wrote in message: Deleting all the obnoxious doublespaced googlegroups nonsense. .. then i keep getting IndexError: list index out of range anyway to prevent it and just set the value to 0? My car makes a funny noise. What kind of coat should I wear to the dance

Re:Simple Object assignment giving me errors

2014-02-12 Thread Dave Angel
Nir nircher...@gmail.com Wrote in message: This is from the book 'dive into python'. I am trying to define jeez as being an instance of FileInfo. class UserDict(object): def __init__(self, dict = None): self.data = {} if dict is not None:

Re: How does python know?

2014-02-12 Thread Dave Angel
Tobiah t...@tobiah.org Wrote in message: On 02/12/2014 12:17 PM, Tobiah wrote: I do this: a = 'lasdfjlasdjflaksdjfl;akjsdf;kljasdl;kfjasl' b = 'lasdfjlasdjflaksdjfl;akjsdf;kljasdl;kfjasl' print print id(a) print id(b) And get this: True 140329184721376 140329184721376 This

Re: Working with the set of real numbers

2014-02-12 Thread Dave Angel
Gregory Ewing greg.ew...@canterbury.ac.nz Wrote in message: Chris Angelico wrote: Sure, but nobody said the text file had to be _stored_ anywhere :) Computers are quite capable of working with streams of incoming data that are potentially infinite in size. However, they *can't* work with

Re: Combination Function Help

2014-02-12 Thread Dave Angel
kjaku...@gmail.com Wrote in message: def choices(n, k): if k == 1: return n if n == k: return 1 if k == 0: return 1 return choices(n - 1, k) + choices(n - 1, k - 1) comb = choices(n, k) print comb print (Total number of ways of choosing %d

Re:Get a datetime with nanoseconds

2014-02-11 Thread Dave Angel
Igor Korot ikoro...@gmail.com Wrote in message: Construct a datetime. timedelta object, and add it to your datetime. mytime += datetime. timedelta (microseconds=nano//1000) -- DaveA -- https://mail.python.org/mailman/listinfo/python-list

Re: pip3.x error using LIST instead of list

2014-02-11 Thread Dave Angel
Mark Lawrence breamore...@yahoo.co.uk Wrote in message: No matter what I try I can't get the subcommands in lower-case when I have caps lock on, is there a simple work-around for this as well? :) You could do what I've done for my own DOS, Windows, and Linux computers for years:

Re:Python programming

2014-02-11 Thread Dave Angel
ngangsia akumbo ngang...@gmail.com Wrote in message: Please i have a silly question to ask. No silly questions, just silly answers. How long did it take you to learn how to write programs? An hour, twenty years. It took an hour to learn how the keypunch worked, where the manuals

Re: Flag control variable

2014-02-11 Thread Dave Angel
luke.gee...@gmail.com Wrote in message: Can I make it that if C = int(sys.argv[3]) But when I only enter 2 argumentvariable it sets c automaticly to 0 or 1 Why do you ask for 'automatically'? You're the programmer, write the test in the code. if len (sys.argv) == 3: sys.argv.

Re:singleton ... again

2014-02-11 Thread Dave Angel
Asaf Las roeg...@gmail.com Wrote in message: playing a bit with subject. pros and cons of this approach? did i create bicycle again? :-) class myclass(object): class_instance = None def __new__(cls, *args, **kwargs): if myclass.class_instance == None:

Re:Drawing polygons in python turtle

2014-02-10 Thread Dave Angel
genius...@gmail.com Wrote in message: Hi can anyone help finding the angle to draw different polygons shapes in this example import turtle wm = turtle.Screen() alex = turtle.Turtle() for i in range(5): alex.left(216) alex.forward(50) wm.exitonclick() Why do we use 216

Re: Google Cloud Platform and GlassSolver Project

2014-02-09 Thread Dave Angel
eliasbylar...@gmail.com Wrote in message: Also I should mention that I will credit whomever writes the scripts. I have contacted Google on their Compute Engine which would execute these scripts. I am await a reply! It might help if you mention that you're talking about the Rubic cube,

Re: Sort one sequence by O(n) in time and O(1) in space

2014-02-09 Thread Dave Angel
Wesley nisp...@gmail.com Wrote in message: here is input sequence like a1,a2,...,an,b1,b2,...,bn ,the ax and bx always exist in pair. So, now, how to change the sequence to a1,b1,...,an,bn, with time complexity as O(n) and space as O(1). The two halves of the list are already

Re: What is the most pythonic way to build up large strings?

2014-02-08 Thread Dave Angel
cstrutto...@gmail.com Wrote in message: I didn't realize I could use formatting with triple quoted strings. I will look into that. You probably realize this, but formatting does not work on literals of any kind. It works on str objects, which can be created by any kind of literal,

<    2   3   4   5   6   7   8   9   10   11   >