Re: MS-DOS Commands

2015-01-11 Thread Joel Goldstick
ed > > how can i fix this? Nothing to do with DOS, there is no strings Try this: >>>my_string = "hi there" >>>print my_string > -- > https://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: extracting numbers with decimal places from a string

2015-01-11 Thread Joel Goldstick
On Sun, Jan 11, 2015 at 5:20 PM, Thomas 'PointedEars' Lahn wrote: > Joel Goldstick wrote: > >> my_list = "1.23, 2.4, 3.123".split(",") >> >> that will give you ['1.23', '2.4', '3.123'] > > No, it gives

Re: extracting numbers with decimal places from a string

2015-01-11 Thread Joel Goldstick
On Sun, Jan 11, 2015 at 6:12 PM, Thomas 'PointedEars' Lahn wrote: > Joel Goldstick wrote: > >> Thomas 'PointedEars' Lahn wrote: >>> Joel Goldstick wrote: >>>> my_list = "1.23, 2.4, 3.123".split(",") &

Re: Help understanding list operatoins inside functions in python 3

2015-01-13 Thread Joel Goldstick
> [1] > x in the outer scope is not x in the z() scope > -- > https://mail.python.org/mailman/listinfo/python-list > -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Trees

2015-01-19 Thread Joel Goldstick
ow if you've seen this http://kmike.ru/python-data-structures/ > but > > maybe of interest. > > I've seen it. It's a nice page. > > I attempted to get my treap port in there since it has a Cython > version, but it didn't seem to take. > > I've mostly focused on pure python that runs on CPython 2.x, CPython > 3.x, Pypy, Pypy3 and Jython. > -- > https://mail.python.org/mailman/listinfo/python-list > -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: basic generator question

2015-02-04 Thread Joel Goldstick
t; or you could just keep track of the number of times you were called: > > class rpt: > def __init__ (self, value, rpt): > self.value = value; self.rpt = rpt > def __call__ (self): > if self.rpt: > self.rpt -= 1 > return self.value ># ... otherwise? > > Up to you to figure out what to do when self.rpt hits zero. > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list > -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: basic generator question

2015-02-04 Thread Joel Goldstick
On Wed, Feb 4, 2015 at 10:19 AM, Joel Goldstick wrote: > > > On Wed, Feb 4, 2015 at 9:32 AM, Chris Angelico wrote: > >> On Thu, Feb 5, 2015 at 12:23 AM, Neal Becker wrote: >> > Now I want gen to be a callable that repeats N times. I'm thinking, >&

Re: Monte Carlo probability calculation in Python

2015-02-05 Thread Joel Goldstick
t; > Any help would be gratefully accepted - surely nobody wants to see Python > beaten by a C++ program??? :-) > > Thanks, > Paul > -- > https://mail.python.org/mailman/listinfo/python-list > have you googled "python monte carlo"? -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] sql-like join on two lists or dictionaries

2015-02-16 Thread Joel Goldstick
On Sun, Feb 15, 2015 at 2:14 PM, Peter Otten <__pete...@web.de> wrote: > Joel Goldstick wrote: > > > You can dispense with the slicing if you use the str.split() method. It > > will put each item in a list. > > Only if there are no whitespace chars in the field. &

Re: [Tutor] sql-like join on two lists or dictionaries

2015-02-16 Thread Joel Goldstick
On Mon, Feb 16, 2015 at 10:09 PM, Dave Angel wrote: > On 02/16/2015 09:26 PM, Joel Goldstick wrote: > >> On Sun, Feb 15, 2015 at 2:14 PM, Peter Otten <__pete...@web.de> wrote: >> >> Joel Goldstick wrote: >>> >>> You can dispense with the slicing

Re: Algorithm for Creating Supersets of Smaller Sets Based on Common Elements

2015-02-21 Thread Joel Goldstick
#x27;m just stumped on the algorithm itself. > > Anybody have an idea? > start with reading about python sets. If you take the intersection of two sets it will return a set with common elements. If that is empty, they don't pass your test. If you take the union, you get a set with

Re: Python Worst Practices

2015-02-25 Thread Joel Goldstick
biguous: dd/mm/ or mm/dd/? The ISO > standard is clearer: -mm-dd. > > Handling text: "Unicode sandwich". > > UTF-8 is better than legacy encodings. > > -- > https://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Combination Function Help

2014-02-12 Thread Joel Goldstick
Y On Feb 12, 2014 11:00 AM, wrote: > > 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) Following line never runs > print ("Total number of ways of choosing %d o

Re: Why is the interpreter is returning a 'reference'?

2014-02-17 Thread Joel Goldstick
On Feb 17, 2014 12:05 PM, "Nir" wrote: > > >>> k = ['hi','boss'] > >>> > >>> k > ['hi', 'boss'] > >>> k= [s.upper for s in k S.upper() > >>> k > [, ] > > Why doesn't the python interpreter just return > ['HI, 'BOSS'] ? > > This isn't a big deal, but I am just curious as to why it does this. > -- >

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

2014-02-20 Thread Joel Goldstick
On Feb 20, 2014 11:25 AM, "kxjakkk" wrote: > > Let's say I have a sample file like this: > > Name1 2 34 5 6 78 > > name1099-66-7871 A-FY10067815998 > na

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

2014-02-20 Thread Joel Goldstick
On Feb 20, 2014 1:20 PM, wrote: > > What I've got is > def stu_scores(): > lines = [] > with open("file.txt") as f: > lines.extend(f.readlines()) > return ("".join(lines[11:])) > > scores = stu_scores() > for line in scores: > fields = line.split() > name = fields[0] Pr

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

2014-02-21 Thread Joel Goldstick
On Feb 21, 2014 3:15 PM, "ApathyBear" wrote: > > Thanks, I think I have an understanding of what they are, but now am still a little confused on how one goes about using it: how am I supposed to know how to use an API in python? or in any other language for that matter? If an API is defining rules

Re: Error compressing tar file

2014-03-02 Thread Joel Goldstick
On Mar 2, 2014 7:40 PM, "Mike" wrote: > > Hello, > I have the script that make a backup file (this process is ok), but now i wish compress the file on tar file format. But i have problem syntax in the line of the tar function. > > The error is > > [root@master ~]# python bkp_db.py > File "bkp_db

Re: Error compressing tar file

2014-03-02 Thread Joel Goldstick
On Mar 2, 2014 7:41 PM, "Joel Goldstick" wrote: > > > On Mar 2, 2014 7:40 PM, "Mike" wrote: > > > > Hello, > > I have the script that make a backup file (this process is ok), but now i wish compress the file on tar file format. But i have

Re: Is their a command to view code?

2014-03-07 Thread Joel Goldstick
On Mar 7, 2014 1:16 PM, "NexusRAwesome1995 ." wrote: > > I am making a text based aventure game for my assignment and a friends test run has somehow saved over the entire code file and now im using an earlier version of the code. I have 0 idea if there is anyway to look at the code using the IDLE

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

2014-03-25 Thread Joel Goldstick
Jean, be aware there is also python tutor list you might like. This is sometimes a tough crowd here. Don't be discouraged. It can be a badge of honor sometimes -- https://mail.python.org/mailman/listinfo/python-list

Re: [OFF-TOPIC] How do I find a mentor when no one I work with knows what they are doing?

2014-04-08 Thread Joel Goldstick
Check meetup.com. I live in nyc where there are django, python groups. Maybe where you live too On Apr 8, 2014 12:45 PM, "Steven D'Aprano" < steve+comp.lang.pyt...@pearwood.info> wrote: > On Wed, 09 Apr 2014 01:38:42 +1000, Chris Angelico wrote: > > >>> -People are super patient and helpful and th

Re: Simple question

2014-04-15 Thread Joel Goldstick
On Apr 15, 2014 2:19 PM, "Phil Dobbin" wrote: > > Hi, all. > > I've just started to learn Python (I'm reading Mark Lutz's 'Learning > Python' from O'Reilly) & I'm confused as to this part: > > '>>> 0.1 + 0.1 + 0.1 - 0.3 > 5.55111.' > It's not. Look at the end of the result. It's scientific not

Re: Tutorials for Reorganizing Spreadsheet Data

2014-04-16 Thread Joel Goldstick
On Apr 16, 2014 9:55 AM, wrote: > > Hello, I'm a high school physics teacher and while I've played with Python enough to make a rock paper scissors program or animation of a bouncing ball (with air resistance!), I've never used it to work with data from a spreadsheet. > > I have a large spreadshee

Re: symple programming task

2014-04-20 Thread Joel Goldstick
might want to ditch the while loop and use a for loop over a range: for i in range(1000): Its a more pythonic idiom. Also use 4 spaces, not 8 for indents. Minor points. Print() is your friend -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: which book to read next??

2014-04-21 Thread Joel Goldstick
w.alan-g.me.uk/ > http://www.flickr.com/photos/alangauldphotos > > -- > https://mail.python.org/mailman/listinfo/python-list > Don't forget to look at the python.org site: https://wiki.python.org/moin/BeginnersGuide -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: How to get final URL after redirection

2014-04-27 Thread Joel Goldstick
Huh? His email is in his post On Apr 27, 2014 11:45 AM, wrote: > Hi Nsihant, I need your help, can I get your email address? > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: Significant digits in a float?

2014-05-06 Thread Joel Goldstick
HP 35. $350 in 1973 or 4. Still have it somewhere. Tom yay! On May 6, 2014 11:20 AM, "alister" wrote: > On Tue, 06 May 2014 09:51:25 -0500, Mark H Harris wrote: > > > On 5/1/14 9:06 PM, Dennis Lee Bieber wrote: > >>> The N4-ES and the N4-T (mine) are essentially the same rule. The N4-ES > >>> on

Re: Windows automatic rebooting due to faulty code

2014-05-23 Thread Joel Goldstick
On May 23, 2014 12:12 PM, "Ronak Dhakan" wrote: > > It is a small file to draw an approximate circle using Turtle. The reboot does not happen consistently. Here is the code: http://pastebin.com/8T3aRCEd > > I was thinking whether there is a way to run python in a virtual environment. > -- > https:

Re: script to Login a website

2013-07-31 Thread Joel Goldstick
Requests module since its easier to understand, simpler, and better documented than the standard url stuff. You can find it at http://docs.python-requests.org/en/latest/ > http://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com -- http://mail.python.org/mailman/listinfo/python-list

Re: How to use Python to open Unread message(s) in specific Outlook folder, clicking a hyperlink within the email message to a secure login window, entering password to download .csv file, run Excel m

2013-08-02 Thread Joel Goldstick
easy. > > ChrisA > > Thanks for the heads up ChrisA! How should I tweak my setup to make it > easier to retrieve my email? I hope I'm doing this reply correctly. > -- > http://mail.python.org/mailman/listinfo/python-list Reading outlook email, I found this: http://tim

Re: Where to suggest improvements in the official Python documentation?

2013-08-03 Thread Joel Goldstick
I had much confusion 2 > months back before I could figure out its proper use. Where do I suggest this > improvement? > -- > http://mail.python.org/mailman/listinfo/python-list http://docs.python.org/2/bugs.html -- Joel Goldstick http://joelgoldstick.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Can someone suggest better resources for learning sqlite3? I wanted to use the Python library but I don't know sql.

2013-08-03 Thread Joel Goldstick
at http://www.sqlite.org/ > -- > http://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Where to suggest improvements in the official Python documentation?

2013-08-04 Thread Joel Goldstick
on your household I suppose! Have you tried google? I am having a hard time understanding what your specific question is. Do you have one? > -- > http://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com -- http://mail.python.org/mailman/listinfo/python-list

Re: HTTP post with urllib2

2013-08-06 Thread Joel Goldstick
File "/usr/lib/python2.7/urllib2.py", line 1116, in do_request_ > 'Content-length', '%d' % len(data)) > > > I don't get it, what's going on here? > > Thank you! > -- > http://mail.python.org/mailman/listinfo/python-list KInda of ducking your questions, but the requests module is a lot easier to use and understand:http://docs.python-requests.org/en/latest/ -- Joel Goldstick http://joelgoldstick.com -- http://mail.python.org/mailman/listinfo/python-list

Re: HTTP post with urllib2

2013-08-06 Thread Joel Goldstick
On Tue, Aug 6, 2013 at 7:35 PM, cerr wrote: > On Tuesday, August 6, 2013 4:08:34 PM UTC-7, Joel Goldstick wrote: >> On Tue, Aug 6, 2013 at 6:52 PM, cerr wrote: >> >> > Hi, >> >> > >> >> > Why does this code: >> >> > >>

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

2013-08-08 Thread Joel Goldstick
> http://mail.python.org/mailman/listinfo/python-list Here is a good example: http://stackoverflow.com/questions/3362600/how-to-send-email-attachments-with-python I found it using the following google search: "python send email using smtp with multiple attachment" It was the sec

Re: connection change

2013-08-09 Thread Joel Goldstick
e to export the datastore to SQL server database, as we are > having issues with the sqlite limit. > > > > Thank you. > > Inna > > > > This email is intended solely for the named addressee. > If you are not the addressee indicated please delete it immediately. &g

Re: connection change

2013-08-09 Thread Joel Goldstick
On Fri, Aug 9, 2013 at 7:31 PM, Dennis Lee Bieber wrote: > On Fri, 9 Aug 2013 14:36:54 -0400, Joel Goldstick > declaimed the following: > > >> >>Have you tried to change your program to use mysql instead? If so, >>show the changes you made and what the resul

Re: back with more issues

2013-08-11 Thread Joel Goldstick
e some quick changes above to give you what you want. But you need to understand more about functions. Your player function does next to nothing. It defines two variables to fixed values, then gets a random number and returns it. Can you try to explain what you think each of your functions is do

Re: back with more issues

2013-08-11 Thread Joel Goldstick
basic concepts its really more magic than anything else. Also, you may get better help in the python-tutor group. -- Joel Goldstick http://joelgoldstick.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Am I not seeing the Error?

2013-08-12 Thread Joel Goldstick
in the lifetime of any useful software system is greater than the time spent creating the original code. > -- > http://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com -- http://mail.python.org/mailman/listinfo/python-list

Re: connection change

2013-08-12 Thread Joel Goldstick
. I think the table cannot handle any more insert of > BLOB hence I want to change it to SQL database - which has no > restriction on database size. > > Any suggestions? use google: "python mssql" > > Cheers, > Inna > -- Joel Goldstick http://joelgoldstick.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Am I not seeing the Error?

2013-08-12 Thread Joel Goldstick
On Mon, Aug 12, 2013 at 4:16 PM, Devyn Collier Johnson wrote: > > On 08/12/2013 12:56 PM, Joel Goldstick wrote: >> >> On Mon, Aug 12, 2013 at 11:47 AM, Roy Smith wrote: >>> >>> I can't quite sort out the multiple quoting levels, but somebody said: &

Re: Getting a value that follows string.find()

2013-08-13 Thread Joel Goldstick
string.find(starturlsource, 'http://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting a value that follows string.find()

2013-08-13 Thread Joel Goldstick
On Tue, Aug 13, 2013 at 7:03 PM, wrote: > On Tuesday, August 13, 2013 5:58:07 PM UTC-5, Joel Goldstick wrote: >> lookup urlparse for you answer >> >> >> >> On Tue, Aug 13, 2013 at 6:51 PM, <> wrote: >> >> > I know the title doesn'

Re: Getting a value that follows string.find()

2013-08-13 Thread Joel Goldstick
On Tue, Aug 13, 2013 at 7:18 PM, Joel Goldstick wrote: > On Tue, Aug 13, 2013 at 7:03 PM, wrote: >> On Tuesday, August 13, 2013 5:58:07 PM UTC-5, Joel Goldstick wrote: >>> lookup urlparse for you answer >>> >>> >>> >>> On Tue, Aug 13,

Re: Want to learn Python

2013-08-15 Thread Joel Goldstick
ose even Iam interested to shift to > development side on python.. > Also if anyone knows abt good coaching institute for the same in Bangalore > can share with me... > Eagerly waiting for response from the group.. > > Thanks, > Premkumar > -- > http://mail.python.org/

Re: default python os x

2013-08-19 Thread Joel Goldstick
tions/5846167/how-to-change-default-python-version -- Joel Goldstick http://joelgoldstick.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Where to suggest improvements in the official Python documentation?

2013-08-20 Thread Joel Goldstick
On Tue, Aug 20, 2013 at 10:22 AM, Aseem Bansal wrote: > @Joel Goldstick >> Joel Goldstick >> >> http://joelgoldstick.com > > My specific question was that the Python documentation's tutorial isn't clear > when it comes to lambda forms. I just wanted som

Re: Found a grammar error in PEP 5. How to suggest correction?

2013-08-20 Thread Joel Goldstick
I found this link by going to google and searching for "how to submit documentation bug to python.org" Come on Aseem. Pick up your game a little bit. You actually have the opportunity to get the documentation changed for the better, or you can just keep asking the same quest

Re: Found a grammar error in PEP 5. How to suggest correction?

2013-08-20 Thread Joel Goldstick
gt; How to suggest a correction for this? > > > You just did. If this list does not work, or for non-trivial suggestions, go > to bugs.python.org or email d...@python.org. See > http://docs.python.org/3/bugs.html > -- > Terry Jan Reedy > > -- > http://mail.python.o

Re: I wonder if I would be able to collect data from such page using Python

2013-08-21 Thread Joel Goldstick
arated value format. 4. import to excel or wherever Now, go off and write the code. When you get stuck, copy and paste the portion of the code that is giving you problems, along with the traceback. You can also get help at the python-tutor mailing list -- Joel Goldstick http://joelgoldstick.com -- http://mail.python.org/mailman/listinfo/python-list

Re: I wonder if I would be able to collect data from such page using Python

2013-08-21 Thread Joel Goldstick
e site for 'real data'. For that, you need to really understand stuff that you might not. At any rate, study the Requests Module documentation. Python comes with urllib, and urllib2 that cover the same ground, but Requests is a lot simpler to understand -- Joel Goldstick http://joelg

Re: I wonder if I would be able to collect data from such page using Python

2013-08-21 Thread Joel Goldstick
searching and retrieving articles. If they do, this would be simpler and probably safer than parsing web pages. From time to time, websites change their layout, which would probably break your program. However APIs are more stable good luck to you -- Joel Goldstick http://joelgoldstick.com --

Re: Help in Nltk

2013-08-25 Thread Joel Goldstick
hat your skill level is with python and nltk. Also, people here generally don't do people's homework. You might also google nltk mailing lists to see if you can find people with specific knowledge of nltk. -- Joel Goldstick http://joelgoldstick.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking homogeneity of Array using List in Python

2013-08-25 Thread Joel Goldstick
ls could be used to solve your problem. This problem is so completely contrived that without knowing the course of your study (what you have learned about python programming so far) it is really useless to try to guess an acceptable answer. Let me suggest you discuss this with your classmates if p

Re: Getting request's source site

2013-08-26 Thread Joel Goldstick
rer value in the header, it will be in the log. You don't have any say in this from your end. If you are the creator of your own website you might like to add google analytics to your pages. This is done with a little javascript that google provides. Although there may be a python angle to your question, it isn't apparent yet. > http://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Global variable

2013-08-26 Thread Joel Goldstick
ou do it with no parameters. test2 knows nothing of your test3 internal names. You need to look up python namespaces, and scoping. I believe these are covered in the python.org tutorial. Be aware that if you learned another language (C, Java) that names will confuse you for a while in python.

Re: New VPS Provider needed

2013-08-27 Thread Joel Goldstick
what's going on, > from that page. > 3) You blame your host. > 4) You ask python-list for some free web hosting > 5) You then do not understand that, if one of us offers his server to > you, there is a massive trust issue. > 6) You have no clue. > > Deny that if

Re: Moving to Python for web

2013-08-28 Thread Joel Goldstick
sts module (3rd party - well received) http://docs.python-requests.org/en/latest/ > -- > http://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com -- http://mail.python.org/mailman/listinfo/python-list

Re: [error] [client 178.59.111.223] (2)No such file or directory: exec of

2013-08-28 Thread Joel Goldstick
y relate to apache. He seems to demand cook book answers as compared to understanding the issues. At any rate, isn't this stuff really something that the Web Server company should be helping him with? Its their server, they know how it is configured, and they can quickly look in his directories

Re: python script to gather file links into textfile

2013-08-30 Thread Joel Goldstick
e closets or under the beds. People forget what they put in those places sometimes. -- Joel Goldstick http://joelgoldstick.com -- http://mail.python.org/mailman/listinfo/python-list

Re: python script to gather file links into textfile

2013-08-30 Thread Joel Goldstick
you want to hire someone you will need to give more specific details of what you want done On Fri, Aug 30, 2013 at 10:56 AM, Joel Goldstick wrote: >> >>> On 2013-08-30, david.d...@gmail.com wrote: >>>> >>>> Hi, im looking for someone who can make a script t

Re: web2py - running on fedora

2013-08-30 Thread Joel Goldstick
'installing web2py apache' and I got whole lot of information. Why don't you try to get it running and come back with a specific question if you get stuck? -- Joel Goldstick http://joelgoldstick.com -- http://mail.python.org/mailman/listinfo/python-list

Re: user interfaces python3.x

2013-09-02 Thread Joel Goldstick
org first to see if you like 'programming'. Warning, it involves words and letters, not icons. >> >> A "proper" interface huh? Well, I'd love to tell you the answer... > > ...but holy wars would ensue. > > -- > http://mail.python.org/mailman/listinfo/py

Re: Cookie or not..?

2013-09-02 Thread Joel Goldstick
print lobj.read() > > > ... and then parse output, but i need to login to get all info. > > Any input will be appreciated. > -- > http://mail.python.org/mailman/listinfo/python-list You will need to understand a little about http protocol, and cookies. Try starting h

Re: user interfaces python3.x

2013-09-02 Thread Joel Goldstick
ot more to learn than a specific GUI library. So, maybe the answers were a little facetious, but the question could be taken as either completely naive, or as completely pompous. To answer the second interpretation is maybe more fun! > > > > > -- > Joe > -- > http://mail.

Re: UnicodeDecodeError issue

2013-09-02 Thread Joel Goldstick
s a language. You need to be rigorous to make mathematical assumptions. One bad assumtion and proof == poof! > > ChrisA > -- > http://mail.python.org/mailman/listinfo/python-list -- Joel Goldstick http://joelgoldstick.com -- http://mail.python.org/mailman/listinfo/python-list

Re: problem of double import in python

2013-09-02 Thread Joel Goldstick
the long names you can do this: import common.interface.interface as ci then self.ui = ci.Ui_Materials. Look up the section in python.org on importing modules to learn more -- Joel Goldstick http://joelgoldstick.com -- http://mail.python.org/mailman/listinfo/python-list

Re: A Pragmatic Case for Static Typing

2013-09-02 Thread Joel Goldstick
e I'm off topic, sometimes the reason to choose one methodology over another has to do less with the merits than on other factors. That said, python 'feels' extremely right to me. Having come from PHP for the last dozen years that shouldn't surprise anyone! -- Joel Goldstick http://joelgoldstick.com -- http://mail.python.org/mailman/listinfo/python-list

Re: PyPi Module Removal

2013-09-03 Thread Joel Goldstick
On Tue, Sep 3, 2013 at 4:52 PM, Joel Goldstick wrote: > On Tue, Sep 3, 2013 at 4:15 PM, Brian Rak wrote: >> I was trying to install wxPython earlier today. Not RTFMing, I tried >> 'easy_install wx', which ended up installing this strange module: >> https://pypi.p

Re: PyPi Module Removal

2013-09-03 Thread Joel Goldstick
e confusing ~1000 users a month, > while not providing any significant functionality. > > I don't really have any way to contact the author of the module. Is there > any way to have this deleted/renamed? > -- > https://mail.python.org/mailman/listinfo/python-list -- J

Re: How to exit a cgi file after a download.

2013-09-04 Thread Joel Goldstick
r if they choose to because > the cgi window is open and the link is still > active. > > I am trying to find a way to close the cgi > file or call another file after the download > without adding a close button and asking the > client to close the window. > > jd > &g

Re: Could someone please paraphrase this statement about variables and functions in Python?

2013-09-05 Thread Joel Goldstick
ike something that's too important to > overlook. > > I can tell it's referring to things like scope, pass-by-value, references, > probably the call stack, etc., but it is written extremely poorly. > Translation please? Thanks! > -- > https://mail.python.org/mailman/listi

Re: Confessions of a terrible programmer

2013-09-06 Thread Joel Goldstick
lman/listinfo/python-list Pardon me, but I completely don't get this article. Let me in on what is supposed to be the joke please! -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

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

2013-09-15 Thread Joel Goldstick
ere_ with that code, which appears to have > IndentationErrors in it. > > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list > This questions sounds like it should be asked of your hosting company. They may not allow there servers to be used this way. Wha

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

2013-09-16 Thread Joel Goldstick
as your questions there. As has been pointed out by several people here, your questions are not python language issues, they are issues relating to how email protocols work. So, study up and go to an email experts group and good luck! -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

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

2013-09-17 Thread Joel Goldstick
StcbhDr1C6VlDaPjfVH+w8842h/0QLhTsMXjY= > =K/XL > -END PGP SIGNATURE- > -- > https://mail.python.org/mailman/listinfo/python-list > -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Having both if() and for() statements in one liner

2013-09-17 Thread Joel Goldstick
passed, the range(n,m) is > never even evaluated. > > -tkc > > > Tim, that's great! or in the wonderful world of Onslow, "Oh nice" http://en.wikipedia.org/wiki/Onslow_(Keeping_Up_Appearances) > > > -- > https://mail.python.org/mailman/listinfo/python-list > -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Having both if() and for() statements in one liner

2013-09-17 Thread Joel Goldstick
be so annoying. > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list > You can get them all over the Mediterranean as well! I think they are like air -- -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: How do I calculate a mean with python?

2013-09-17 Thread Joel Goldstick
) > amount = len(List) > themean = thesum / amount > return themean > > def mode(): > max_occurrences = 0 > themode = None > for i in List: > thecount = List.count(i) > if thecount > max_occurrences: > max_occurrences = thecount > themode = i > return themode > > > > #-# ~~The functions which need calling~~ > #-# > > # | > #| > # \/ > > NOS() > So, I just added a few criticisms earlier above. To sumarize: avoid global variables, document functions with docstrings, use really clear names for variables including function names. If you have code in two functions that is almost identical, figure out how to make them one function good luck > -- > https://mail.python.org/mailman/listinfo/python-list > -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: How do I calculate a mean with python?

2013-09-17 Thread Joel Goldstick
On Tue, Sep 17, 2013 at 5:31 PM, William Bryant wrote: > Thanks to all and @Joel Goldstick, I am learning python through youtube. > They explained Global and Local variables to me. :) Thanks for that > critisism, it really helps. I am 13 years old and I am looking forward to

Re: Antispam measures circumventing

2013-09-20 Thread Joel Goldstick
wrote some code that required the user to add some numbers before the form was submitted. Here is the article: http://www.joelgoldstick.com/blog/2012/sep/30/django-forms/ This isn't exactly what you are asking, but it does give you a change to let someone send you mail without giving out your email address. With the onslaught of social media stuff, it feels like sites like linked in and anything that uses gmail want to get you to give away your email address, and perhaps give access to everyone in your lists. So, I'm suggesting its really a loosing battle. -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: How to send an anonymous mail via Python script

2013-09-21 Thread Joel Goldstick
u can build up a record of trust ("Every > message I've ever seen from foo.example.com (IP address 203.0.113.54 > as per its SPF record) has been accepted by my users as legitimate, so > I'm going to assume that this one, from the same domain and IP, is > legit"). It's not even all that hard to do - just deploy one of the > well-known mail servers like exim or Postfix, set up an SPF record > (not actually necessary, but it's so easy and can help so much that I > think everyone should do it), and let the rest take care of itself. > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list > -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Directory Web Site

2013-09-22 Thread Joel Goldstick
vide more information for any useful help here -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: What's the best way to extract 2 values from a CSV file from each row systematically?

2013-09-23 Thread Joel Goldstick
; > > > -- > https://mail.python.org/mailman/listinfo/python-list > You should check out the csv module here: http://docs.python.org/2/library/csv.html#module-csv It will read your csv file into a list (the file rows) of lists (the columns). You can easily loop over the data to extract the col

Re: Download all youtube favorites with youtube-dl script

2013-09-26 Thread Joel Goldstick
st> > Have you looked at the youtube API? That would be better than screen scraping. https://developers.google.com/youtube/getting_started -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: How to write in to already opened excel file by using openpyxl

2013-09-27 Thread Joel Goldstick
ython-list > You need to read the documentation: http://openpyxl.readthedocs.org/en/latest/tutorial.html#saving-to-a-file The code you show doesn't have any save method being called. -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Handling 3 operands in an expression without raising an exception

2013-09-27 Thread Joel Goldstick
listinfo/python-list > Better yet, don't write the program. Zero lines of code, and every line works perfectly. It runs extremely fast too! ... or Nikos the annoyance, write it in apl -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Hostrange expansion

2013-09-27 Thread Joel Goldstick
be written in maybe 20 lines or so. > > Thanks > > -- > https://mail.python.org/mailman/listinfo/python-list > > -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Handling 3 operands in an expression without raising an exception

2013-09-27 Thread Joel Goldstick
; > -- > Grant Edwards grant.b.edwardsYow! ... he dominates > the > at DECADENT SUBWAY SCENE. > gmail.com > -- > https://mail.python.org/mailman/listinfo/python-list > better yet: i=l=0 The names have even less meaning, and they are thin -- less space -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Aide pour bien démarrer en Python

2013-09-27 Thread Joel Goldstick
ut python, python people view as the best parts of the language. But, if you need to use python you can start with python.org. There are many links to documentation suitable for different skill levels. Some of it is available in French: https://wiki.python.org/moin/FrenchLanguage good luck to you -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Neurolab // "No module named .."

2013-09-28 Thread Joel Goldstick
t; am I missing? > Thanks. > -- > https://mail.python.org/mailman/listinfo/python-list > How exactly did you install python? And how did you install neurolab? Also, its best to actually cut and paste the traceback rather than paraphrase it. Since you don't know what is wrong,

Re: Handling 3 operands in an expression without raising an exception

2013-09-28 Thread Joel Goldstick
ss thread where is was pointed out that you can't really be sure where someone is reading from. Next we'll get more questions about how to screw up unicode, and how to write code that deals with apache and linux shell with the caveat that the OP has no interesting in learning how those things work. He just wants the one line. Troll is maybe too respectable a label to put on this guy. -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Which Python Framework for REST API and Facebook Wrapper?

2013-09-28 Thread Joel Goldstick
n.org/mailman/listinfo/python-list > While there several others with smaller footprint, django is probably the elephant in the room -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Help me with Python please (picture)

2013-09-28 Thread Joel Goldstick
+ on the calling out of using images to post code. I'm guessing the OP is a computer user in the sense of running word, or watching you-tube videos, etc. Most non-programmers never used a plain text editor. If you want to learn how to write code, and you are a beginner, use the simplest text editor on your computer, learn to open a shell and run python interactively and run programs that you saved with your text editors. Be glad for simplicity. And happy you don't write code on these: http://en.wikipedia.org/wiki/Hollerith_cards -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Handling 3 operands in an expression without raising an exception

2013-09-28 Thread Joel Goldstick
metrites.py > show the world the passwords to your databases in plain text. He said he was working on it! Maybe as soon as that one liner gets revealed. -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Handling 3 operands in an expression without raising an exception

2013-09-29 Thread Joel Goldstick
so, I wonder how long he lasted before he was let go. And I feel bad for the guy who had to support his code! -- Joel Goldstick http://joelgoldstick.com -- https://mail.python.org/mailman/listinfo/python-list

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-09-29 Thread Joel Goldstick
asked and answered. Move on -- https://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   >