Re: Default scope of variables

2013-07-07 Thread Chris Angelico
On Mon, Jul 8, 2013 at 2:03 AM, Steven D'Aprano wrote: > If you need more than two levels, you probably ought to re-design your > code to be less confusing, otherwise you may be able to use ChainMap to > emulate any number of nested scopes. The subtransactions are primarily to represent the datab

Re: Default scope of variables

2013-07-07 Thread Chris Angelico
On Mon, Jul 8, 2013 at 2:52 AM, Ethan Furman wrote: > On 07/07/2013 06:43 AM, Chris Angelico wrote: >> >> On Sun, Jul 7, 2013 at 11:13 PM, Wayne Werner >> wrote: >>> >>> Which you would then use like: >>> >>> >&g

Re: hex dump w/ or w/out utf-8 chars

2013-07-07 Thread Chris Angelico
On Mon, Jul 8, 2013 at 10:22 AM, blatt wrote: > Hi all, > but a particular hello to Chris Angelino which with their critics and > suggestions pushed me to make a full revision of my application on > hex dump in presence of utf-8 chars. Hiya! Glad to have been of assistance :) &g

Re: Default scope of variables

2013-07-07 Thread Chris Angelico
On Mon, Jul 8, 2013 at 12:23 PM, Steven D'Aprano wrote: > On Mon, 08 Jul 2013 10:48:03 +1000, Chris Angelico wrote: > [...] >> That means that I, as programmer, have to keep track of the nesting >> level of subtransactions. Extremely ugly. A line of code can't be m

Re: Default scope of variables

2013-07-07 Thread Chris Angelico
On Mon, Jul 8, 2013 at 3:00 PM, Steven D'Aprano wrote: > On Mon, 08 Jul 2013 13:11:37 +1000, Chris Angelico wrote: >> It's not something to be solved by the language, but it's often >> something to be solved by the program's design. Two lines of code that >&

Re: UnpicklingError: NEWOBJ class argument isn't a type object

2013-07-07 Thread Chris Angelico
On Mon, Jul 8, 2013 at 3:27 PM, skunkwerk wrote: > I'm using a custom pickler that replaces any un-pickleable objects (such as > sockets or files) with a string representation of them... > > If it pickles okay, why should it not be able to unpickle? Any ideas? Generally, the reason something

Re: Geo Location extracted from visitors ip address

2013-07-08 Thread Chris Angelico
On Sat, Jul 6, 2013 at 7:18 AM, Dave Angel wrote: > On 07/05/2013 04:44 PM, Tim Roberts wrote: >> >> ? Gr33k wrote: >>> >>> >>> Is there a way to extract out of some environmental variable the Geo >>> location of the user being the city the user visits out website from? >>> >>> Perhaps by uti

Re: hex dump w/ or w/out utf-8 chars

2013-07-08 Thread Chris Angelico
On Tue, Jul 9, 2013 at 3:31 AM, wrote: > Unfortunately (as probably I told you before) I will never pass to > Python 3... Guido should not always listen only to gurus like him... > I don't like Python as before...starting from OOP and ending with codecs > like utf-8. Regarding OOP, much apprecia

Re: hex dump w/ or w/out utf-8 chars

2013-07-08 Thread Chris Angelico
On Tue, Jul 9, 2013 at 3:53 AM, wrote: >>> All characters are UTF-8, characters. "a" is a UTF-8 character. So is "ă". > Not using python 3, for me (a programmer which was present at the beginning of > computer science, badly interacting with many languages from assembler to > Fortran and from c t

Re: hex dump w/ or w/out utf-8 chars

2013-07-08 Thread Chris Angelico
On Tue, Jul 9, 2013 at 6:56 AM, Dave Angel wrote: > But Unicode has nothing to do with Guido, and it has existed for about 25 > years (if I recall correctly). Depends how you measure. According to [1], the work kinda began back then (25 years ago being 1988), but it wasn't till 1991/92 that the s

Re: hex dump w/ or w/out utf-8 chars

2013-07-08 Thread Chris Angelico
On Tue, Jul 9, 2013 at 8:45 AM, Dave Angel wrote: > On 07/08/2013 05:49 PM, Chris Angelico wrote: >> >> On Tue, Jul 9, 2013 at 6:56 AM, Dave Angel wrote: >>> >>> But Unicode has nothing to do with Guido, and it has existed for about 25 >>> years (if I r

Re: the general development using Python

2013-07-08 Thread Chris Angelico
On Tue, Jul 9, 2013 at 11:45 AM, wrote: > I have to get back into writing Python but I'm lacking one thing ... a > general understanding of how to write applications that can be deployed > (either in .exe format or in other formats). That's one last thing you need to un-learn, then :) You dis

Re: looking for a new router

2013-07-08 Thread Chris Angelico
On Tue, Jul 9, 2013 at 2:52 PM, saadharana wrote: > Hey i'm looking for a new router. I have no set budget. Only US stores. I > have cable internet and few laptops connected to it so it needs to have a > strong wireless internet signal. Also i do gaming as well on wireless > internet and download

Re: Default scope of variables

2013-07-08 Thread Chris Angelico
On Tue, Jul 9, 2013 at 2:52 PM, alex23 wrote: > with new_transaction(conn) as folder_tran: > folder_tran.query("blah") > with folder_tran.subtransaction() as file_tran: > file_tran.query("blah") > with file_tran.subtransaction() as type_tran: > type_tran.query("

Re: the general development using Python

2013-07-08 Thread Chris Angelico
On Tue, Jul 9, 2013 at 2:46 PM, CM wrote: >> Target the three most popular desktop platforms all at once, no >> Linux/Windows/Mac OS versioning. > > Ehhh... There are differences, in, e.g., wxPython between the three > platforms, and you can either do different versions or, more aptly, just fix

Re: looking for a new router

2013-07-08 Thread Chris Angelico
On Tue, Jul 9, 2013 at 3:27 PM, Dotan Cohen wrote: > On Tue, Jul 9, 2013 at 7:57 AM, Chris Angelico wrote: >> I recommend you go to a small local store that has friendly people and >> real service, tell them what you're needing, and support local >> business with yo

Re: Default scope of variables

2013-07-08 Thread Chris Angelico
On Tue, Jul 9, 2013 at 4:08 PM, alex23 wrote: > On 9/07/2013 3:07 PM, Chris Angelico wrote: >> >> The subtransactions are NOT concepted as separate transactions. They >> are effectively the database equivalent of a try/except block. > > > Sorry, I assumed each neste

Re: looking for a new router

2013-07-09 Thread Chris Angelico
On Tue, Jul 9, 2013 at 4:49 PM, Steven D'Aprano wrote: > On Mon, 08 Jul 2013 21:52:19 -0700, saadharana wrote: > >> Hey i'm looking for a new router. > > I recommend this one: > > http://www.bunnings.com.au/products_product_1350w-aeg-12-router-rt1350e_P6230066.aspx > > > Helpfully-as-ever-ly yrs,

Re: RAM slots problem

2013-07-09 Thread Chris Angelico
On Tue, Jul 9, 2013 at 4:59 PM, Gary Herron wrote: > On 07/08/2013 10:06 PM, saadharana wrote: >> >> I've got some annoying problem with RAM. I was depth cleaning my case, >> everything regular, it wasn't my first time. And when I put it all >> together >> and powered it on, it wasn't working, jus

Re: Default scope of variables

2013-07-09 Thread Chris Angelico
On Tue, Jul 9, 2013 at 5:35 PM, Frank Millman wrote: > I have been following this sub-thread with interest, as it resonates with > what I am doing in my project. Just FYI, none of my own code will help you as it's all using libpqxx, but the docs for the library itself are around if you want them

Re: crack a router passcode

2013-07-09 Thread Chris Angelico
On Tue, Jul 9, 2013 at 11:23 PM, Ferrous Cranus wrote: > Could python somehow brute force http://192.168.1.1/login.php giving user > and pass trying to guess the password? > > Could it be able to pass values to the input boxes of router's web login > interface? It certainly could. It's just simpl

Re: the general development using Python

2013-07-09 Thread Chris Angelico
On Tue, Jul 9, 2013 at 6:41 PM, Ian Kelly wrote: > On Mon, Jul 8, 2013 at 10:46 PM, CM wrote: >>> There are projects that "bundle" the CPython interpreter with your >>> project, but this makes those files really big. >> >> Maybe 5-20 MB. That's a lot bigger than a few hundred K, but it's not tha

Re: the general development using Python

2013-07-09 Thread Chris Angelico
On Wed, Jul 10, 2013 at 12:16 PM, CM wrote: > On Tuesday, July 9, 2013 8:14:44 PM UTC-4, Joshua Landau wrote: >> Yeah, but not for Python :P. For Python .exe files are a rarity and >> should be kept that way. > > That there is a significant interest in creating exe files suggest that not > everyo

Re: crack a router passcode

2013-07-10 Thread Chris Angelico
On Wed, Jul 10, 2013 at 6:59 AM, Dave Angel wrote: > On 07/09/2013 12:06 PM, Ferrous Cranus wrote: > > > >>> >> What is the reason of a spambot? Spam a usenet forum to gain what? >> > > Spam is unsolicited advertising. A bot is a robot, or other automated > device. So Spambots on a usenet

Re: Stack Overflow moderator “animuson”

2013-07-10 Thread Chris Angelico
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 be

Re: Stack Overflow moderator “animuson”

2013-07-10 Thread Chris Angelico
On Wed, Jul 10, 2013 at 6:32 PM, Mats Peterson wrote: > Chris Angelico wrote: >> 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 r

Re: Stack Overflow moderator “animuson”

2013-07-10 Thread Chris Angelico
On Wed, Jul 10, 2013 at 6:33 PM, Mats Peterson wrote: > Steven D'Aprano wrote: >> On Wed, 10 Jul 2013 18:26:19 +1000, Chris Angelico wrote: >> >>> On Wed, Jul 10, 2013 at 5:55 PM, Mats Peterson wrote: >>>> A moderator who calls himself “animuson” on Sta

Re: Stack Overflow moderator “animuson”

2013-07-10 Thread Chris Angelico
On Wed, Jul 10, 2013 at 6:42 PM, Mats Peterson wrote: > Chris Angelico wrote: >> 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 r

Re: Stack Overflow moderator “animuson”

2013-07-10 Thread Chris Angelico
On Wed, Jul 10, 2013 at 7:01 PM, Mats Peterson wrote: > Chris Angelico wrote: >> I know what regular expressions are. I've used them in Perl, PHP, >> JavaScript, Python, C++, Pike, and numerous text editors (which may >> have been backed by one of the above l

Re: Stack Overflow moderator “animuson”

2013-07-10 Thread Chris Angelico
On Wed, Jul 10, 2013 at 6:50 PM, Mats Peterson wrote: > Have you ever compared the regular expression performance between Perl > and Python? If not, keep quiet. I think I can see why you were suspended. You and jmf should have a lot of fun together, I think. ChrisA -- http://mail.python.org/ma

Re: Stack Overflow moderator “animuson”

2013-07-10 Thread Chris Angelico
On Wed, Jul 10, 2013 at 10:13 PM, Mats Peterson wrote: > Steven D'Aprano wrote: >> On Wed, 10 Jul 2013 07:55:05 +, 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 >>> reg

Prime number generator

2013-07-10 Thread Chris Angelico
And now for something completely different. I knocked together a prime number generator, just for the fun of it, that works like a Sieve of Eratosthenes but unbounded. It keeps track of all known primes and the "next composite" that it will produce - for instance, after yielding 13, the prime map

Re: Prime number generator

2013-07-10 Thread Chris Angelico
On Thu, Jul 11, 2013 at 12:35 AM, Bas wrote: > On Wednesday, July 10, 2013 4:00:59 PM UTC+2, Chris Angelico wrote: > [...] >> So, a few questions. Firstly, is there a stdlib way to find the key >> with the lowest corresponding value? In the above map, it would return >&

Re: Prime number generator

2013-07-10 Thread Chris Angelico
On Thu, Jul 11, 2013 at 1:43 AM, Joshua Landau wrote: >> So, a few questions. Firstly, is there... > Of course there is. > >> Secondly, can the... > Of course it can. > >> Thirdly, is there... > Of course there is. I have no clue what, though. Heh, I guess I was asking for that kind of response :

Re: Prime number generator

2013-07-10 Thread Chris Angelico
On Thu, Jul 11, 2013 at 1:47 AM, bas wrote: > On Wednesday, July 10, 2013 5:12:19 PM UTC+2, Chris Angelico wrote: >> Well, that does answer the question. Unfortunately the use of lambda >> there has a severe performance cost [ ...] > If you care about speed, you might want

Re: Prime number generator

2013-07-10 Thread Chris Angelico
On Thu, Jul 11, 2013 at 2:01 AM, Steven D'Aprano wrote: > On Thu, 11 Jul 2013 00:00:59 +1000, Chris Angelico wrote: >> Thirdly, is there any sort of half-sane benchmark that I >> can compare this code to? And finally, whose wheel did I reinvent here? >> What name would

Re: Prime number generator

2013-07-10 Thread Chris Angelico
On Thu, Jul 11, 2013 at 2:54 AM, Ian Kelly wrote: > As promised. Apologies for the excessive commenting. As noted, this > implementation is a recursive generator, which is done so that the > primes in the sieve can go only up to the square root of the current > prime, rather than tossing in ever

Re: python for loop

2013-07-10 Thread Chris Nash
The first item in a sequence is at index zero because it is that far away from the beginning. The second item is one away from the beginning. That is the reason for zero-based indexing. -- http://mail.python.org/mailman/listinfo/python-list

Re: Documenting builtin methods

2013-07-11 Thread Chris Angelico
On Thu, Jul 11, 2013 at 4:06 PM, Steven D'Aprano wrote: > I think the right solution here is the trivial: > > def exhaust(it): > """Doc string here.""" > deque(maxlen=0).extend(it) > > > which will be fast enough for all but the tightest inner loops. But if > you really care about optimizi

Re: Documenting builtin methods

2013-07-11 Thread Chris Angelico
On Thu, Jul 11, 2013 at 5:15 PM, Steven D'Aprano wrote: > On Thu, 11 Jul 2013 17:06:39 +1000, Chris Angelico wrote: > >> On Thu, Jul 11, 2013 at 4:06 PM, Steven D'Aprano >> wrote: >>> I think the right solution here is the trivial: >>> &

Re: How to clean up socket connection to printer

2013-07-11 Thread Chris Angelico
On Thu, Jul 11, 2013 at 7:28 PM, loial wrote: > Replies to questions : > > 1. Does the printer accept connections again after some time? > > Yes, bit seems to vary how long that takes > > 2. Does the printer accept connections if you close and re-open the > Python interpreter? > > Not after a Conn

Re: hex dump w/ or w/out utf-8 chars

2013-07-11 Thread Chris Angelico
On Thu, Jul 11, 2013 at 11:18 PM, wrote: > Just to stick with this funny character ẞ, a ucs-2 char > in the Flexible String Representation nomenclature. > > It seems to me that, when one needs more than ten bytes > to encode it, > sys.getsizeof('a') > 26 sys.getsizeof('ẞ') > 40 > > this

Re: Editor Ergonomics [was: Important features for editors]

2013-07-11 Thread Chris Angelico
On Fri, Jul 12, 2013 at 1:42 AM, Paul Rudin wrote: > Text selection with a mouse is a different thing. Sometimes it's > more convenient, sometimes it's not. As screens get larger and the amount of text on them increases, it's likely to get more and more useful to use a mouse... but personally, I

Re: Editor Ergonomics [was: Important features for editors]

2013-07-11 Thread Chris Angelico
On Fri, Jul 12, 2013 at 12:39 PM, Steven D'Aprano wrote: > Big deal. I am utterly unconvinced that raw typing speed is even close to > a bottleneck when programming. Data entry and transcribing from (say) > dictated text, yes. Coding, not unless you are a one-fingered hunt-and- > peek typist. The

Re: Editor Ergonomics [was: Important features for editors]

2013-07-11 Thread Chris Angelico
On Fri, Jul 12, 2013 at 2:24 PM, Steven D'Aprano wrote: > On Fri, 12 Jul 2013 01:50:17 +1000, Chris Angelico wrote: > >> On Fri, Jul 12, 2013 at 1:42 AM, Paul Rudin >> wrote: >>> Text selection with a mouse is a different thing. Sometimes it's more >>

Re: How do I get the OS System Font Directory(Cross-Platform) in python?

2013-07-11 Thread Chris Angelico
On Fri, Jul 12, 2013 at 2:24 PM, Metallicow wrote: > On Thursday, July 11, 2013 8:27:04 PM UTC-5, Christian Heimes wrote: >> Am 11.07.2013 19:19, schrieb Metallicow: >> >> > @ Chris �Kwpolska� Warrick >> >> > Thanks, that is a start anyway. >>

Re: hex dump w/ or w/out utf-8 chars

2013-07-12 Thread Chris Angelico
On Fri, Jul 12, 2013 at 4:42 AM, wrote: > BTW, since > when a serious coding scheme need an extermal marker? > All of them. Content-type: text/plain; charset=UTF-8 ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: RE Module Performance

2013-07-12 Thread Chris Angelico
On Fri, Jul 12, 2013 at 9:44 AM, Devyn Collier Johnson wrote: > I recently saw an email in this mailing list about the RE module being made > slower. I no long have that email. However, I have viewed the source for the > RE module, but I did not see any code that would slow down the script for no

Re: Question about mailing list rules

2013-07-12 Thread Chris Angelico
On Fri, Jul 12, 2013 at 9:59 AM, Devyn Collier Johnson wrote: > Am I allowed to ask questions like "Here is my code. How can I optimize it?" > on this mailing list? Sure you can! And you'll get a large number of responses, not all of which are directly to do with your question. :) I assume the c

Re: RE Module Performance

2013-07-12 Thread Chris Angelico
On Fri, Jul 12, 2013 at 7:23 PM, wrote: > > I would not care too much about the performance > of re. > > With the new Flexible String Representation, you > can use a logarithmic scale to compare re results. > To be honest, there is improvment if you are an > ascii user. > > Am I the only one who

Re: RE Module Performance

2013-07-12 Thread Chris Angelico
On Fri, Jul 12, 2013 at 7:39 PM, Joshua Landau wrote: > On 12 July 2013 10:27, Chris Angelico wrote: >> On Fri, Jul 12, 2013 at 7:23 PM, wrote: >>> >>> I would not care too much about the performance >>> of re. >>> >>> With the new Flexibl

Re: Question about mailing list rules

2013-07-12 Thread Chris Angelico
On Fri, Jul 12, 2013 at 8:44 PM, Devyn Collier Johnson wrote: > I am going to love this mailing list even more. > > Really, only Python code? I wanted to ask Python users about Perl! (^u^) > > Devyn Collier Johnson Heh. You'd be surprised what comes up. If it's at least broadly related to Python

Re: Understanding other people's code

2013-07-12 Thread Chris Angelico
On Sat, Jul 13, 2013 at 12:22 AM, L O'Shea wrote: > I'm starting to get pretty worried about my lack of overall progress and so I > wondered if anyone out there had some tips and techniques for understanding > other peoples code. There has to be 10/15 different scripts with at least 10 > functi

Re: [Python-ideas] float('∞')=float('inf')

2013-07-12 Thread Chris Angelico
On Sat, Jul 13, 2013 at 12:43 AM, Gerald Britton wrote: > Man I don't know how you are doing this! I just tried: > > float('') and got > > Value error: could not convert string to float '' > > For that matter, I can't figure out how to type the greek letter for > pi in gmail! Guess I have some t

Re: [Python-ideas] float('∞')=float('inf')

2013-07-12 Thread Chris Angelico
On Sat, Jul 13, 2013 at 12:52 AM, Chris Angelico wrote: > On Sat, Jul 13, 2013 at 12:43 AM, Gerald Britton > wrote: >> Man I don't know how you are doing this! I just tried: >> >> float('') and got >> >> Value error: could not convert string to

Re: RE Module Performance

2013-07-12 Thread Chris Angelico
On Fri, Jul 12, 2013 at 8:45 PM, Devyn Collier Johnson wrote: > Could you explain what you mean? What and where is the new Flexible String > Representation? (You're top-posting again. Please put your text underneath what you're responding to - it helps maintain flow and structure.) Python versio

Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread Chris Angelico
On Sat, Jul 13, 2013 at 1:32 AM, Dave Angel wrote: >> >> There is definately i way to identify the users location based solely on >> its ip address as this site does it: http://www.geoiptool.com/ >> > > Sure, and as long as you don't mind it being 1000 miles off, you too can > claim to do it too.

Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread Chris Angelico
On Sat, Jul 13, 2013 at 2:38 AM, Grant Edwards wrote: > On 2013-07-12, ?? wrote: >> When visiting http://www.geoiptool.com/en/__ip_info/ it pinpoints my >> _exact_ city of living, not the ISP's. It did not even ask me to >> allow a geop ip javascript to run it present sit instantly. >

Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread Chris Angelico
On Sat, Jul 13, 2013 at 9:04 AM, Dennis Lee Bieber wrote: > On Sat, 13 Jul 2013 02:47:38 +1000, Chris Angelico > declaimed the following: > >> >>Oh, and just for laughs, I tried a few of my recent mobile IP >>addresses in the GeoIP lookup. All of them quoted Melbour

Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread Chris Angelico
On Sat, Jul 13, 2013 at 3:48 PM, Νικόλας wrote: > Στις 13/7/2013 2:04 πμ, ο/η Dennis Lee Bieber έγραψε: >> >> On Sat, 13 Jul 2013 02:47:38 +1000, Chris Angelico >> declaimed the following: >> >>> >>> Oh, and just for laughs, I tried a few of my recen

Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread Chris Angelico
On Sat, Jul 13, 2013 at 4:07 PM, Νικόλας wrote: > But it works for me, How can it be impossible and worked for me at the same > time? If I roll ten six-sided dice, will they total 35? Maybe. Maybe they'll be close. But it's impossible to come up with a table for rolling those dice on that will gu

Re: hex dump w/ or w/out utf-8 chars

2013-07-13 Thread Chris Angelico
On Sat, Jul 13, 2013 at 5:56 PM, wrote: > Try to write an editor, a text widget, with with a coding > scheme like the Flexible String Represenation. You will > quickly notice, it is impossible (understand correctly). > (You do not need a computer, just a sheet of paper and a pencil) > Hint: what

Re: hex dump w/ or w/out utf-8 chars

2013-07-13 Thread Chris Angelico
On Sat, Jul 13, 2013 at 7:49 PM, Steven D'Aprano wrote: > Ironically, Python has done the same thing for integers for many versions > too. They just didn't call it "Flexible Integer Representation", but > that's what it is. For integers smaller than 2**31, they are stored as C > longs (plus object

Re: GeoIP2 for retrieving city and region ?

2013-07-13 Thread Chris Angelico
On Sun, Jul 14, 2013 at 2:54 AM, Dennis Lee Bieber wrote: > Are you paying for a fixed IP number? I suspect you are if you were > running a world-accessible server. > > Obviously a fixed IP will be tied to a fixed connection and thereby to > a fixed location which can be provided t

Re: GeoIP2 for retrieving city and region ?

2013-07-13 Thread Chris Angelico
On Sun, Jul 14, 2013 at 4:28 AM, Νικόλας wrote: > So it seems that all boil down to the way the ISP configure its blocks of ip > addresses per city. > > All should do the same and then it would be an easy task to accurately > identify a visitor by its ip address. So every ISP in the world needs t

Re: How to read Mozrepl Javascript result into a Python Variable?

2013-07-13 Thread Chris Angelico
On Sun, Jul 14, 2013 at 6:49 AM, goldtech wrote: > Hi, > > With Mozrepl addon in Firefox and Python I do: > import telnetlib tn = telnetlib.Telnet(r'127.0.0.1', 4242, 5) tn.read_eager() > '\nWelcome to MozRepl.\n\n - If you get stuck at the "' tn.read_until("repl> ") > ...snip.

Re: [Python-ideas] float('∞')=float('inf')

2013-07-13 Thread Chris Angelico
On Sun, Jul 14, 2013 at 11:39 AM, Joshua Landau wrote: > On 14 July 2013 02:24, Steven D'Aprano wrote: >> and on-going costs: >> >> - that's one more thing for every user to learn; > > Doesn't apply here. Yes, it does; what happens to someone who reads someone else's Python code? To write code,

Re: [Python-ideas] float('∞')=float('inf')

2013-07-13 Thread Chris Angelico
On Sun, Jul 14, 2013 at 11:53 AM, Chris Angelico wrote: > On Sun, Jul 14, 2013 at 11:39 AM, Joshua Landau wrote: >> On 14 July 2013 02:24, Steven D'Aprano wrote: >>> and on-going costs: >>> >>> - that's one more thing for every user to learn; &g

Re: [Python-ideas] float('∞')=float('inf')

2013-07-13 Thread Chris Angelico
On Sun, Jul 14, 2013 at 1:04 PM, Steven D'Aprano wrote: > On Sun, 14 Jul 2013 11:53:55 +1000, Chris Angelico wrote: > >> Doh, I forgot which channel this was on again :( It feels like a >> python-list thread. > > > Can't you just hit Reply-List or even Reply

Re: GeoIP2 for retrieving city and region ?

2013-07-13 Thread Chris Angelico
On Sun, Jul 14, 2013 at 3:18 PM, Νικόλας wrote: > Can we get the location serived from lat/long coordinates? Yes, assuming you get accurate latitude and longitude, so you're back to square 1. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-ideas] float('∞')=float('inf')

2013-07-14 Thread Chris Angelico
On Sun, Jul 14, 2013 at 8:23 PM, Serhiy Storchaka wrote: > 14.07.13 06:09, Chris Angelico написав(ла): > >> Incidents like this are a definite push, but my D&D campaign is >> demanding my attention right now, so I haven't made the move. > > > Are you role-

Timing of string membership (was Re: hex dump w/ or w/out utf-8 chars)

2013-07-14 Thread Chris Angelico
On Sun, Jul 14, 2013 at 11:44 PM, wrote: > Le dimanche 14 juillet 2013 12:44:12 UTC+2, Steven D'Aprano a écrit : >> On Sun, 14 Jul 2013 01:20:33 -0700, wxjmfauth wrote: >> >> >> >> > For a very simple reason, the latin-1 block: considered and accepted >> >> > today as beeing a Unicode design mist

Re: List comp help

2013-07-14 Thread Chris Angelico
On Mon, Jul 15, 2013 at 3:10 AM, Joseph L. Casale wrote: > I have a dict of lists. I need to create a list of 2 tuples, where each tuple > is a key from > the dict with one of the keys list items. > > my_dict = { > 'key_a': ['val_a', 'val_b'], > 'key_b': ['val_c'], > 'key_c': [] > } >

Re: Timing of string membership (was Re: hex dump w/ or w/out utf-8 chars)

2013-07-14 Thread Chris Angelico
On Mon, Jul 15, 2013 at 2:18 PM, Terry Reedy wrote: > On 7/14/2013 10:56 AM, Chris Angelico wrote: > As issue about finding stings in strings was opened last September and, as > reported on this list, fixes were applied about last March. As I remember, > some but not all of the optimi

Re: Python - remote object protocols and security

2013-07-15 Thread Chris Angelico
On Mon, Jul 15, 2013 at 8:13 PM, Jean-Michel Pichavant wrote: > I'd like to exchange some simple python objects over the internet. > I initially planned to use Pyro, after reading > http://pythonhosted.org/Pyro4/security.html I'm still puzzled. > > I don't mind encrypting data, if someone wants to

Re: Python - remote object protocols and security

2013-07-15 Thread Chris Angelico
On Mon, Jul 15, 2013 at 10:26 PM, Jean-Michel Pichavant wrote: > Basically, I need to transfer numbers (int). Possibly dictionaries like > {string: int} in order to structure things a little bit. I strongly recommend JSON, then. It's a well-known system, it's compact, it's secure, and Python com

Re: Python - remote object protocols and security

2013-07-15 Thread Chris Angelico
On Mon, Jul 15, 2013 at 10:41 PM, Jean-Michel Pichavant wrote: > - Original Message - >> > What I think I need to care about, is malicious code injections. >> > Because >> > both client/server will be in python, would someone capable of >> > executing >> > code by changing one side python

Re: Python - remote object protocols and security

2013-07-15 Thread Chris Angelico
On Mon, Jul 15, 2013 at 10:45 PM, Dave Angel wrote: > On 07/15/2013 08:30 AM, Chris Angelico wrote: >> >> On Mon, Jul 15, 2013 at 10:26 PM, Jean-Michel Pichavant >> wrote: >>> >>> Basically, I need to transfer numbers (int). Possibly dictionaries like

Re: Python - remote object protocols and security

2013-07-15 Thread Chris Angelico
On Tue, Jul 16, 2013 at 1:42 AM, Burak Arslan wrote: > On 07/15/13 13:57, Chris Angelico wrote: >> But what I meant was that the [Json] protocol itself is designed with >> security restrictions in mind. It's designed not to fetch additional >> content from the network

Re: Is this a bug?

2013-07-15 Thread Chris Angelico
On Tue, Jul 16, 2013 at 1:50 AM, Jack Bates wrote: > Hello, > > Is the following code supposed to be an UnboundLocalError? > Currently it assigns the value 'bar' to the attribute baz.foo > >foo = 'bar' >class baz: > foo = foo > -- > http://mail.python.org/mailman/listinfo/python-list

Re: Python - remote object protocols and security

2013-07-15 Thread Chris Angelico
On Tue, Jul 16, 2013 at 2:31 AM, Burak Arslan wrote: > On 07/15/13 16:53, Chris Angelico wrote: >> I haven't looked into the details, but there was one among a list of >> exploits that was being discussed a few months ago; it involved XML >> schemas, I think, and quite

Re: Dihedral

2013-07-15 Thread Chris Angelico
On Tue, Jul 16, 2013 at 8:54 AM, Fábio Santos wrote: > >> On 07/15/2013 08:36 AM, Steven D'Aprano wrote: >>> >>> Devyn, >>> >>> 8 Dihedral is our resident bot, not a human being. Nobody knows who >>> controls it, and why they are running it, but we are pretty certain that >>> it is a bot respo

Re: Ideal way to separate GUI and logic?

2013-07-15 Thread Chris Angelico
On Tue, Jul 16, 2013 at 10:25 AM, wrote: > Again, thanks for all the responses. I'm curious, though, what exactly is the > rationale for making functions so small? (I've heard that the function > calling of Python has relatively high overhead?) A function should be as long as it needs to be -

Re: Bluetooth Sockets

2013-07-16 Thread Chris Angelico
On Tue, Jul 16, 2013 at 3:52 PM, Simfake Fake wrote: > Just bumping this, but has anybody have any personal experience with > bluetooth in python 3? Perhaps my issue is that the windows version doesn't > include it? I haven't worked with Bluetooth in Python, but my reading of the socket module do

Re: Floating point minimum and maximum exponent values

2013-07-16 Thread Chris Angelico
On Tue, Jul 16, 2013 at 9:43 PM, Marco wrote: > Hi all, why the maximum and minimum exp values are 1024 and -1021?: > sys.float_info > sys.float_info(max=1.7976931348623157e+308, max_exp=1024, max_10_exp=308, > min=2.2250738585072014e-308, min_exp=-1021, min_10_exp=-307, dig=15, > mant_dig=53

Re: Help with pygame

2013-07-16 Thread Chris Angelico
On Wed, Jul 17, 2013 at 3:29 AM, Daniel Kersgaard wrote: > def drawWalls(surface): > > #left and right walls > for y in range(HEIGHT): > surface.blit(wallblock, (0, y * BLOCK_SIZE)) > surface.blit(wallblock, (WIDTH * BLOCK_SIZE, y * BLOCK_SIZE)) > > for x in range(W

Re: Homework help requested (not what you think!)

2013-07-16 Thread Chris Angelico
On Wed, Jul 17, 2013 at 8:43 AM, John Ladasky wrote: > I think that they're disappointed when I show them how much they have to > understand just to write a program that plays Tic Tac Toe. The disillusionment of every novice programmer, I think. It starts out as "I want to learn programming and

Re: GeoIP2 for retrieving city and region ?

2013-07-16 Thread Chris Angelico
On Wed, Jul 17, 2013 at 10:51 AM, Dennis Lee Bieber wrote: > On Tue, 16 Jul 2013 22:43:35 +0300, ??? declaimed > the following: > >> >>Lest say i embed inside my index.html the Javascript Geo Code. >> >>Is there a way to pass Javascript's outcome to my Python cgi script somehow? >> >>Can Java

Re: Homework help requested (not what you think!)

2013-07-16 Thread Chris Angelico
On Wed, Jul 17, 2013 at 10:53 AM, Joel Goldstick wrote: > There is a book : http://inventwithpython.com/ Invent Your Own Computer > Games with Python > which claims to teach people to program games in python. I haven't read it, > but it seems to be for beginning programmers. Take a look.. Maybe

Re: Homework help requested (not what you think!)

2013-07-17 Thread Chris Angelico
On Wed, Jul 17, 2013 at 11:20 PM, Neil Cerutti wrote: > Markov chains are an advanced technique you could introduce, but > you'd need a huge list of names broken into syllables from > somewhere. You could use names broken into letters... or skip the notion of names and just generate words. Lists

Re: Homework help requested (not what you think!)

2013-07-17 Thread Chris Angelico
On Wed, Jul 17, 2013 at 11:55 PM, Neil Cerutti wrote: > On 2013-07-17, Chris Angelico wrote: >> On Wed, Jul 17, 2013 at 11:20 PM, Neil Cerutti wrote: >>> Markov chains are an advanced technique you could introduce, but >>> you'd need a huge list of names broken i

Re: Need help with network script

2013-07-17 Thread Chris Angelico
On Thu, Jul 18, 2013 at 11:44 AM, wrote: > Hi everyone. I am starting to learn python and I decided to start with what I > though was a simple script but I guess now. All I want to do is return what > current network location I am using on my mac. Every time I run it, it gives > me back a 0. I

Re: Need help with network script

2013-07-17 Thread Chris Angelico
On Thu, Jul 18, 2013 at 11:59 AM, wrote: > On Wednesday, July 17, 2013 7:50:44 PM UTC-6, Chris Angelico wrote: >> >> Copy and paste your actual code, don't re-type it :) > > This is as far as I have gotten. THis is all my code and it has been copied > and pasted. T

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-17 Thread Chris Angelico
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. A good thing to start with. Yes, it's been done before, many times... but if you think about it, it's th

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-17 Thread Chris Angelico
On Thu, Jul 18, 2013 at 4:11 PM, Aseem Bansal wrote: > @vikash agrawal > > About GUI I discussed it at > https://groups.google.com/forum/#!starred/comp.lang.python/M-Dy2pyWRfM and I > am thinking about using PySide 1.2 for clients of chat system. I think I'll > need downloadable clients if I wa

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-17 Thread Chris Angelico
On Thu, Jul 18, 2013 at 4:36 PM, Aseem Bansal wrote: > @Chris Angelico > > Thanks. That cleared many doubts and your suggestions would definitely be > useful. > > I am asking the next paragraph because you said about Python 3 helping with > things. I am not looking for a de

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-18 Thread Chris Angelico
On Thu, Jul 18, 2013 at 5:05 PM, Aseem Bansal wrote: > @Andrew Berg > @Chris Angelico > > Is there a way to have both Python 2 and 3 installed on my computer till I > can update the little codebase that I have built? Can I make different > commands for invoking python 2 and Py

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-18 Thread Chris Angelico
On Thu, Jul 18, 2013 at 5:29 PM, Aseem Bansal wrote: > @ChrisA > > Thanks. That's great. That solved the whole thing easily. I'll install Python > 3 and start updating today. > > About reading comp.lang.python can you suggest how to read it and reply? I > have never read a newsgroup leave alone

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-18 Thread Chris Angelico
On Thu, Jul 18, 2013 at 5:48 PM, Aseem Bansal wrote: > @ChrisA > > I subscribed to it. How do I reply to a message that has already been posted > before my subscription? Not easily, far as I know. But you now have this reply, and you can always just post something with the right subject line and

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-18 Thread Chris Angelico
On Thu, Jul 18, 2013 at 6:10 PM, Aseem Bansal wrote: > I tried replying to your message by mail. I used the reply button and send it > to "[email protected]"? Or do I need to use "[email protected]" as you > wrote in your post? You replied correctly. The ellipsis was presumably an anti-s

<    5   6   7   8   9   10   11   12   13   14   >