Re: [Tutor] managing memory large dictionaries in python

2012-10-26 Thread Dwight Hutto
Now this one removes, the usage of different dicts, removes the whitespace, and uses just a whole dict, then becomes 7.6kb That's a big difference to someone parsing files, and utilizing memory storage areas. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com {0:0,1:1,2:2,3:3,4:4

Re: [Tutor] program for a problem

2012-10-26 Thread Dwight Hutto
On Mon, Oct 8, 2012 at 11:55 AM, Tharuni Dheeraj wrote: > please send me the program for the following que: > > Write a program that asks the user for a dollar amount.It then reports the > corresponding number of euros by using the current exchange rate. > -- > Regards, > Tharuni Dheeraj > > > ___

Re: [Tutor] managing memory large dictionaries in python

2012-10-17 Thread Dwight Hutto
On Tue, Oct 16, 2012 at 12:57 PM, Abhishek Pratap wrote: > Hi Guys > > For my problem I need to store 400-800 million 20 characters keys in a > dictionary and do counting. This data structure takes about 60-100 Gb > of RAM. > I am wondering if there are slick ways to map the dictionary to a file >

Re: [Tutor] modulo

2012-10-17 Thread Dwight Hutto
__ >>> I'm not a professional programmer, so I might be way off base here. You mean you haven't dealt with this subject yet... But what I like about Pythons modulo solution is that I can use it to right and left shift in lists or tuples, and I will link

Re: [Tutor] Why difference between printing string & typing its object reference at the prompt?

2012-10-17 Thread Dwight Hutto
If your app has a standard usage of phrases, you can place a file in that translates a tag into a particular language phrase. if submit_tag_selection == 'english': submit = 'Submit' if submit_tag_selection == 'english': submit = 'Soumettre' Of course this could be done without the if

Re: [Tutor] OT: Netiquette

2012-09-30 Thread Dwight Hutto
On Fri, Sep 28, 2012 at 9:07 AM, Wayne Werner wrote: > On Fri, 28 Sep 2012, Bod Soutar wrote: > >> On Sep 28, 2012 4:47 AM, "Dwight Hutto" wrote: >> > Yeah, all up in my fucking cranium with nothing but me and God to hold >> > on to one another. >>

Re: [Tutor] OT: Netiquette

2012-09-30 Thread Dwight Hutto
On Fri, Sep 28, 2012 at 6:38 AM, Bod Soutar wrote: > > On Sep 28, 2012 4:47 AM, "Dwight Hutto" wrote: >> >> On Wed, Sep 26, 2012 at 6:59 AM, Walter Prins wrote: >> > Dwight, >> > >> > On 26 September 2012 09:26, Dwight Hutto wrot

Re: [Tutor] quick question

2012-09-27 Thread Dwight Hutto
> > That's a floating point error, not a round it off from the 3rd digit > in this case. More an error you have to calculate for from the macros of the languages python evolves from, down to the processor. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com _

Re: [Tutor] quick question

2012-09-27 Thread Dwight Hutto
On Fri, Sep 28, 2012 at 1:26 AM, Brett Ritter wrote: > On Thu, Sep 27, 2012 at 10:18 PM, jh wrote: >> The subtotal of your items is: 26010.8502 >> >> My question here is, why does my subtotal have so many decimals when I never >> went above 2 in my input? > > This is not actually a Python

Re: [Tutor] quick question

2012-09-27 Thread Dwight Hutto
On Fri, Sep 28, 2012 at 1:18 AM, jh wrote: > Howdy Folks, > > I'm using Python 3.2.3, IDLE 3.2.3 (on Windows 7 64-bit if it matters) > > Here is my code: > > > # Write a program that asks for the prices of 5 items then displays the > subtotal > # of the 5 items, then calculates sales tax (6 percen

Re: [Tutor] OT: Netiquette

2012-09-27 Thread Dwight Hutto
On Wed, Sep 26, 2012 at 6:59 AM, Walter Prins wrote: > Dwight, > > On 26 September 2012 09:26, Dwight Hutto wrote: >> The only face I personally want to see of him >>> because of this is his back. >>> >> >> You wanna see my ass, because that'

Re: [Tutor] OT: Netiquette

2012-09-26 Thread Dwight Hutto
http://www.youtube.com/watch?v=_W-fIn2QZgg -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] OT: Netiquette

2012-09-26 Thread Dwight Hutto
> > To see the real Dwight Hutto I suggest everybody take a look at his > revolting conduct on several threads on the main Python mailing list > over the last 48 hours, Sparked by real trolls particularly the night before last. It's the > most disgraceful behaviour I've

Re: [Tutor] BMI Question

2012-09-24 Thread Dwight Hutto
On Mon, Sep 24, 2012 at 7:25 PM, Dwight Hutto wrote: > On Mon, Sep 24, 2012 at 7:13 PM, Alan Gauld wrote: >> On 24/09/12 20:13, Aija Thompson wrote: >>> >>> Hi! >>> >>> So I've been working on this question for hours! And Python keeps giving >

Re: [Tutor] BMI Question

2012-09-24 Thread Dwight Hutto
On Mon, Sep 24, 2012 at 7:13 PM, Alan Gauld wrote: > On 24/09/12 20:13, Aija Thompson wrote: >> >> Hi! >> >> So I've been working on this question for hours! And Python keeps giving >> me an error saying that my syntax for BMI is wrong. I really can't >> understand why. > > I'd suggest an editor,

Re: [Tutor] Sudoku

2012-09-24 Thread Dwight Hutto
short conversation(at the time), and therefore needed no context at the time, because the OP is following the thread for the answer, and knows the context. Walter's point of entry into the thread is of no concern to me, because the OP is following the conversation. If Walter wants to know th

Re: [Tutor] Python Assignment Question

2012-09-24 Thread Dwight Hutto
On Mon, Sep 24, 2012 at 4:24 PM, Dwight Hutto wrote: > On Mon, Sep 24, 2012 at 3:20 PM, Aija Thompson > wrote: >> Hi! >> >> I've been working on this question for a long time and for some reason it's >> just not clicking. > > Algorithm is the ap

Re: [Tutor] Python Assignment Question

2012-09-24 Thread Dwight Hutto
On Mon, Sep 24, 2012 at 3:20 PM, Aija Thompson wrote: > Hi! > > I've been working on this question for a long time and for some reason it's > just not clicking. Algorithm is the appropriate approach. That's what makes it click. > > I'm not sure if my loop for the question is the right one, or if

Re: [Tutor] Sudoku

2012-09-23 Thread Dwight Hutto
> window I've just spotted a squadron of low flying pigs. A family reunion no doubt. Maybe if you could pay attention instead of picking sides you would understand the argument, and comment. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com __

Re: [Tutor] Sudoku

2012-09-23 Thread Dwight Hutto
On Sun, Sep 23, 2012 at 5:54 PM, Mark Lawrence wrote: > On 23/09/2012 22:25, Dwight Hutto wrote: >>> >>> Is the personal sniping really necessary? (That's a rhetorical >>> question, just to be clear.) >> >> >> Yeah it is, welcome to net

Re: [Tutor] Sudoku

2012-09-23 Thread Dwight Hutto
On Sun, Sep 23, 2012 at 5:53 PM, Mark Lawrence wrote: > On 23/09/2012 22:20, Walter Prins wrote: >> >> Mark, >> >> On 23 September 2012 22:11, Mark Lawrence wrote: >>> >>> The complete lack of context reminds me of the old song "Where Have All >>> the >>> Flowers Gone". I guess being called Dwig

Re: [Tutor] Sudoku

2012-09-23 Thread Dwight Hutto
> Is the personal sniping really necessary? (That's a rhetorical > question, just to be clear.) Yeah it is, welcome to netiquette 10020 with programmers. His is just a lite spectral emission compared to a real flame war. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com __

Re: [Tutor] Sudoku

2012-09-23 Thread Dwight Hutto
You have a grid that needs to be filled with zxz numbers within. This grid needs to be iteraterd through number by number in order to fulfil some criteria. Define the criteria, and then flow through each puzzle with an all inclusive search for numerical combinations, then print out the resulting c

Re: [Tutor] Help

2012-09-22 Thread Dwight Hutto
>> It's tricky. >> >> Ideally, you need to take your large code base, and reduce it into a >> short piece of sample code that is runnable and reproduces your issue. > > > +1 on this. > > There is no good answer. Speaking for myself, I would prefer that you > attach the file to your email. But

Re: [Tutor] Fw: Border width of Canvas widget in tkinter

2012-09-19 Thread Dwight Hutto
Also, you might find the tkdocs handy: http://www.tkdocs.com/tutorial/canvas.html -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.pyth

Re: [Tutor] Fw: Border width of Canvas widget in tkinter

2012-09-19 Thread Dwight Hutto
On Wed, Sep 19, 2012 at 7:55 AM, Alok Joshi wrote: > Thanks very much Peter for your explanation and specially for your hint as > to how I might debug these kinds of issues. > > This is my first time asking a question on tutor mailing list and getting a > reply. I hope this reply will correctly ti

Re: [Tutor] (no subject)

2012-09-15 Thread Dwight Hutto
How to think like a computer scientist, in python: http://greenteapress.com/thinkpython/thinkpython.html And plenty of practice: Print Lists Dicts Tuples DB Files, you parse for data yourself Basic manipulation of data. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com _

Re: [Tutor] Musical note on python

2012-09-12 Thread Dwight Hutto
> You have again snipped the entire context so nobody has a clue what you're > replying to. > > Cheers. > > Mark Lawrence. My last post refers to a previous post by eryksun. If you can't look up and read it, that's cool, because you're the only one complaining. And to put it into context that yo

Re: [Tutor] Musical note on python

2012-09-12 Thread Dwight Hutto
Also, you try eryksun's solution/example, pyaudio, as well, since it's a mpdule, using different forms for cross compatibility. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com ___ Tutor maillist - Tutor@python.org To unsubscribe or c

Re: [Tutor] Musical note on python

2012-09-12 Thread Dwight Hutto
Please hit reply to all when responding. You should be able to type in 'sudo apt-get install speaker-test' or 'yum speaker-test' wrote: > This is what I got > import os os.system("speaker-test"+"--frequency 2000"+"--period 5000"+"--test sine") It should look like this: import

Re: [Tutor] Musical note on python

2012-09-12 Thread Dwight Hutto
On Wed, Sep 12, 2012 at 4:04 AM, Mark Lawrence wrote: > On 12/09/2012 08:47, Dwight Hutto wrote: >> >> So the following would be the script, except the ability to change >> specific values such as frequency with a scroll widget. >> >> import os

Re: [Tutor] Musical note on python

2012-09-12 Thread Dwight Hutto
So the following would be the script, except the ability to change specific values such as frequency with a scroll widget. import os #Variables for system call command_line_app_for sound = "speaker-test" frequency = " --frequency 2000" length_of_sound_ms = " --period 5000" test_type = " --test

Re: [Tutor] Musical note on python

2012-09-12 Thread Dwight Hutto
> Where have you forgotten to mention Ubuntu? "I'm sure...", the OP has > specifically said "in Python", which implies to me using a Python package or > module, hence my question above. > Well, I was assuming he would write a command line app like so: Python 2.7.3 (default, Aug 1 2012, 05:16:0

Re: [Tutor] Musical note on python

2012-09-11 Thread Dwight Hutto
On Wed, Sep 12, 2012 at 2:47 AM, Mark Lawrence wrote: > On 12/09/2012 06:17, D.V.N.Sarma డి.వి.ఎన్.శర్మ wrote: > >> How to produce a musical note of given frequency,volume and duration in >> Python. >> >> >> __**_ >> Tutor maillist - Tutor@python.org

Re: [Tutor] Musical note on python

2012-09-11 Thread Dwight Hutto
On Wed, Sep 12, 2012 at 2:46 AM, Dwight Hutto wrote: > Python 2.7.3 (default, Aug 1 2012, 05:16:07) > [GCC 4.6.3] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import os > >

Re: [Tutor] Musical note on python

2012-09-11 Thread Dwight Hutto
Python 2.7.3 (default, Aug 1 2012, 05:16:07) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.system("speaker-test" + " --frequency 2000" + " --period 5000" + " >>> --test sine") -- Best Regards, David Hutto *CEO:* *http://www.

Re: [Tutor] How to send email from a gmail a/c using smtp when port 587(smtp) is blocked

2012-09-11 Thread Dwight Hutto
Why don't you ask the university to setup a password protection on port 587 to allow access to specific users, and then they can monitor the incoming/outgoing connections identified by the user name? As well as encryption known by the university to monitor activity on other levels. -- Best Rega

Re: [Tutor] Constructing a object

2012-09-11 Thread Dwight Hutto
On Tue, Sep 11, 2012 at 10:23 PM, Ashley Fowler wrote: > How do you construct a object using variables? > > For instance I have to construct a student object, by first prompting > the user to enter variables for the Student class (their first and last > names, credits and gpa) then construct a

Re: [Tutor] Pygame and TkInter

2012-09-10 Thread Dwight Hutto
> Note to self, avoid http://www.hitwebdevelopment.com like the plague as > the CEO has poor communication skills :) > > Mark Lawrence. > > Point out the poor communication skills then ...Mark. Don't just use > useless propaganda. > -- Best Regards, David Hutto *CEO:* *http://www.hitwebdevelopment

Re: [Tutor] Pygame and TkInter

2012-09-10 Thread Dwight Hutto
;) -- Best Regards, David Hutto *CEO:* *http://www.hitwebdevelopment.com* ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Pygame and TkInter

2012-09-10 Thread Dwight Hutto
On Mon, Sep 10, 2012 at 3:08 AM, Mark Lawrence wrote: > On 10/09/2012 06:18, Dwight Hutto wrote: > >> Please believe me when I say use Blender, and it's Python API. It's a 3-D >> app, and you can code python with it. >> >> The game engine will make it muc

Re: [Tutor] Pygame and TkInter

2012-09-09 Thread Dwight Hutto
Please beieve me when I say use Blender, and it's Python API. It's a 3-D app, and you can code python with it. The game engine will make it muche easier for you to do 'new age' gaming. -- Best Regards, David Hutto *CEO:* *http://www.hitwebdevelopment.com* ___

Re: [Tutor] Student Class

2012-09-05 Thread Dwight Hutto
On Wed, Sep 5, 2012 at 6:10 PM, Ashley Fowler wrote: > I need help creating a student class. I am suppose to create a student > class with there first name, last name, credits > and gpa. Can anybody help me get started? Below is what needs to be > included. For number one, is the variables > sup

Re: [Tutor] help me decide

2012-09-05 Thread Dwight Hutto
No matter what the kit used for GUI, make sure it's well documented, and has plenty of tuts/docs. I used tkinter, and wxpython, and like the widget set/cross OS usages in wxpython better. However, with more experience, now I'm moving toward the Blender Game Engine to give more feel, and a 3-d pop

Re: [Tutor] Running a script in the background

2012-09-03 Thread Dwight Hutto
On Mon, Sep 3, 2012 at 9:56 PM, Steven D'Aprano wrote: > On 04/09/12 10:26, Dwight Hutto wrote: > > On *nix there is a cron daemon that runs in the background. >>> but one job running in the background controlling dozens(?) of >>> >>> others is way m

Re: [Tutor] Running a script in the background

2012-09-03 Thread Dwight Hutto
On Mon, Sep 3, 2012 at 7:57 PM, Alan Gauld wrote: > On 03/09/12 22:46, Dwight Hutto wrote: > > But a script is always running in the background of the OS main console >> of the upfront GUI app users usually see, correct? >> > > Not every OS has a main console behind

Re: [Tutor] multi processes or threads?

2012-09-03 Thread Dwight Hutto
On Mon, Sep 3, 2012 at 7:59 PM, Alan Gauld wrote: > On 03/09/12 22:32, Dwight Hutto wrote: > >> Think assembly, or procedural with this, and how the mind of a CPU >> works. Instructional steps toward an endpoint. >> >> Your mind works the fastest when one problems is

Re: [Tutor] Running a script in the background

2012-09-03 Thread Dwight Hutto
> > Cron or another process that oversees cron has to continually run. > > -- > Best Regards, > David Hutto > *CEO:* *http://www.hitwebdevelopment.com* > > -- Best Regards, David Hutto *CEO:* *http://www.hitwebdevelopment.com* ___ Tutor maillist - T

Re: [Tutor] Running a script in the background

2012-09-03 Thread Dwight Hutto
On Sun, Sep 2, 2012 at 9:03 PM, Steven D'Aprano wrote: > On Sun, Sep 02, 2012 at 03:14:53PM -0700, Ray Jones wrote: > > This is only tangentially related to the thread. Someone mentioned that > > so long as a script didn't require user input or output to the user, it > > could run silently in the

Re: [Tutor] multi processes or threads?

2012-09-03 Thread Dwight Hutto
Think assembly, or procedural with this, and how the mind of a CPU works. Instructional steps toward an endpoint. Your mind works the fastest when one problems is given, and is being solved, otherwise allocation of certain areas take place in order to find a rewarding solution. Not having used th

Re: [Tutor] Running a script in the background

2012-09-01 Thread Dwight Hutto
Here's a little more reading for you, found under google search term 'no terminal python script' http://stackoverflow.com/questions/2338951/how-can-i-run-a-py2exe-program-in-windows-without-the-terminal http://ginstrom.com/scribbles/2007/09/12/running-a-python-script-on-windows-without-the-consol

Re: [Tutor] Running a script in the background

2012-09-01 Thread Dwight Hutto
On Sat, Sep 1, 2012 at 11:29 PM, Michael Lewis wrote: > Hi everyone, > > I am sorry to ask this when there are a lot of resources online regarding > the subject, but I've spent the past two days trying to figure this out and > I don't get it. > > I have a script that will run forever > Forever i

Re: [Tutor] List all possible 10digit number

2012-08-31 Thread Dwight Hutto
I'm not sure what the point of any of that is; you're making a simple > problem complex. If you're wanting to accomplish the task without using > any of the itertools stuff, why not just: > > > current = 10**9 > lim = 10**10 > while current < lim: > print current #or write to file, or wha

Re: [Tutor] List all possible 10digit number

2012-08-31 Thread Dwight Hutto
I could comment this better. We have a function, iterToHighNum, that takes two parameters: increment and high_num. increment is how long the list of numbers being added to the old increment list of ints, to create a shorter int list that maintains the sequential count, looking for the high number

Re: [Tutor] List all possible 10digit number

2012-08-31 Thread Dwight Hutto
Here's the better function fixed with a return statement I forgot, but might not be as quick as the pre-built functions already shown: def iterToHighNum(increment,high_num): end_point = 0 a = [i for i in range(0,increment)] while (end_point != high_num) == True: for integer in

Re: [Tutor] List all possible 10digit number

2012-08-31 Thread Dwight Hutto
It might be a little buggy, but I'm in a rush, so it has a flaw in it. But I think you get the point I'm trying to make. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] List all possible 10digit number

2012-08-31 Thread Dwight Hutto
I mean line 7. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] List all possible 10digit number

2012-08-31 Thread Dwight Hutto
You can also watch this happen by uncommenting print on line 8: def iterToHighNum(increment,high_ num): end_point = 0 a = [i for i in range(0,increment)] while (end_point != high_num) == True: for integer in a: if integer != high_num: print "no matc

Re: [Tutor] List all possible 10digit number

2012-08-31 Thread Dwight Hutto
Dear Scurvy, I don't know if this has been suggested yet, but I just broke the larger list of 10 digit nums into segments, and at the end of the loop, kept the previous last num in the segment as the beginning of the next range() that goes through the same amount of ints in each segmentation of

Re: [Tutor] Tutor Digest, Vol 102, Issue 98

2012-08-30 Thread Dwight Hutto
I think the OP is about to get the point, that there are usually several workarounds that people have found on their way to designing a function, or using built-ins(not that we don't use built-ins to create those workarounds). But you have to always remember to reference the docs, google. the help

Re: [Tutor] Lambda?? Whaaaaat?

2012-08-30 Thread Dwight Hutto
Hey Scott, Always refer to google and the python docs first. from http://docs.python.org/tutorial/controlflow.html#lambda-forms 4.7.5. Lambda Forms By popular demand, a few features commonly found in functional programming languages like Lisp have been added to Python. With the lambda