Counting words in a string??

2016-09-30 Thread Jake
Hi, I need a program which:
1) Asks the user for a sentence of their choice (not including punctuation)
2) Ask the user which word they would like to know is repeated
3) Print out to the user how many times the word came up which they chose from 
their sentence.

It would help if you could comment the code. 
Thankyou in advance!!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Counting words in a string??

2016-09-30 Thread Jake
On Friday, 30 September 2016 19:49:57 UTC+1, srinivas devaki  wrote:
> On Oct 1, 2016 12:10 AM, "Jake"  wrote:
> >
> > Hi, I need a program which:
> > 1) Asks the user for a sentence of their choice (not including
> punctuation)
> > 2) Ask the user which word they would like to know is repeated
> > 3) Print out to the user how many times the word came up which they chose
> from their sentence.
> >
> 
> typical home work assignment, even though stop asking for programs and
> start asking how to make the same.
> 
> anyway if you ever try to write code for this you have to split you
> sentence and use a dict for counting
> 
> Python has Counter from collections but it is a little bit slower when
> compared to defaultdict for this kind of purpose.
> 
> Regards
> Srinivas Devaki
> Senior (final yr) student at Indian Institute of Technology (ISM), Dhanbad
> Computer Science and Engineering Department
> ph: +91 9491 383 249
> telegram_id: @eightnoteight

--
Could you make the program for me or provide an outline?
-- 
https://mail.python.org/mailman/listinfo/python-list


Python programming

2014-08-27 Thread Jake
Jake-- 
https://mail.python.org/mailman/listinfo/python-list


\r functionality

2005-05-17 Thread Jake
in c and c++ there is a useful way to refresh an output line in printf
and cout using \r meta command. So for example in the wget application
the progress of the download is updated on the same output line of the
screen. From an intital investigation python seems to lack this. Is
this correct?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Anybody use web2py?

2009-12-19 Thread Jake
On Dec 19, 1:42 am, AppRe Godeck  wrote:
> Just curious if anybody prefers web2py over django, and visa versa. I
> know it's been discussed on a flame war level a lot. I am looking for a
> more intellectual reasoning behind using one or the other.

Hi!  I come from a mvc framework background in a few different
languages (java, php, ruby).  I'm only a couple weeks into web2py, I'm
finding web2py a joy to work with.  I won't waste your time with the
features it provides, as you can find these on the website.  There is
also a copy of the lead developer's book on the site, and its very
well written.

If web2py intrigues you, I would recommend just trying it for a few
days.  It's pretty small (relatively few exposed classes and
functions) and very comprehensible, so you won't really have to invest
much if you decide to try it and don't like it.  The mailing list is
active and responsive, and the lead developer happens to have chimed
in on every question i've asked.  On the down side, the irc community
is very small.

Good Luck,
Jake



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python for philosophers

2013-05-13 Thread Jake Angulo
On Tue, May 14, 2013 at 9:32 AM, Citizen Kant  wrote:
> Do I want to learn to program?
> I didn't say I've wanted to learn to program neither said the
> opposite. I've said that I wasn't sure.


H... i'd say you'll make very good business applications analyst.  In
fact i'd hazard to say you can make it to CIO.

Recommended reading:
* PERL for dummies by: Paul Hoffman
* Crime & Punishment by: Fyodor Dostoyevsky

With your natural philosophical talent, and just a little more
 supplementary knowledge you would Pwn & ruLZ!


Just...
pls...
dont do programming...
and Never do Python.


On Tue, May 14, 2013 at 9:32 AM, Citizen Kant  wrote:

> I'm amazed with your feedback, even when due to a lack of knowledge I'm
> not able to discuss some of them. I've been inspecting the stuff about
> rewriting and that drew my attention to my first intuition of Python being
> economic. Maybe could it support my impression about a thing thats behind
> the language and got to do with condensing expressions until their end
> point is reached. I'll absolutely read the book you recommended, coz looks
> perfect. The dis module thing sounds and looks perfect too. Then again
> something that was discussed here about Python being economic or not and
> how or in which sense also threw some light on my first impression about
> the language. Everything here is interesting and illustrative. Anyway, I
> think that maybe I'm missing the point and I'm not being capable of
> expressing the fundamentals of the reason why I'm here. I thought that the
> most convenient thing to do is trying to keep myself attached to the
> natural language I master (so to speak) and answer the a set of questions
> that has been formulated. Maybe with this I'm helping myself.
>
> Towards what purpose I'm just inspecting Python's environment?
> Towards what purpose one would be just inspecting Chess' environment.
> Eventually, I could end up playing; but that isn't told yet.
>
> Do I want to learn to program?
> I didn't say I've wanted to learn to program neither said the opposite.
> I've said that I wasn't sure. And I said that because it's true. I'm not
> sure. Sureness tends to proliferate at its highest rate when one is looking
> to know. I'm looking to understand this something called Python. I've came
> here as explorer. I know_about numbers of things that go_about a number of
> topics of various supposedly most separated sciences. Since I sometimes
> have the capacity for combining these knowledge units in a fancy way and
> "realize" a great deal of things, is that I use a lot the verb "realize".
> These constant instantiations of mine are like well done objects of real
> true knowledge, made somehow by myself, by calling a method called
> "understanding" from the class that corresponds and apply to any number of
> memorized_data_objects that were previously instantiated in my mind coming
> from my senses. For me this seems to look like what follows:
>
> >>> understanding(combination(a_set_of _memorized_data_objects))
>
> >>> def real_knowledge
> >>> understanding(a_set_of_memorized_data_objects)  # How does this
> look?
>
> I'm positive about that being told all the time about everything is pretty
> much an economic issue, it just saves time, which in this environment saves
> money, but at the cost of not playing with real knowledge that's verified
> by each self (checksummed so to speak). Monkeys didn't developed our actual
> brains just by being told about everything, but experiencing the phenomena,
> that now we humans are talking about.
>
> If not, then why do I care about Python programming?
> In part is like a gut_decision. Internet is plenty of information about
> one or another thing that one could be looking for, I've taken a look to
> Ruby and Java and C++, but was a set of Python characteristics that really
> matched with something inside of me. An entity named Python must be somehow
> as a serpent. Don't forget that I'm with the freeing up of my memory, now
> I'm not trying to follow the path of what's told but acting like the monkey
> and pushing with my finger against the skin of the snake. Could be the case
> that a stimulus_response method is being called inside of me. If that's the
> case, objects instantiated by the stimulus_response method are the first
> ones that can be considered scientific like, inside of me. Python also must
> be an entity that's able to swallow, doesn't matter that it's chicken
> object. Then it will throw whatever by its tail. For me that's interesting
> and, in me, interestingness use to call the understanding method. Then I
> realize that what's stated above implies that I can feed Python, and (here
> starts the magic) see what type of whatever throws back by its tail. Then
> I'll approach to smell any possible profit.
>
> What do I aim to get out of this exercise?
> Since actually I'm not running for programmer, my reason for understanding
> Python must be sui generis and it is.
>
> What do I think "Pyt

Re: What does it take to implement a chat system in Python (Not asking for code just advice before I start my little project)

2013-07-19 Thread Jake Angulo
On Thu, Jul 18, 2013 at 2:36 PM, Aseem Bansal  wrote:

> I wanted to do a little project for learning Python. I thought a chat
> system will be good as it isn't something that I have ever done.
> ...
> I wanted to know what will I need?
> 1 learn network/socket programming


I was actually expecting somebody to mention Twisted :)
(or Tornado)

You'll find it easy to use any of these frameworks to power the back-end
chat engine.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Stack Overflow moderator “animuson”

2013-07-19 Thread Jake Angulo
On Wed, Jul 10, 2013 at 5:55 PM, Mats Peterson  wrote:

> A moderator who calls himself “animuson” on Stack Overflow doesn’t
> want to face the truth. He has deleted all my postings regarding Python
> regular expression matching being extremely slow compared to Perl.
> Additionally my account has been suspended for 7 days. Such a dickwad.
>
>
The OP meant to post:

A moderator who calls himself MatsDtroll on Stack Overflow doesn’t want to
face the truth. He has deleted all my postings regarding Perl regular
expression matching being extremely slow compared to Bash regex.
Additionally my account has been suspended for 7 days. Such a dickwad.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Average calculation Program *need help*

2016-05-12 Thread Jake Kobs
On Thursday, May 12, 2016 at 10:48:08 AM UTC-5, Jake Kobs wrote:
> Hello all, I have been struggling with this code for 3 hours now and I'm 
> still stumped. My problem is that when I run the following code:
> --
> #this function will get the total scores
> def getScores(totalScores, number):
> for counter in range(0, number):
> score = input('Enter their score: ')
> totalScores = totalScores + score
> 
> while not (score >= 0 and score <= 100):
> 
> print "Your score must be between 0 and 100."
> score = input('Enter their score: ')
> 
> 
> 
> return totalScores
> --
> the program is supposed to find the average of two test scores and if one of 
> the scores is out of the score range (0-100), an error message is displayed. 
> The main problem with this is that when someone types in a number outside of 
> the range, it'll ask them to enter two scores again, but ends up adding all 
> of the scores together (including the invalid ones) and dividing by how many 
> there are. Please help.
 
I still can't get it. Someone please tell me lol. I have done everything I can 
and still I get bad answers.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Average calculation Program *need help*

2016-05-12 Thread Jake Kobs
On Thursday, May 12, 2016 at 11:57:28 PM UTC-5, Michael Torrie wrote:
> On 05/12/2016 10:22 PM, Jake Kobs wrote:
> > On Thursday, May 12, 2016 at 10:48:08 AM UTC-5, Jake Kobs wrote:
> >> Hello all, I have been struggling with this code for 3 hours now and I'm 
> >> still stumped. My problem is that when I run the following code:
> >> --
> >> #this function will get the total scores
> >> def getScores(totalScores, number):
> >> for counter in range(0, number):
> >> score = input('Enter their score: ')
> >> totalScores = totalScores + score
> >> 
> >> while not (score >= 0 and score <= 100):
> >> 
> >> print "Your score must be between 0 and 100."
> >> score = input('Enter their score: ')
> >> 
> >> 
> >> 
> >> return totalScores
> >> --
> >> the program is supposed to find the average of two test scores and if one 
> >> of the scores is out of the score range (0-100), an error message is 
> >> displayed. The main problem with this is that when someone types in a 
> >> number outside of the range, it'll ask them to enter two scores again, but 
> >> ends up adding all of the scores together (including the invalid ones) and 
> >> dividing by how many there are. Please help.
> >  
> > I still can't get it. Someone please tell me lol. I have done everything I 
> > can and still I get bad answers.
> 
> Tell us what you've done, precisely.  We're here to help you learn, not
> give you the answers.
> 
> One thing that strikes me is that your while loop doesn't appear to be
> indented properly.  You have it running after all the scores have been
> inputted in the for loop, but I suspect this isn't what you want.  You
> want the while loop to occur each time through the for loop.  Do you
> know how to move this while loop to be inside the for loop?

Im not sure how to move it inside the for loop. I've been working on this small 
problem for like 4 hours lol.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Average calculation Program *need help*

2016-05-12 Thread Jake Kobs
Thank you for the help..I think I'm getting closer, but I feel like after they 
enter an invalid number, it should reset the invalid number(s) somehow. Here's 
my updated code:
--
#this function will get the total scores
def getScores(totalScores, number):
for counter in range(0, number):
score = input('Enter their score: ')
if (score < 100 and score > 0):
totalScores = totalScores + score
while (score > 100 or score < 0):

print "Your scores must be between 0 and 100."
score = input('Enter their score: ')
score = input('Enter their score: ')
totalScores = totalScores + score 


return totalScores

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Average calculation Program *need help*

2016-05-13 Thread Jake Kobs
Thank you so much! I finally got it. :)
-- 
https://mail.python.org/mailman/listinfo/python-list


Program prints questions for user input, but won't show the answer output

2016-05-18 Thread Jake Kobs
Here is the code:

#Lab 9-4 Blood Drive

#the main function
def main():
  endProgram = 'no'
  while endProgram == 'no':
print 
# declare variables
pints = [0] * 7
totalPints = 0
averagePints = 0
highPints = 0
lowPints = 0






   





# function calls
pints = getPints(pints)
totalPints = getTotal(pints, totalPints)
averagePints = getAverage(totalPints, averagePints)
highPints = getHigh(pints, highPints)
lowPints = getLow(pints, lowPints)
displayInfo(averagePints, highPints, lowPints)
   
endProgram = raw_input('Do you want to end program? (Enter no or yes): ')
while not (endProgram == 'yes' or endProgram == 'no'):
  print 'Please enter a yes or no'
  endProgram = raw_input('Do you want to end program? (Enter no or yes): ')

#the getPints function
def getPints(pints):
counter = 0
while counter < 7: 
pints[counter] = input("Enter pints collected: ")
counter = counter + 1
return pints
#the getTotal function
def getTotal(pints, totalPints):

counter = 0
while counter < 7:
totalPints = totalPints + pints[counter]
counter = counter + 1
return totalPints
#the getAverage function
def getAverage(totalPints, averagePints):
averagePints = totalPints / 7
return averagePints
#the getHigh function
def getHigh(pints, highPints):
highPints = pints[0]
counter = 1
while counter < 7:
if (pints[counter] > highPints):
highPints = pints[counter]
counter = counter + 1
return highPints
#the getLow function
def getLow(pints, lowPints):
lowPints = pints[0]
counter = 1
while counter < 7:
if (pints[counter] < lowPints):
lowPints = pints[counter]
counter = counter + 1
return lowPints
#the displayInfo function
def displayInfo(averagePints, highPints, lowPints):
print "The average pints donated was: ", averagePints
print "The highest amount of pints donated was: ", highPints
print "The lowest amount of pints donated was: ", lowPints
return displayInfo(averagePints, highPints, lowPints)

main()

The problem is that the display info isn't shown after the user types in their 
7 numerical values. Please help.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Program prints questions for user input, but won't show the answer output

2016-05-18 Thread Jake Kobs
MRAB,

I am not quite sure how to return the print statements so I thought that 
returning the displayInfo def would help.. Im so lost.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Extend Python

2005-09-01 Thread Jake Gittes
Try looking at ctypes -
http://starship.python.net/crew/theller/ctypes/

On 1 Sep 2005 05:12:21 -0700, [EMAIL PROTECTED] wrote:

>Hi All I have a problem with extentions of Python.
>
>Background:
>I'm workin within a large industrial control system and I have created
>a Port for VxWorks. In the system we have different permissions
>depending on which state the controller is in. To perform some actions
>in some states may even injure or kill people. Therefor we need
>"intelligent" wrappers between Python and C-code.
>
>My Question:
>Swig offers some great features but is to basic for us. Is there
>another program that creates more readble code that can be easily
>edited? How much work is it to write our own wrappers?
>
>//T

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python script help

2013-08-04 Thread Jake Angulo
On Mon, Aug 5, 2013 at 8:58 AM, Michael Torrie  wrote:

> On 08/02/2013 03:46 AM, [email protected] wrote:
> > I do know some Python programming, I just dont know enough to put
> > together the various scripts I need...I would really really
> > appreciate if some one can help me with that...
>

Hi Cool,

Unfortunately you really gotta know enough Python to put things together,
so if you have time - learn a little more python, and then you can choose
any of these 2 tools to do the job:
http://doc.scrapy.org/en/latest/intro/tutorial.html
http://www.gregreda.com/2013/03/03/web-scraping-101-with-python/

In fact i agree you dont even need python.  Even Bash / shell script with
wget can do this.

However if you dont have the time or dont want to exert the req'd effort,
unfortunately this list is not for giving free code.
I suggest you hire somebody at odesk.com or elance.com - you'd be amazed
how low people there charge for python "web scraping".

Good luck!
-- 
http://mail.python.org/mailman/listinfo/python-list


Python variable as a string

2013-08-23 Thread Jake Angulo
Sorry this is a very basic question.

I have a list *var* which after some evaluation I need to refer to *var* as
a string.

Pseudocode:

var = ['a', 'b' , 'c' , 'd']
adict = dict(var='string', anothervar='anotherstring')
anotherdict = dict()
if :
anotherdict[akey] = adict['var']


Basically im evaluating the list *var*, and if true, i want to use *var* as
a string so that i can refer to a key-value pair in *adict *(whose key name
is also var for convenience).
*
*
Or maybe i should do things differently?

Any help and code will be appreciated!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python variable as a string

2013-08-24 Thread Jake Angulo
Thank you all for the reply.

Actually yes this was a confusing question, and borne out of trying to make
a shortcut.
I didnt ask to convert the contents of var into a string.
All I needed was to get the literal equivalent "var" because I needed to
use it in another dict object - whose keys i named the same (eg 'var') for
convenience.  Instead i ended up complicating stuff.

I resolved this by doing things differently with (if - elif - else).

Sorry for the confusion - but thanks all for answering - i can use a code
or two of what you have shared!



On Fri, Aug 23, 2013 at 11:23 PM, Neil Cerutti  wrote:

> On 2013-08-23, Jake Angulo  wrote:
> > I have a list *var* which after some evaluation I need to refer
> > to *var* as a string.
>
> You must make a str version of var.
>
> > Pseudocode:
> >
> > var = ['a', 'b' , 'c' , 'd']
> > adict = dict(var='string', anothervar='anotherstring')
> > anotherdict = dict()
> > if :
> > anotherdict[akey] = adict['var']
>
> anotherdict[akey] = adict[str(var)]
>
> Will actually work, though you might prefer:
>
> anotherdict[akey] = adict[''.join(var)]
>
> Try them out and see.
>
> --
> Neil Cerutti
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tryign to send mail via a python script by using the local MTA

2013-09-19 Thread Jake Angulo
Up Robert Kern's reply!

I was waiting for smtplib  to be
mentioned... finally!  Instead people simply answer philosophically.  I
dont want to judge whether OP is a troll or not - but i found a lot of
arrogant replies here.  I have also worked on an antispam project before,
and see through the intents of the OP, but I do not pretend to be a
moralist. I was hoping we would strictly discuss code or software
architecture here, not morality. Simple question, simple answer pls, in the
interest of the Python list.

To the OP:

You might want to google smtplib, and use that instead of os calling a
system command. Smtplib takes care of all the operating system's quirks for
you, and still uses the os native sendmail program.

On the other hand, the way you are sending email is highly suspect, trying
to spoof a domain, random email address, etc.  It is not easy to fool most
modern email servers nowadays - especially gmail's.  They verify first that
the sending domain matches the IP of the sender.  And if you are trying to
do this - it is neither Python's nor the OS fault.

Happy coding!


On Tue, Sep 17, 2013 at 10:51 PM, Robert Kern  wrote:

> On 2013-09-17 13:11, Ferrous Cranus wrote:
>
>  There are members here like Tim Chase who said that they find it
>> interesting to
>> be able to do what i proposed.
>>
>
> No, he didn't. He was using sarcasm in a vain attempt to inspire you to
> search the Python documentation where you could easily find the standard
> SMTP library.
>
>   
> http://docs.python.org/2/**library/smtplib
>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless
> enigma
>  that is made terrible by our own mad attempt to interpret it as though it
> had
>  an underlying truth."
>   -- Umberto Eco
>
> --
> https://mail.python.org/**mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python on a MacBook Pro (not my machine)

2013-11-06 Thread Jake Angulo
I use a Macbook air for programming - yes it has Python 2.x in it.

For code editing i use a combination of:
1) Wing IDE 101
(from their website: "is free scaled down Python IDE designed for teaching
introductory programming classes")
2) Sublime Text
3) Good old Vi

You could try those


On Thu, Nov 7, 2013 at 8:34 AM, Cameron Simpson  wrote:

> On 06Nov2013 09:51, John Ladasky  wrote:
> > I just wanted to say thank you to everyone who posted here with
> recommendations for programming-friendly text editors.  I will follow up on
> this after I have resolved a more fundamental issue with my new student --
> his Python 3.3.2 interpreter segfaults and crashes on the second command!
>  I'll start a new thread to deal with that problem.
>
> I think there was some discussion of this bug with Mavericks very
> recently on the list. Possibly fixed in more recent builds.
>
> Cheers,
> --
> Cameron Simpson 
>
> Uhlmann's Razor: When stupidity is a sufficient explanation, there is no
> need
>  to have recourse to any other.
> - Michael M. Uhlmann, assistant attorney general
>   for legislation in the Ford Administration
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Twisted or Tornado?

2013-02-28 Thread Jake Angulo
I have to say it first: I am not trolling :P

Im working on a server project (with IOS client) and would like to create a 
custom, lean and mean server - real Quick!

My requirements for this framework in descending order:
1) Easy to use API
2) Widely available documentation / Examples / Community contributions
3) Feature-wise - kinda most that you commonly need is there

Your opinions will be valuable, if possible cite examples or URL references, 
Pls!  

I prefer opinion from those who have programmed real projects in it - not just 
read some blog or Slashdot :P
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Twisted or Tornado?

2013-03-03 Thread Jake Angulo
All,

Thanks for your reply - I thought I would share the outcome of my choice:

I have chosen to use twisted.   The API is very decent to learn, though the
clincher is theres huge community / docs, and many projects used on
production.

I was able to make a working project prototype in hours!
Thanks to the large twisted library.

Our project is an ipad multiplayer game, and we didnt want to use existing
servers because we want to do things exactly as we wish.

Rgds,

Jake

On Fri, Mar 1, 2013 at 8:55 PM, Andriy Kornatskyy <
[email protected]> wrote:

>
> The following benchmarks are related to:
>
> a) python web frameworks
> http://mindref.blogspot.com/2012/09/python-fastest-web-framework.html
> http://mindref.blogspot.com/2012/10/python-web-routing-benchmark.html
> http://mindref.blogspot.com/2012/10/python-web-reverse-urls-benchmark.html
> http://mindref.blogspot.com/2012/10/python-web-caching-benchmark.html
>
> b) template engines
> http://mindref.blogspot.com/2012/10/python-templates-benchmark.html
> http://mindref.blogspot.com/2012/07/python-fastest-template.html
>
> With source code:
> https://bitbucket.org/akorn/helloworld
>
> Thanks.
>
> Andriy Kornatskyy
>
>
> 
> > Date: Fri, 1 Mar 2013 09:25:43 +
> > Subject: Re: Twisted or Tornado?
> > From: [email protected]
> > To: [email protected]
> > CC: [email protected]
> >
> > Although these articles are a _little_ old they are probably useful to
> > help you decide which solution is most suitable for you in terms of
> > performance
> >
> > http://nichol.as/benchmark-of-python-web-servers
> > http://nichol.as/asynchronous-servers-in-python
> >
> > I would also be interested if any one on this list has any idea if the
> > results above would be any different these days or whether the
> > benchmarks are still fairly representative.
> >
> >
> > On 1 March 2013 00:28, Jake Angulo
> > mailto:[email protected]>> wrote:
> > I have to say it first: I am not trolling :P
> >
> > Im working on a server project (with IOS client) and would like to
> > create a custom, lean and mean server - real Quick!
> >
> > My requirements for this framework in descending order:
> > 1) Easy to use API
> > 2) Widely available documentation / Examples / Community contributions
> > 3) Feature-wise - kinda most that you commonly need is there
> >
> > Your opinions will be valuable, if possible cite examples or URL
> > references, Pls!
> >
> > I prefer opinion from those who have programmed real projects in it -
> > not just read some blog or Slashdot :P
> > --
> > http://mail.python.org/mailman/listinfo/python-list
> >
> >
> >
> > --
> > ./Sven
> >
> > -- http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Do you feel bad because of the Python docs?

2013-03-03 Thread Jake Angulo
The OP speaks for himself alone.

Python - for such a very young language, and with the documentation and
community blogs available at this point - I cannot ask for more.

And who needs docs when the python syntax is as good as writing plain
english sentence?


On Fri, Mar 1, 2013 at 9:06 PM, Jean-Michel Pichavant <
[email protected]> wrote:

> [snip hostile replies]
>
> It's somehow funny to read such posts on a thread about someone
> complaining about the community python being hostile.
> I think we should really try to resist the urge of answering trolls
> because no matter how many times we slap them, they'll stay trolls and
> probably get even bigger.
>
> Instead, we take revenge by helping someone asking us to do his homework
> and show the world how merciful the python community is.
>
> JM
>
>
> -- IMPORTANT NOTICE:
>
> The contents of this email and any attachments are confidential and may
> also be privileged. If you are not the intended recipient, please notify
> the sender immediately and do not disclose the contents to any other
> person, use it for any purpose, or store or copy the information in any
> medium. Thank you.
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


im.py: a python communications tool

2013-04-05 Thread Jake D
Hey Usenetites!
I have a horrible Python program to allow two people to chat with each
other.  It has horribly any functionality, but it is meant for the
public to work on, not necessarily me.  Anyways, here's a quick FAQ.

What does this do that IRC can't?  What does this do that AIM can't?
--It allows direct communication between two computers, whereas IRC
doesn't.  And AIM and similar services require a username, etc.  This
is made specifically for two users on a network to chat.
What version of Python is this written in?
--Python 2.7.3.
What is the licence?
--It's released under a special FOSS licence.  Here it is:
You can do whatever you want with this program.

Alright, now, here's the code:

#!/usr/bin/python
#An instant messaging program implemented in Python.
#Created on Sunday, December 30, 2012 (long before it's Usenet
publication)

import socket
import sys
import threading

def server_listen():
while True:
r = c.recv(8192)

if r == "\quit":
c.close()
s.close()
sys.exit(0)

print con_addr[0], ": " + r

def client_listen():
while True:
r = s.recv(8192)

if r == "\quit":
s.close()
sys.exit(0)

print sys.argv[1], ": " + r

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

if sys.argv[1] == "-l":
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(('', 5067))
s.listen(5)
c, con_addr = s.accept()

while True:
r = c.recv(8192)

if r == "\quit":
c.close()
s.close()
sys.exit(0)

print con_addr[0], ": " + r
i = raw_input("You: ")

if i == "\quit":
c.send("\quit")
c.close()
s.close()
sys.exit(0)

c.send(i)

else:
s.connect((socket.gethostbyname(sys.argv[1]), 5067))
print "Chat initiated with " + sys.argv[1] + "!"

while True:
i = raw_input("You: ")

if i == "\quit":
s.send("\quit")
s.close()
sys.exit(0)

s.send(i)
r = s.recv(8192)

if r == "\quit":
s.close()
sys.exit(0)

print sys.argv[1] + ": " + r

I encourage people to modify this code, because really, it sucks.
Enjoy!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: im.py: a python communications tool

2013-04-06 Thread Jake D
On Apr 5, 9:26 pm, Andrew Berg  wrote:
> On 2013.04.05 20:07, Roy Smith wrote:> I know this is off-topic, but I 
> encourage people to NOT invent their own
> > licenses.
>
> Perhaps he meant this existing license:http://www.wtfpl.net/about/
> --
> CPython 3.3.0 | Windows NT 6.2.9200 / FreeBSD 9.1

Yep.  As a matter of fact, I did.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: im.py: a python communications tool

2013-04-06 Thread Jake D
On Apr 5, 8:52 pm, Demian Brecht  wrote:
> Thanks for sharing some of your work with the community. However...
>
> Speaking to the sharing aspect: Why would you post a block of code in an
> email? If you're looking for people to contribute, it would likely be a
> much better idea to post it on github (which was built for collaborative
> work).
>
> As for the code itself, if you /know/ it sucks and are advertising it as
> such, you're not really enticing people to work on it. In its current
> state, it looks like a non-extensible prototype, just poking around to see
> how you can achieve a p2p connectivity, without doing /any/ research
> (supporting modules, etc) or design before just starting to throw something
> together.
>
> I'd venture to say that the chances of actually getting anyone to
> contribute to this in its current state (especially purely over a mailing
> list) would be slim to none. People generally tend to want to see that
> there's actually effort and thought put into something before they put
> /their/ own time into it.

Jeez, harsh.  I __am__ putting this on github, and I __am__ coming
back to this program and working on it now.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: im.py: a python communications tool

2013-04-08 Thread Jake D
On Apr 7, 6:36 pm, Steven D'Aprano  wrote:
> On Sun, 07 Apr 2013 14:47:11 -0700, jhunter.dunefsky wrote:
> > Actually, my current licence can be found here:
> >https://github.com/jhunter-d/im.py/blob/master/LICENCE.  Whaddaya think
> > about this, Useneters?
>
> I think you're looking for a world of pain, when somebody uses your
> software, it breaks something, and they sue you. Your licence currently
> means that you are responsible for the performance of your software.
>
> Why don't you use a recognised, tested, legally-correct licence, like the
> MIT licence, instead of trying to be clever and/or lazy with a one-liner?
>
> E.g.http://opensource.org/licenses/MIT
>
> Software licencing is a solved problem. Do you really think that people
> write three or four paragraph licences because they *like* legal
> boilerplate? Did you imagine that you were the first person to think, "I
> know! I'll write a one-liner telling people they can do whatever they
> want with my software! Nothing can possibly go wrong!"?
>
> Use a known, tested, working solution, and save yourself the pain.
>
> --
> Steven

MIT is actually the best one I've seen so far.  I'm updating LICENCE.
-- 
http://mail.python.org/mailman/listinfo/python-list


New version

2013-04-09 Thread Jake D
There's a new version of im.py out on GitHub:
https://github.com/jhunter-d/im.py/blob/master/im.py
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: im.py: a python communications tool

2013-04-09 Thread Jake D
I just put out a new version of im.py on GitHub.  You can find it
here:
https://github.com/jhunter-d/im.py/blob/master/im.py
-- 
http://mail.python.org/mailman/listinfo/python-list


nested dictionary assignment goes too far

2006-06-26 Thread Jake Emerson
I'm attempting to build a process that helps me to evaluate the
performance of weather stations. The script below operates on an MS
Access database, brings back some data, and then loops through to pull
out statistics. One such stat is the frequency of reports from the
stations ('char_freq'). I have a collection of methods that operate on
the data to return the 'char_freq' and this works great. However, when
the process goes to insert the unique 'char_freq' into a nested
dictionary the value gets put into ALL of the sub-keys for all of the
weather stations. I have isolated (I think) the problem to the compound
key assignment in the next-to-last line before the print statements.
The result is that the last 'freq' to run throught the for loops gets
posted to all of the sensor_numbers.  Eventually the process will put
in stats for the other keys in the nested dictionary, so that's why I
have set up the dictionary this way.

Thanks in advance!

run_flag=1
if run_flag > 0:

   distinctID = runSQL(Unique_IDs)
   distinctID = map(firstpart,distinctID) # converts the list of tuples
that is returned to a list of numbers
   rain_raw_dict =
dict.fromkeys(distinctID,{'N':-6999,'char_freq':-6999,'tip1':-6999,'tip2':-6999,'tip3':-6999,'tip4':-6999,'tip5':-6999,'tip6':-6999,'lost_rain':-6999})

   rawList = runSQL(Rain_Raw_Count)

   temp_list = [110,140,650,1440]

   for sensor_count, sensor_number in enumerate(temp_list):
  # get the frequency of timer reports for each rain gauge
  # note that when a for loop is of the form "for X, x in
enumerate(xList)",
  # X is an index value, and x is the value itself.
  timerList = []
  for icount, i in enumerate(rawList):
 if i[0]==sensor_number:
for jcount in range(icount+1,len(rawList)): # look ahead to
the next values for comparison
   if rawList[jcount][0]==sensor_number:
  if rawList[icount][2]==rawList[jcount][2]:
 temp = rawList[jcount][1]-rawList[icount][1]
 timerList.append(temp)
 icount = jcount-1
 break

  # now build a histogram of the time differences stored in
"timerList"
  h = Histogram()
  timer = h.histo(timerList)
  sorted_timer = h.sorted_histo(timer)
  freq = h.characteristic_freq(sorted_timer)
  rain_raw_dict[sensor_number]['char_freq'] = sensor_number   #
 here's the problem!!
  freq = -6999

print "ID = 110:",rain_raw_dict[110]
print "ID = 140:",rain_raw_dict[140]
print "ID = 650:",rain_raw_dict[650]
print "ID = 1440:",rain_raw_dict[1440]

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: nested dictionary assignment goes too far

2006-06-26 Thread Jake Emerson
Thanks a lot Serge and Ben. Your posts were right on.

I hope the weather is good wherever you are.

Jake

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: first book about python

2006-07-08 Thread Jake Emerson
There have been lots of recommendations for the O'Reilly book, which is
a good one. However, I would recommend "Beginning Python" by Magnus Lie
Hetland. All I knew before starting Python was Mathematica, and this
book was very helpful. It may seem to start out slow, but I've found
that I'm going back to those first chapters occasionally to review and
practice the syntax. It, and this group, have carried me through some
pretty tough problems (for me anyway). It's been worth it. Good luck.

Jake

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: problem opening html file with webbrowser.open

2007-10-29 Thread Jake McKnight
> Maybe your browser is not in the executable path? Try passing the PATH
> environment variable to the Python interpreter and make sure it contains
the
> directory where your browser is installed.

Clearly the browser is in the path, because it opens.  It just fails to open
the file supplied by the script.

> but my main issue is that when I use the
> webbrowser.open("file:///home/myname/report.html"), webbroser opens
> but the page does not come up.

I just tested this in both Windows (Vista) and Linux (Kubuntu 7.10 and
Slackware 12) without any problems.  Try it from the interpreter; if it's
actually executing successfully, you should see something that looks like
this:

>>> import webbrowser
>>> webbrowser.open("file:///home/user/path/to/file/test.html")
True
>>>


-- 
Jake McKnight
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Binary search tree

2007-11-09 Thread Jake McKnight
What if someone wants to implement, say, Huffman compression?  That requires
a binary tree and the ability to traverse the tree.  I've been looking for
some sort of binary tree library as well, and I haven't had any luck.

On 11/9/07, Larry Bates <[EMAIL PROTECTED]> wrote:
>
> [EMAIL PROTECTED] wrote:
> > Hi,
> >
> > I have to get list of URLs one by one and to find the URLs that I have
> > more than one time(can't be more than twice).
> >
> > I thought to put them into binary search tree, this way they'll be
> > sorted and I'll be able to check if the URL already exist.
> >
> > Couldn't find any python library that implements trees.
> > Is there some library of this kind in python? Or can I find it
> > somewhere else?
> >
> Put them into a set.  You can check for existence (very fast) and at the
> end it
> is easy to sort.
>
> -Larry
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Jake McKnight
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Returning to 'try' block after catching an exception

2008-05-22 Thread Jake Anderson

alex23 wrote:

On May 22, 9:13 am, Karlo Lozovina <[EMAIL PROTECTED]> wrote:
  

In case it's not clear what I meant: after executing some_function()
exception SomeExcpetion gets risen. Then, in except block I do something
to fix whatever is causing the exception and then I would like to go back
to try block, and execute some_function() again. Is that doable?



If you know what exception to expect, and you know how to "fix" the
cause, why not just put tests _before_ some_function() is called to
ensure that everything is as it needs to be?
--
http://mail.python.org/mailman/listinfo/python-list
  

There are cases where this could be helpful
FTP upload that would sometimes get cut off along the way. So you might 
want to just try again depending on why the failure happened perhaps.


Command of "ReTry" sounds good to me ;->
--
http://mail.python.org/mailman/listinfo/python-list

Re: python scalability

2008-07-09 Thread Jake Anderson

Tim Mitchell wrote:

Hi All,

I work on a desktop application that has been developed using python 
and GTK (see www.leapfrog3d.com).  We have around 150k lines of python 
code (and 200k+ lines of C).  We also have a new project manager with 
a C# background who has deep concerns about the scalability of python 
as our code base continues to grow and we are looking at introducing 
more products.  I am looking for examples of other people like us (who 
write desktop apps in python) with code bases of a similar size who I 
can point to (and even better talk to) to help convince him that 
python is scalable to 300+ lines of code and beyond.  I have looked at 
the python success stories page and haven't come up with anyone quite 
like us. One of my project managers questions is: "Are we the only 
company in the world with this kind and size of project?"

I want to say no, but am having trouble convincing myself, let alone him.

If you are involved in this kind of thing please get in touch with me.

Thanks,
Tim
--
http://mail.python.org/mailman/listinfo/python-list

It'd be 1500k lines of C if not for the 150k of python ;->
--
http://mail.python.org/mailman/listinfo/python-list


Re: very large dictionary

2008-08-06 Thread Jake Anderson

Bruno Desthuilliers wrote:

Simon Strobl a écrit :
(snip)
> I would prefer to be able to use the same type of

scripts with data of all sizes, though.


Since computers have a limited RAM, this is to remain a wish. You 
can't obviously expect to deal with terabytes of data like you do with 
a 1kb text file.

--
http://mail.python.org/mailman/listinfo/python-list

You can, you just start off handling the multi GB case and your set.
databases are really easy, I often use them for manipulating pretty 
small amounts of data because its just an easy way to group and join etc.


--
http://mail.python.org/mailman/listinfo/python-list


Re: benchmark

2008-08-06 Thread Jake Anderson

Jack wrote:
I know one benchmark doesn't mean much but it's still disappointing to see 
Python as one of the slowest languages in the test:


http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/ 



--
http://mail.python.org/mailman/listinfo/python-list
  
Something to note though, The python version is ~ half the length of the 
rest of them ;->

--
http://mail.python.org/mailman/listinfo/python-list


Re: Upgrading to DB-API (was Re: Corrupted images ...)

2008-08-13 Thread Jake Anderson

Aahz wrote:

In article <[EMAIL PROTECTED]>,
Fredrik Lundh  <[EMAIL PROTECTED]> wrote:
  
Ouch.  Please use parameters instead of explicit escapes and string 
formatting; Python's not PHP.



How would you recommend upgrading an application that is more than ten
years old and contains something like 100K lines of code?
  

Very carefully? ;->
It would be a manual process but it shouldn't be too bad, the stuff 
before and after that code block should be unaffected
--
http://mail.python.org/mailman/listinfo/python-list

Re: improving a huge double-for cycle

2008-09-18 Thread Jake Anderson




psyco might help a fair bit (10x-40x) here ;->
perhaps look at dumping the data into sqlite then pulling it back out.
It (or the other databases) are designed for tossing around large lumps
of data.
Alexzive wrote:

  Hello there :) ,

I am a python newbie and need to run following code for a task in an
external simulation programm called "Abaqus" which makes use of python
to access the mesh (ensamble of nodes with xy coordinates) of a
certain geometrical model.

[IN is the starting input containing the nodes to be check, there are
some double nodes with the same x and y coordinates which need to be
removed. SN is the output containing such double nodes]

Code: Select all
for i in range(len(IN)): #scan all elements of the list IN
  for j in range(len(IN)):
if i <> j:
 if IN[i].coordinates[0] == IN[j].coordinates[0]:
   if IN[i].coordinates[1] == IN[j].coordinates[1]:
  SN.append(IN[i].label)



Unfortunately my len(IN) is about 100.000 and the running time about
15h  :(

Any idea to improve it?

I have already tried to group the "if statements" in a single one:

Code: Select all
if i <> j and if IN[i].coordinates[0] == IN[j].coordinates[0] and
if IN[i].coordinates[1] == IN[j].coordinates[1]:


but no improvements.

Many thanks, Alex
--
http://mail.python.org/mailman/listinfo/python-list
  



-- 


Vapour Forge



Jake Anderson


Project Manager


Mobile:   0412 897 125
Email: [EMAIL PROTECTED]
Web Page:  www.vapourforge.com


Your source
for custom IT services




--
http://mail.python.org/mailman/listinfo/python-list

Re: improving a huge double-for cycle

2008-09-19 Thread Jake Anderson

Bruno Desthuilliers wrote:

Alexzive a écrit :

Hello there :) ,

I am a python newbie and need to run following code for a task in an
external simulation programm called "Abaqus" which makes use of python
to access the mesh (ensamble of nodes with xy coordinates) of a
certain geometrical model.

[IN is the starting input containing the nodes to be check, there are
some double nodes with the same x and y coordinates which need to be
removed. SN is the output containing such double nodes]

Code: Select all
for i in range(len(IN)): #scan all elements of the list IN
  for j in range(len(IN)):
if i <> j:
 if IN[i].coordinates[0] == IN[j].coordinates[0]:
   if IN[i].coordinates[1] == IN[j].coordinates[1]:
  SN.append(IN[i].label)



Unfortunately my len(IN) is about 100.000 and the running time about
15h  :(

Any idea to improve it?


A couple ones have been submitted. Harald gets a point about the 
redundant tests (even if his solution seems to be broken, cf below) - 
your inner loop should have looked like :


  for j in xrange(i+1, len(IN))

Now the obvious winner is pruebono - even unoptimized, using sets seems 
to be *way* faster than even the most optimized corrected version of 
your algorithm.


Here's a quick bench - please everyone doublecheck it to make sure it's ok:




Results here (py2.5, gentoo linux, athlonxp1800, 512 ram):

 >>> test_results()
True
 >>> test_times()
doubles0 : 1.55667901039
doubles1 : 0.719144105911
doubles2 : 0.703393936157
doubles3 : 0.700654983521
doubles4 : 0.706257104874
doubles5 : 0.528184890747
doubles6 : 0.461633205414
doubles8 : 0.0134379863739
doubles9 : 0.0108540058136
 >>>

Not surprisingly, half less iterations makes for half less time. 
Aliasing, as often, proves to be a good optimization too. But obviously, 
using the correct data structure / algorithm combo is the key : simpler 
code, and 115 times faster (143 times with aliasing). If pruebono 
solution's is correct (and it as AFAICT), your 15 hours computation 
should by now take less than 10 minutes...





Ubuntu 8.04 core2 2.6(i think)
without psycho
doubles0 : 0.610555171967
doubles1 : 0.29314494133
doubles2 : 0.286273956299
doubles3 : 0.281984090805
doubles4 : 0.28240609169
doubles5 : 0.207377910614
doubles6 : 0.156388044357
doubles8 : 0.00533080101013
doubles9 : 0.00458884239197

with psycho
doubles0 : 0.127684116364
doubles1 : 0.069571018219
doubles2 : 0.064826965332
doubles3 : 0.0702300071716
doubles4 : 0.0647261142731
doubles5 : 0.0522589683533
doubles6 : 0.0437579154968
doubles8 : 0.00190806388855
doubles9 : 0.00214099884033

On this small test its a variance between ~6x to 2X still its basically 
free so why not ;->

--
http://mail.python.org/mailman/listinfo/python-list


Efficient python 2-d arrays?

2011-01-17 Thread Jake Biesinger
Hi all,

Using numpy, I can create large 2-dimensional arrays quite easily.
>>> import numpy
>>> mylist = numpy.zeros((1,2), dtype=numpy.int32)

Unfortunately, my target audience may not have numpy so I'd prefer not to use 
it.

Similarly, a list-of-tuples using standard python syntax.
>>> mylist = [(0,0) for i in xrange(1)

but this method uses way too much memory (>4GB for 100 million items, compared 
to 1.5GB for numpy method).

Since I want to keep the two elements together during a sort, I *can't* use 
array.array.
>>> mylist = [array.array('i',xrange(1)), 
>>> array.array('i',xrange(1))]

If I knew the size in advance, I could use ctypes arrays.
>>> from ctypes import *
>>> class myStruct(Structure):
>>> _fields_ = [('x',c_int),('y',c_int)]
>>> mylist_type = myStruct * 1
>>> mylist = mylist_type()

but I don't know that size (and it can vary between 1 million-200 million), so 
preallocating doesn't seem to be an option.

Is there a python standard library way of creating *efficient* 2-dimensional 
lists/arrays, still allowing me to sort and append?

Thanks!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Efficient python 2-d arrays?

2011-01-17 Thread Jake Biesinger
On Monday, January 17, 2011 4:12:51 PM UTC-8, OAN wrote:
> Hi,
> 
> what about pytables? It's built for big data collections and it doesn't 
> clog up the memory.

I thought PyTables depends on NumPy?  Otherwise I would indeed use their carray 
module.

Thanks!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Efficient python 2-d arrays?

2011-01-17 Thread Jake Biesinger
> IIUC (please confirm), you don't need a generic two-dimensional
> array, but rather an Nx2 array, where N may be large (but the other
> dimension will always have a magnitude of 2).

Yes, that's right, Nx2 not NxM.

> > Since I want to keep the two elements together during a sort
> 
> I assume (please confirm) that you want to sort by one of the numbers,
> and keep the other one together with the sort key.

Again, yes.
 
> I suggest that you implement your own sorting algorithm, or reuse
> heapsort (actually, any of the sorting algorithms would do).
> 
> You then use array.array, and take the elements at indices 2k and 2k+1
> together. Sorting would then only look at even indices, but any swapping
> you do during the sorting would always swap two numbers with two other
> numbers.

Yes, this is an option. Writing a custom sort function just didn't sound very 
appealing and I was hoping for a more generic solution.  

Thanks!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Efficient python 2-d arrays?

2011-01-18 Thread Jake Biesinger
> Since you can't depend on your users installing the dependencies, is
> it vital that your users run from source? You could bundle up your
> application along with numpy and other dependencies using py2Exe or
> similar. This also means you wouldn't have to require users to have
> the right (or any) version of Python installed.

It's a good suggestion, though I am far from familiar with the process.

I've just finished implementing another alternative-- I'm doing a merge sort, 
where the array chunks are zipped together and then sorted using python's 
builtin sort then unzipped back to their original arrays. This seems fast 
enough and the reduced memory requirement for 2 arrays vs 1 list-of-tuples is 
substantial (1.5 GB vs 4GB).

Thanks for the great suggestions!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Efficient python 2-d arrays?

2011-01-18 Thread Jake Biesinger
> Without using third party libraries, no not really.  numpy has it
> covered so there's not really a lot of demand for it.  If your users
> are loading 1.5 GB arrays into memory, it's probably not unreasonable
> to expect them to have numpy installed.

My users are biologists, and I can't expect them to have numpy (and the barrier 
to entry for this group is particularly high).
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Efficient python 2-d arrays?

2011-01-20 Thread Jake Biesinger
> Thanks for the great suggestions!

On a related note, is there no way to efficiently sort a python array?


>>> x = array('f', xrange(1000))
>>> x.sort()
---
AttributeErrorTraceback (most recent call last)

/home/wbiesing/src/python-sort/ in ()

AttributeError: 'array.array' object has no attribute 'sort'

>>> type(sorted(x))


Seems like a common enough task, but no way to do it efficiently without 
scipy/numpy.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: parsing XML

2010-05-16 Thread Jake b
Check out Amara: http://www.xml3k.org/Amara/QuickRef

It looks promising. For a pythonic solution over sax / dom.

>>> Iter(doc.team.player)
# or
>>> doc.team.player[0].name

[ new to the list, so I'm not sure why my previous response failed. Is
it on me? Because using iPod, vs thunderbird?

However, looking at superpollo, the reply-to didn't include
python-list. Or even a valid address ?

Message below. Ty.

On Saturday, May 15, 2010, Mail Delivery Subsystem
 wrote:
> Delivery to the following recipient failed permanently:
>
>      [email protected]
>
> Technical details of permanent failure:
> Google tried to deliver your message, but it was rejected by the recipient 
> domain. We recommend contacting the other email provider for further 
> information about the cause of this error. The error that the other server 
> returned was: 554 554 : Relay access denied (state 14).
>
> - Original message -
>
> MIME-Version: 1.0
> Received: by 10.91.208.24 with SMTP id k24mr18590agq.155.1273969257113; Sat,
>         15 May 2010 17:20:57 -0700 (PDT)
> Received: by 10.90.80.20 with HTTP; Sat, 15 May 2010 17:20:57 -0700 (PDT)
> In-Reply-To: <[email protected]>
> References: 
> 
>          <[email protected]>
> Date: Sat, 15 May 2010 19:20:57 -0500
> Message-ID: 
> Subject: Re: parsing XML
> From: Jake b 
> To: superpollo 
> Content-Type: text/plain; charset=ISO-8859-1
>
> Check out Amara: http://www.xml3k.org/Amara/QuickRef
> For a pythonic solution over sax / dom.
>>> Iter(doc.team.player)
> or
>>> doc.team.player[0].name
>
> --
> Jake
>

--
Jake

-- 
Jake
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: tone generation for motherboard and sound card speakers?

2010-05-16 Thread Jake b
For sound ( not internal beep ) you can check out:

   - pygame: http://www.pygame.org/project-PygSoundTestTest-1453-.html
   - python.org/sound : http://wiki.python.org/moin/PythonInMusic
   - pk http://trac2.assembla.com/pkaudio/
   - pureData http://puredata.info/Members/thomas/py



-- 
Jake
-- 
http://mail.python.org/mailman/listinfo/python-list


View Html/ py code in a zip as HTML/text ? ( for phone )

2010-05-19 Thread Jake b
I'm trying to figure out the best way to view python snippets /
smaller files on the itouch/iPhone.
I'm reading a new projects docs, but it's not easy to view the zip.

It can't view zip files. Say I want to read pyglet examples, I need
unzip at least one file and serve that. If it is text/HTML/py , then
view in pastebin.

Is there a trick to do this? Or maybe for certain sites. I thought I
had seen a way google did it to a zip not hosted on google code, but
can't find it.

1) is there existing web app to do this?
2) if not, I am on wifi, with apache mod-wsgi python enabled, so I
could use that?

-- 
Jake
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: where are the program that are written in python?

2010-05-21 Thread Jake b
did this not go to the list? Arg, reply does in other mailing list.

On Fri, May 21, 2010 at 5:48 AM, Jake b  wrote:

> I took it as game-domain only question:
> I don't know of any big game written in python. ( meaning python code,
> using c++ libs. ) Verses games that at their is in c++ , calling a scripting
> language under the hood.
> Even if a game is written at its base in python, it still uses python
> libraries which can use c++ under the hood.
>
> WoW had a huge amount of logic, in LUA combined with xml. Was cool seeing
> the crazy things implemented.
>
> There are a lot that use a c++ engine, with a scripting engine under the
> hood. python, lua, unrealscript, etc... Civ4 uses python for map generation.
> Not sure how much else?
> Wouldn't be surprised, alpha centauria even had text files you could mod
> the game with.
>
> Unreal games: U, UT, UT2k4, etc.. (since before UT original, use
> scripting(unreal script) to control basically everything.) There are
> classes, and methods that 'do the work' in c++ for speed.
>
> From development point, You're on a deadline, if your company all know the
> existing language/engine/api, there isn't much incentive to learn a new api,
> and convert existing code, and not having all the previous examples, and
> api's. [ That can even mean using game engine X, even if Y is in the same
> language, and is technically better. ]
>
>
> --
> Jake
>



-- 
Jake
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: client server console app with cmd library

2010-05-21 Thread Jake b
Networking can be hard. I'd suggest checking out these libs.

pygame mastermind:
http://www.pygame.org/project-Mastermind+Networking+Lib-859-1773.html
podSixNet : http://mccormick.cx/projects/PodSixNet/
twisted: http://wiki.python.org/moin/Twisted-Examples
lots of references in the  answers to this StackOverflow post:
http://stackoverflow.com/questions/78704/good-python-network-programing-resource

Twisted is the hardest in that list to get into.
-- 
Jake
-- 
http://mail.python.org/mailman/listinfo/python-list


Help choosing license for new projects

2010-07-12 Thread Jake b
I'm starting a new python code project. What license do you suggest? I
am searching, but I'm not finding a simple comparison of licenses. So
I don't know which to use. Maybe MIT or Apache or LGPL or BSD?

Are there certain licenses to avoid using because of interaction
problems between libraries using GPL2 / GPL3 / MIT / LGPL. / BSD with
my own?

I want:
1] Pretty much let anyone use it. Users do not have to include source
code, as long as I get credit. (which I think normallly is a textfile
with project url + name?)

2] (if it matters) I will be using different combinations of pyglet,
pygame, wxPython, etc.

3] I want the option to use my own code in something commercial at a later date.

Does #3 complicate things, or is fine when including author info?

The choices for google code projects are:
  Apache License 2.0
  Eclipse license 1.0
  GPLv2
  GPLv3
  GNU lesser GPL
  MIT license
  Mozilla Public license 1.1
  New BSD License

thanks for advice,
--
ninmonkey
-- 
http://mail.python.org/mailman/listinfo/python-list