Re: Uniquely identifying each & every html template

2013-01-21 Thread Chris Angelico
On Tue, Jan 22, 2013 at 2:24 PM, rusi wrote: > Ive a computer whose OS I wanted to upgrade without disturbing the > existing setup. Decided to fit a new hard disk with a new OS. > Installed the OS on a new hard disk, fitted the new hard disk into the > old computer and rebooted. > > The messages t

Re: Using filepath method to identify an .html page

2013-01-22 Thread Chris Angelico
On Tue, Jan 22, 2013 at 10:53 PM, Ferrous Cranus wrote: > # == > # produce a hash based on html page's filepath and convert it to an integet, > that will be uses to identify the page itself. > # == > >

Re: Using filepath method to identify an .html page

2013-01-22 Thread Chris Angelico
On Tue, Jan 22, 2013 at 11:47 PM, Ferrous Cranus wrote: > What i want to do, is to associate a number to an html page's absolute path > for to be able to use that number for my database relations instead of the > BIG absolute path string. > > so to get an integer out of a string i would just hav

Re: handling return codes from CTYPES

2013-01-22 Thread Chris Angelico
On Tue, Jan 22, 2013 at 7:02 PM, Steve Simmons wrote: > Thanks also for the clarification on discarding objects and Garbage > Collection. Looks like I'll have to turn a large chunk of my previous > understanding of (mainframe) languages 'inside out'. > > I'm just wondering how often I'll have to

Re: Using filepath method to identify an .html page

2013-01-22 Thread Chris Angelico
On Wed, Jan 23, 2013 at 12:57 AM, Ferrous Cranus wrote: > Τη Τρίτη, 22 Ιανουαρίου 2013 3:04:41 μ.μ. UTC+2, ο χρήστης Steven D'Aprano > έγραψε: > >> What do you expect int("my-web-page.html") to return? Should it return 23 >> or 794 or 109432985462940911485 or 42? > > I expected a unique number fr

Re: Using filepath method to identify an .html page

2013-01-22 Thread Chris Angelico
On Wed, Jan 23, 2013 at 1:55 AM, Ferrous Cranus wrote: > I insist, perhaps compeleld, to use a key to associate a number to a filename. > Would you help please? > > I dont know this is supposed to be written. i just know i need this: > > number = function_that_returns_a_number_out_of_a_string( >

Re: Using filepath method to identify an .html page

2013-01-22 Thread Chris Angelico
On Wed, Jan 23, 2013 at 2:21 AM, Ferrous Cranus wrote: > Why the hell > > pin = int ( '/home/nikos/public_html/index.html' ) > > fails? because it has slashes in it? What do you expect it to return? 141592653589793? Go through the Python tutorial. Better yet, find a book that distinguishes betwe

Re: Else statement executing when it shouldnt

2013-01-22 Thread Chris Angelico
On Wed, Jan 23, 2013 at 2:39 AM, Thomas Boell wrote: > Huh?! I would have expected all your examples to raise a SyntaxError or > IndentationError. Why don't they? Is 'else' not required to have a > matching 'if'? Other things can have else, including 'for' and 'while' loops. :) ChrisA -- http:/

Re: Else statement executing when it shouldnt

2013-01-22 Thread Chris Angelico
On Wed, Jan 23, 2013 at 2:48 AM, Thomas Boell wrote: > On Wed, 23 Jan 2013 02:42:27 +1100 > Chris Angelico wrote: > >> On Wed, Jan 23, 2013 at 2:39 AM, Thomas Boell wrote: >> > Huh?! I would have expected all your examples to raise a SyntaxError or >> > Ind

Re: Using filepath method to identify an .html page

2013-01-22 Thread Chris Angelico
On Wed, Jan 23, 2013 at 2:59 AM, Ferrous Cranus wrote: > I just need a way to CONVERT a string(absolute path) to a 4-digit unique > number with INT!!! That's all i want!! But i cannot make it work :( Either you are deliberately trolling, or you have a major comprehension problem. Please go back

Re: Sending a broadcast message using raw sockets

2013-01-22 Thread Chris Angelico
On Wed, Jan 23, 2013 at 4:57 AM, Peter Steele wrote: > In fact, I have used scapy in the past, but I am working in a restricted > environment and don't have this package available. It provides tones more > than I really need anyway, and I figured a simple raw socket send/receive > can't be *tha

Re: Using filepath method to identify an .html page

2013-01-22 Thread Chris Angelico
On Wed, Jan 23, 2013 at 2:04 PM, rusi wrote: > Considering that you've fried the of all the poor "out- > of-my-control' double-posting GG users, what punishment shall we find > for you? > > Heres an idea: Use GG yourself. > It will help the group/mailing list by reducing 5-fold double-posting > t

Re: Failed to import a "pyd: File When python intepreter embed in C++ project

2013-01-22 Thread Chris Angelico
On Wed, Jan 23, 2013 at 1:43 PM, wrote: > I create a pyd File named "testPyd" with boostPython,and then I import the > testPyd module into "test.py", it works perfect! > But when I embeded the python interpreter into my C++ project and run the > "test.py", it comes out a "ImportErr: no module n

Re: Increase value in hash table

2013-01-22 Thread Chris Rebert
On Jan 22, 2013 11:31 PM, "moonhkt" wrote: > > Hi Al > > I have Data file have below > > Data file > V1 > V2 > V3 > V4 > V4 > V3 > > How to using count number of data ? > > Output > V1 = 1 > V2 = 1 > V3 =2 > V4 = 2 Construct a frequency table using collections.Counter: http://docs.python.org/2.7

Re: Arent these snippets equivalent?

2013-01-23 Thread Chris Angelico
On Thu, Jan 24, 2013 at 8:56 AM, Coolgg wrote: > Is this: > > while True: > data = fp.read(4096) > if not data: > break > ... > > not equivalent to this: > > data = fp.read (4096) > while data: > ...{handle the chunk here} > data = fp.read (4096) They should do the sam

Re: Arent these snippets equivalent?

2013-01-23 Thread Chris Angelico
On Thu, Jan 24, 2013 at 9:47 AM, Roy Smith wrote: > while getchar() as c: >putchar(c) > > That would give people (including me) the use case they're after most of > the time (call a function, assign the return value, and test it). It's > way less klunky than: > > while True: >c = getchar(

Re: Uniquely identifying each & every html template

2013-01-23 Thread Chris Angelico
On Wed, Jan 23, 2013 at 11:38 PM, Dave Angel wrote: > You think it's an accident that md5 size is roughly equivalent to 39 decimal > digits? Or that the ones that haven't been proven insecure are much larger > than that? The sha512 hash is roughly equivalent to 154 decimal digits. Proving a has

Re: urllib2 FTP Weirdness

2013-01-23 Thread Chris Angelico
On Thu, Jan 24, 2013 at 7:07 AM, Nick Cash wrote: > Python 2.7.3 on linux > > This has me fairly stumped. It looks like > urllib2.urlopen("ftp://some.ftp.site/path";).read() > will either immediately return '' or hang indefinitely. But > response = urllib2.urlopen("ftp://some.ftp.s

Re: Uniquely identifying each & every html template

2013-01-23 Thread Chris Angelico
On Thu, Jan 24, 2013 at 11:09 AM, Dave Angel wrote: > I certainly can't disagree that it's easy to produce a very long hash that > isn't at all secure. But I would disagree that longer hashes > *automatically* reduce chances of collision. Sure. But by and large, longer hashes give you a better c

Re: Decrease for loop by one

2013-01-23 Thread Chris Angelico
On Thu, Jan 24, 2013 at 3:39 PM, Milter Skyler wrote: > I made an array to check if the random integer already exists and then I send > it to the else statement at which point I want to decrease x by 1 so that it > doesn't count as one of the loops. In other languages this works... A Python 'fo

Re: Retrieving the full command line

2013-01-23 Thread Chris Angelico
On Thu, Jan 24, 2013 at 3:49 PM, Steven D'Aprano wrote: > Note however that there is an ambiguity between calling "python -mspam" > and calling a script literally named "-mspam". But that same ambiguity > exists in the shell, so I don't consider it a problem. You cannot call a > script named -mspa

Re: Python to send Midi commands to iPad via USB

2013-01-24 Thread Chris Angelico
On Thu, Jan 24, 2013 at 9:31 PM, wrote: > What I have to do is to write a Python application that will send MIDI > commands to an iPad application. > All I know is that the iPad application can be connected to an external Midi > deck through a usb cable and be controlled. > So I think I would c

Re: using split for a string : error

2013-01-24 Thread Chris Angelico
On Thu, Jan 24, 2013 at 9:37 PM, inshu chauhan wrote: > For me I think the programme is logically correct, but its giving me results > which are strange. > It is Printing " Different Class" even when sp[9] is equal to sp[10] and > "Same class" when sp[9] is not equal to sp[10]. and sp[9] and sp

Re: mysql solution

2013-01-24 Thread Chris Angelico
On Thu, Jan 24, 2013 at 10:04 PM, Ferrous Cranus wrote: > I;am now convinced the hash solution isn't reversible and also isn't unique. > I'am trying the database oriented solution. Glad you've listened to at least some of what you've been told. But if you want to be taken seriously on this list,

Re: The best, friendly and easy use Python Editor.

2013-01-24 Thread Chris Angelico
On Thu, Jan 24, 2013 at 8:43 PM, Hazard Seventyfour wrote: > Hello, > > I new in this python and decided to learn more about it, so i can make an own > script :), > > for all senior can you suggest me the best, friendly and easy use with nice > GUI editor for me, and have many a good features su

Re: mysql solution

2013-01-24 Thread Chris Angelico
On Thu, Jan 24, 2013 at 10:25 PM, Lele Gaifax wrote: > The simplest way is to execute a SELECT just after the insertion, doing > a > > SELECT pin FROM counters WHERE page = %s > > I don't use MySQL, so I can't say if it supports "INSERT ... RETURNING ..." > SQL syntax: should it, then you could

Re: using split for a string : error

2013-01-24 Thread Chris Angelico
On Thu, Jan 24, 2013 at 10:01 PM, inshu chauhan wrote: > Yeah I tried printing, there were trailing white spaces, so i used strip() > and IT Worked !!! :) Awesome! Keep repr() in mind, it's a great way to check what's really there. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: using split for a string : error

2013-01-24 Thread Chris Angelico
On Thu, Jan 24, 2013 at 10:16 PM, Tobias M. wrote: > Chris Angelico wrote: >> The other thing you may want to consider, if the values are supposed >> to be integers, is to convert them to Python integers before >> comparing. > > I thought of this too and I wo

Re: Python to send Midi commands to iPad via USB

2013-01-24 Thread Chris Angelico
On Thu, Jan 24, 2013 at 10:48 PM, wrote: > Thanks for your help Chris! > forgive my ignorance, but I am not sure what you mean. > I've installed pmidi and what I get is: > > ~$ pmidi -p 128:0 No.19.mid > Could not open file No.19.mid > > Doesn't that mean that

Re: using split for a string : error

2013-01-24 Thread Chris Angelico
On Thu, Jan 24, 2013 at 10:58 PM, Tobias M. wrote: > Chris Angelico wrote: >> >> I'd not consider the performance, but the correctness. If you're >> expecting them to be integers, just cast them, and specifically >> _don't_ catch ValueError. Any non-in

Re: Python to send Midi commands to iPad via USB

2013-01-24 Thread Chris Angelico
On Thu, Jan 24, 2013 at 11:25 PM, wrote: > I think I am not lucky :-( > > $ aplaymidi -l > PortClient name Port name > 14:0Midi Through Midi Through Port-0 > > I get the same either the iPad is connected or not. > So I guess is not recognized. >

Re: mysql solution

2013-01-24 Thread Chris Angelico
On Fri, Jan 25, 2013 at 12:31 AM, Ferrous Cranus wrote: > Τη Πέμπτη, 24 Ιανουαρίου 2013 1:16:51 μ.μ. UTC+2, ο χρήστης Chris Angelico > έγραψε: >> Glad you've listened to at least some of what you've been told. But if >> you want to be taken seriously on this lis

Re: anyone can make a Python bindings of VLC-Qt ?

2013-01-24 Thread Chris Angelico
On Fri, Jan 25, 2013 at 1:25 AM, iMath wrote: > > anyone can make a Python bindings of VLC-Qt ? > https://github.com/ntadej/vlc-qt > accurately, can anyone make a PyQt bindings of VLC-Qt ? Yes, someone can. Ideally, someone who knows C++, Python, VLC, and Qt, and has the time to port the code

Re: mysql solution

2013-01-24 Thread Chris Angelico
On Fri, Jan 25, 2013 at 2:19 AM, Duncan Booth wrote: > Ferrous Cranus wrote: > >> I can do that but then i have to use that pin column's value in my >> next statement. >> >> cursor.execute( '''UPDATE visitors SET hits = hits + 1, useros = %s, >> browser = %s, date = %s WHERE pin = %s AND host = %

Re: The best, friendly and easy use Python Editor.

2013-01-24 Thread Chris Angelico
On Fri, Jan 25, 2013 at 2:54 AM, rusi wrote: > - last expression with _ (underscore) Small terminology quibble: That's not last expression, but last non-None result. >>> 1+2 3 >>> _ 3 >>> _,None (3, None) >>> _ (3, None) >>> _[1] >>> _ (3, None) Otherwise, agree totally. Get to know the interac

Re: The best, friendly and easy use Python Editor.

2013-01-24 Thread Chris Angelico
On Fri, Jan 25, 2013 at 7:25 AM, Tim Chase wrote: > On 01/24/13 13:34, Leonard, Arah wrote: >>> >>> All true (especially the holy wars bit!). OP didn't (as far as >>> I can see) even say which OS he is using. Anyway, my suggestion >>> is generally that people use the editor with which they are >>>

Re: using split for a string : error

2013-01-24 Thread Chris Angelico
On Fri, Jan 25, 2013 at 11:20 AM, Steven D'Aprano wrote: > Chris Angelico wrote: > >> It's usually fine to have int() complain about any non-numerics in the >> string, but I must confess, I do sometimes yearn for atoi() semantics: >> atoi("123asd") =

Re: using split for a string : error

2013-01-24 Thread Chris Angelico
On Fri, Jan 25, 2013 at 12:03 PM, Oscar Benjamin wrote: > On 24 January 2013 11:35, Chris Angelico wrote: >> >> It's usually fine to have int() complain about any non-numerics in the >> string, but I must confess, I do sometimes yearn for atoi() semantics: >> atoi

Re: using split for a string : error

2013-01-24 Thread Chris Angelico
On Fri, Jan 25, 2013 at 12:33 PM, Oscar Benjamin wrote: > I have solved similar situations with > sorted(filenames, key=lambda s: (len(s), s)) > which is better than lexicographical ordering for sorting integer > strings. It gets the _Int file wrong in this case (but I consider it > luck that

Re: The best, friendly and easy use Python Editor.

2013-01-25 Thread Chris Angelico
On Sat, Jan 26, 2013 at 4:35 AM, Leonard, Arah wrote: >>> >>> It's just a text file after all. >>> >> >> True indeed, let's not worry about trivial issues like indentation, mixing >> tabs and spaces or whatever. Notepad anybody? :) >> > > Hey, I didn't say Notepad was the *best* tool for the job

Re: Formatting a column's value output

2013-01-26 Thread Chris Angelico
On Sun, Jan 27, 2013 at 4:51 AM, Ferrous Cranus wrote: > print ( " %s " > % item ) > > In the aboce code wheb 'URL' is to be typed out be print i need it to be > formatted as a link, so the viewer can click on it. > > Is this possible please? Easy, just make a t

Re: Formatting a column's value output

2013-01-26 Thread Chris Angelico
On Sun, Jan 27, 2013 at 8:07 AM, Ferrous Cranus wrote: > That code works, but it creates links for both the URL and hits columns! > Only the URL must be linked not the hits column! 1) Trim your quotes. I can't be bothered doing your trimming for you, so I'm now under-quoting. 2) Quit using Googl

Re: looking for advice python

2013-01-26 Thread Chris Angelico
On Sun, Jan 27, 2013 at 9:26 AM, wrote: > miles = int(string_miles) > gas = int(string_gas) > > #used to calculate mpg through division > mpg = miles/gas > > print(float(string_miles)) > print(float(string_gas)) > print('Your miles per gallon is', format(mpg,'.2f')) Welcome aboard! You turn you

Re: Formatting a column's value output

2013-01-26 Thread Chris Angelico
On Sun, Jan 27, 2013 at 10:29 AM, alex23 wrote: > 5) Please stop writing code for his _commercial web hosting service_ > for free. You mean, stop asking us to write &c.? With that edit, yes, I agree. One of the difficulties on this list is that we don't have two-dimensional people. Even our wors

Re: Python Programming - 28 hours training in New York for $3999

2013-01-26 Thread Chris Angelico
On Sun, Jan 27, 2013 at 3:38 AM, Juhani Karlsson wrote: > Or take this course for free and buy 500 lunches. > Your choice. You spend $8 on lunch? Wow, that's taking TANSTAAFL a long way... ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: The utter mess of current timezone definitions (was: Comparing offset-aware and offset-naive datetimes?)

2013-01-26 Thread Chris Angelico
On Sun, Jan 27, 2013 at 4:25 PM, Ben Finney wrote: >> but I happen to know its offset is 0 (i.e. GMT). > > As further fuel for your hatred: GMT is not the same thing as UTC+0, and > never has been. (See the definitions of those two separate timezones for > more; Wikipedia's articles are probably a

Re: Formatting a column's value output

2013-01-27 Thread Chris Angelico
On Sun, Jan 27, 2013 at 8:04 PM, Ferrous Cranus wrote: > Okey, so far BUT i want the url linking to happen only for the URL column's > value, and not for the hits column too. How do i apply the url link to the > URL column's value only? Step 1: Learn to read documentation. Step 2: Learn to writ

Re: Formatting a column's value output

2013-01-27 Thread Chris Angelico
On Sun, Jan 27, 2013 at 8:16 PM, Ferrous Cranus wrote: > Τη Κυριακή, 27 Ιανουαρίου 2013 11:08:15 π.μ. UTC+2, ο χρήστης Chris Angelico > έγραψε: >> On Sun, Jan 27, 2013 at 8:04 PM, Ferrous Cranus >> wrote: >> >> > Okey, so far BUT i want the url linking to happe

Re: Reading file issue

2013-01-28 Thread Chris Angelico
On Mon, Jan 28, 2013 at 10:47 PM, loial wrote: > I am parseing a file to extract data, but am seeing the file being updated > even though I never explicitly write to the file. It is possible that another > process is doing this at some later time, but I just want to check that > opening the fil

Re: Reading data from 2 different files and writing to a single file

2013-01-28 Thread Chris Angelico
sting in your actual code, please? Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-ideas] while conditional in list comprehension ??

2013-01-28 Thread Chris Angelico
On Tue, Jan 29, 2013 at 12:33 AM, Wolfgang Maier wrote: > Why not extend this filtering by allowing a while statement in addition to > if, as in: > > [n for n in range(1,1000) while n < 400] The time machine strikes again! Check out itertools.takewhile - it can do pretty much that: import iterto

Re: [Python-ideas] while conditional in list comprehension ??

2013-01-28 Thread Chris Angelico
Argh, sorry folks. Hit the wrong list. :( On Tue, Jan 29, 2013 at 12:55 AM, Chris Angelico wrote: > On Tue, Jan 29, 2013 at 12:33 AM, Wolfgang Maier > wrote: >> Why not extend this filtering by allowing a while statement in addition to >> if, as in: >> >> [n for n

Re: Reading data from 2 different files and writing to a single file

2013-01-28 Thread Chris Angelico
On Tue, Jan 29, 2013 at 1:12 AM, inshu chauhan wrote: > where f1 contains something like : > > 297, 404, , > 298, 404, , .. > 299, 404, . > . .. > 295, 452, > > and f2 contains something like : > > 7 > . 2 > 2 > .7 > > and what I want to be written in th

Re: Reading data from 2 different files and writing to a single file

2013-01-28 Thread Chris Angelico
On Tue, Jan 29, 2013 at 1:24 AM, inshu chauhan wrote: >> In that case, Dave's suggestion to read into a list and iterate over >> the list is to be strongly considered. But I'm not entirely sure what >> your goal is here. Are you trying to make the Cartesian product of the >> two files, where you h

Re: Reading data from 2 different files and writing to a single file

2013-01-28 Thread Chris Angelico
On Tue, Jan 29, 2013 at 1:37 AM, Dave Angel wrote: > What you want is the zip() function > > for l,s in zip(f1, f2): > #you now have one line from each file, > # which you can then validate and process > > Note, this assumes that when a line is "bad" from either file, you're going > to a

Re: [os.path.join(r'E:\Python', name) for name in []] returns []

2013-01-29 Thread Chris Angelico
On Wed, Jan 30, 2013 at 12:21 AM, iMath wrote: > why [os.path.join(r'E:\Python', name) for name in []] returns [] ? > please explain it in detail ! That's a list comprehension. If you're familiar with functional programming, it's like a map operation. Since the input list (near the end of the com

Re: Split string data have ","

2013-01-29 Thread Chris Rebert
On Jan 29, 2013 9:05 AM, "moonhkt" wrote: > > Hi All > > Python 2.6.2 on AIX 5.3 > How to using split o > > >>> y = '"abc.p,zip.p",a,b' > >>> print y > "abc.p,zip.p",a,b > >>> > > >>> k= y.split(",") > >>> print k[0] > "abc.p > >>> > > Need Result, First element is > abc.p,zip.p Try the csv modul

Re: environment fingerprint

2013-01-29 Thread Chris Angelico
On Wed, Jan 30, 2013 at 10:33 AM, Jabba Laci wrote: > if md5: > md5 = hashlib.md5() > md5.update(text) > return md5.hexdigest() Simpler: if md5: return hashlib.md5(text).hexdigest() ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: [os.path.join(r'E:\Python', name) for name in []] returns []

2013-01-29 Thread Chris Angelico
On Wed, Jan 30, 2013 at 12:56 PM, iMath wrote: > 在 2013年1月29日星期二UTC+8下午9时33分26秒,Steven D'Aprano写道: >> iMath wrote: > why [os.path.join(r'E:\Python', name) for name in []] returns >> [] ? Because you are iterating over an empty list, []. That list >> comprehension is the equivalent of: result = [

Re: Please provide a better explanation of tuples and dictionaries

2013-01-29 Thread Chris Angelico
On Wed, Jan 30, 2013 at 1:55 PM, Daniel W. Rouse Jr. wrote: > I am currently using "Learning Python" by Mark Lutz and David Ascher, > published by O'Reilly (ISBN 1-56592-464-9)--but I find the explanations > insufficient and the number of examples to be sparse. I do understand some > ANSI C progra

Re: Please provide a better explanation of tuples and dictionaries

2013-01-29 Thread Chris Angelico
On Wed, Jan 30, 2013 at 2:42 PM, Daniel W. Rouse Jr. wrote: > "Chris Angelico" wrote in message > news:[email protected]... >> Have you checked out the online documentation at >> http://docs.python.org/ ? That might have what you

Re: security quirk

2013-01-29 Thread Chris Rebert
with Python. Please direct similar future inquiries to a more relevant forum. Regards, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Please provide a better explanation of tuples and dictionaries

2013-01-29 Thread Chris Angelico
On Wed, Jan 30, 2013 at 5:14 PM, Daniel W. Rouse Jr. wrote: > To me, this looks like an array. Is tuple just the Python name for an array? Not quite. An array is closer to a Python list - a tuple can be thought of as a "frozen list", if you like. Lists can be added to, removed from, and changed i

Re: Reading data from 2 different files and writing to a single file

2013-01-30 Thread Chris Angelico
On Wed, Jan 30, 2013 at 9:43 PM, inshu chauhan wrote: > I actually dont want nested loops but cant find another way to achieve what > I want, But for these files I am sure that they have equal lengths, thats > why I am taking the risk of using nested loops.. Can you suggest any > different way to

Re: looping versus comprehension

2013-01-30 Thread Chris Angelico
On Thu, Jan 31, 2013 at 1:58 AM, Robin Becker wrote: > however, when I tried an experiment in python 2.7 using the script below I > find that the looping algorithms perform better. A naive loop using list += > list would appear to be an O(n**2) operation, but python seems to be doing > better than

Re: how to use subprocess to execute an exe with args and an output

2013-01-30 Thread Chris Rebert
ot; before the output filepath. Try: subprocess.call([ r"C:\Program Files (x86)\GPSBabel\gpsbabel.exe", "-i", "gdb", "-f", r"C:\Temp\GDBdata\testgps28.gdb", "-o", "gpx", "-F", r"C:\Temp\gpx\test28output.gpx", ]) Regards, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: help

2013-01-30 Thread Chris Angelico
On Thu, Jan 31, 2013 at 8:16 AM, wrote: > Hi everyone! I don't mean to intrude, but ive heard great things about this > group and ive stumped myself with my python code. Hi! As others have said, this is no intrusion, but it'd help a lot if you posted your errors and used a more useful subject l

Re: pyrudp

2013-01-30 Thread Chris Angelico
On Thu, Jan 31, 2013 at 6:55 AM, Jorge Alberto Diaz Orozco wrote: > I want to use a reliable UDP connection like you say, a TCP like connection > but over UDP. thaks for your recomendation, if I get good results I promise > to share them. To get something reliable over UDP, you're going to need

Re: pyrudp

2013-01-30 Thread Chris Angelico
On Thu, Jan 31, 2013 at 11:04 AM, Jorge Alberto Diaz Orozco wrote: > I have restrictions in my system that does not allow me to use TCP, so I want > to make a pipe over UDP imitating TCP behavior. > I have control over both endpoints, and I´m writing both of them. > I just don´t want to re-invent

Re: pyrudp

2013-01-30 Thread Chris Angelico
On Thu, Jan 31, 2013 at 3:26 PM, wrote: > Now, the good news is that because UDP-based protocols all run in user memory > space (as opposed to TCP that runs privileged in kernel space) it is > relatively straightforward for non-privledged users to write and test UDP > transport schemes and thi

Re: confusion with decorators

2013-01-31 Thread Chris Angelico
On Fri, Feb 1, 2013 at 12:25 AM, Jason Swails wrote: > On Thu, Jan 31, 2013 at 12:46 AM, Steven D'Aprano > wrote: >> >> On Wed, 30 Jan 2013 19:34:03 -0500, Jason Swails wrote: >> >> > Hello, >> > >> > I was having some trouble understanding decorators and inheritance and >> > all that. This is w

xlrd 0.9.0 released, now with Python 3 support!

2013-01-31 Thread Chris Withers
cel/xlrd/issues Full details of all things Python and Excel related can be found here: http://www.python-excel.org/ cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: Help the visibility of Python in computational science

2013-01-31 Thread Chris Angelico
On Fri, Feb 1, 2013 at 12:05 PM, wrote: > "Brian" is a package I wrote (with several others) to do simulations of > spiking neural networks in Python. Read the article if you want to know > more! :) Ah, I don't need to read it. You're simulating a brain; the rest is mere appendix! (couldn't res

Re: Help the visibility of Python in computational science

2013-01-31 Thread Chris Angelico
On Fri, Feb 1, 2013 at 4:00 PM, Steven D'Aprano wrote: > [email protected] wrote: > >> If you could take one minute to make sure you >> are signed in to your Google+ account > > Which Google+ account would that be? I have so few. > It's a thing non-nerds do, Steven. You wouldn't und

Re: Cheat Engine In Python

2013-01-31 Thread Chris Angelico
On Fri, Feb 1, 2013 at 6:21 PM, wrote: > Why there isn't any replys ? . Because you posted it only a couple of hours ago, for one :) My initial guess is: No. Feel free to disprove me by searching on Google and finding one. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Best approach to OO Style (only slightly off topic)?

2013-02-01 Thread Chris Angelico
On Sat, Feb 2, 2013 at 1:24 AM, Steve Simmons wrote: > At this point, I began to wonder what a 'correctly structured' OO program > should look like. Should I separate GUI logic from 'business' logic? Should > everything be in one class? Should my main() be carrying the high level > logic? Anyin

Re: CamelCase vs. all-lowercase package names

2013-02-01 Thread Chris Angelico
On Sat, Feb 2, 2013 at 2:04 AM, Rhubarb Sin wrote: > PEP-8 calls for "short, all-lowercase names" for packages: > > http://www.python.org/dev/peps/pep-0008/#package-and-module-names > > On the other hand, The Hitchhiker's Guide to Packaging 1.0, under > "Background," declares "come up with a Camel

Re: Floating point calculation problem

2013-02-02 Thread Chris Angelico
On Sat, Feb 2, 2013 at 9:27 PM, Schizoid Man wrote: > The quantity s is input with the following line: s = input("Enter s: ") > > To get rid of the compile error, I can cast this as a float: s = > float(input("Enter s: ")) > > However, then the result returned by the method is wrong. Why does

Re: Floating point calculation problem

2013-02-02 Thread Chris Rebert
ly-typed, which is why, at runtime, an exception is thrown instead of some implicit type coercion being attempted; such coercion tends to hide genuine bugs, hence why Python avoids it. Regards, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Floating point calculation problem

2013-02-02 Thread Chris Angelico
On Sat, Feb 2, 2013 at 10:14 PM, Schizoid Man wrote: > Scratch that, I'm not sure which result is right now, so need to look at the > full calculations in details. What would be the difference between > raw_input() and float(input())? > > Thanks again. Depends on what you type in. raw_input() ta

Re: Floating point calculation problem

2013-02-02 Thread Chris Angelico
t. Other than that, I can't see any obvious reason for there to be a difference. Can you put together a simple script that demonstrates the problem and post it, along with the exact input that you're giving it, and the different outputs? Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: Floating point calculation problem

2013-02-02 Thread Chris Angelico
On Sat, Feb 2, 2013 at 10:51 PM, Schizoid Man wrote: >> If your input has no decimal point in it, eval (or input) will return >> an integer, not a float. Other than that, I can't see any obvious >> reason for there to be a difference. Can you put together a simple >> script that demonstrates the p

python.org mailman web interface problem

2012-01-23 Thread Chris Rebert
ut the webmaster can find this information in the Mailman error logs. """ Posting in the hopes one of the list admins notices this so that it can be fixed. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

String interning in Python 3 - missing or moved?

2012-01-23 Thread Chris Angelico
Python 2 can intern 'str' (bytes) strings (with the eponymous builtin, and with C API functions), though not unicode. Python 3 does not have that builtin, nor the C API; I can't find any support for either str or bytes. Has it been moved, or is interning as a concept deprecated? I don't have a us

Re: String interning in Python 3 - missing or moved?

2012-01-23 Thread Chris Rebert
On Mon, Jan 23, 2012 at 4:38 PM, Chris Angelico wrote: > Python 2 can intern 'str' (bytes) strings (with the eponymous builtin, > and with C API functions), though not unicode. Python 3 does not have > that builtin, nor the C API; I can't find any support for either st

Re: String interning in Python 3 - missing or moved?

2012-01-23 Thread Chris Angelico
On Tue, Jan 24, 2012 at 1:25 PM, Chris Rebert wrote: > The former, into `sys`: > http://docs.python.org/dev/library/sys.html#sys.intern > Search the "What's New"s in the future. > http://docs.python.org/release/3.1.3/whatsnew/3.0.html#builtins Doh, should have checke

Re: String interning in Python 3 - missing or moved?

2012-01-23 Thread Chris Angelico
On Tue, Jan 24, 2012 at 3:18 PM, Terry Reedy wrote: > I think that the devs decided that interning is a minor internal > optimization that users generally should not fiddle with (especially how > that so much is done automatically anyway*), while having it a builtin made > it look like something t

Re: The devolution of English language and slothful c.l.p behaviors exposed!

2012-01-23 Thread Chris Angelico
On Tue, Jan 24, 2012 at 4:57 PM, Rick Johnson wrote: > > Here is a grep from the month of September 2011... Is it? Interesting. I met that month yesterday (she was shopping in Oakleigh, don't ask) and she knew nothing about it. Oh, did you mean "Here is the result of using the grep(1) utility on

Re: The devolution of English language and slothful c.l.p behaviors exposed!

2012-01-23 Thread Chris Angelico
On Tue, Jan 24, 2012 at 5:53 PM, Ian Kelly wrote: > On Mon, Jan 23, 2012 at 10:57 PM, Rick Johnson > wrote: >> >> Here is a grep > > A grep?  What is a grep? According to the damage type table on Aardwolf MUD, a grep is a type of slash - at least, it's resisted by the same armor value that resis

Re: Looking under Python's hood: Will we find a high performance or clunky engine?

2012-01-24 Thread Chris Angelico
On Tue, Jan 24, 2012 at 5:44 PM, alex23 wrote: > On Jan 24, 4:56 am, 8 Dihedral > wrote: >> I know manny python programmers just abandon the list comprehension >> in non-trivial processes. > > Really? Observation of the python mailing list indicates the opposite: > people seem inclined to use

Re: [GENERAL] [RFE] auto ORDER BY for SELECT

2012-01-24 Thread Chris Angelico
On Mon, Jan 23, 2012 at 11:17 PM, Douglas Eric wrote: > I suggest to change this behavior. If one makes a SELECT statement without > any ORDER BY, it would be > clever to automatically sort by the first primary key found in the query, if > any. > The present behavior would still be used in case of

Re: [GENERAL] [RFE] auto ORDER BY for SELECT

2012-01-24 Thread Chris Angelico
Whoops. Wrong list. *sigh* At least there's some variety - it's not Savoynet this time. Disregard the mad guy in the corner, he's not saying anything useful anyway... ChrisA On Tue, Jan 24, 2012 at 7:29 PM, Chris Angelico wrote: > On Mon, Jan 23, 2012 at 11:17 PM, Douglas

Re: String interning in Python 3 - missing or moved?

2012-01-24 Thread Chris Angelico
On Tue, Jan 24, 2012 at 7:17 PM, Stefan Behnel wrote: > If you want to encourage them to fill up their memory with user provided > data in a non-erasable way, then sure, that would certainly keep an > attacker from having to figure out hash collisions in order to bring down a > system. Sending *an

Re: String interning in Python 3 - missing or moved?

2012-01-24 Thread Chris Rebert
On Tue, Jan 24, 2012 at 12:17 AM, Stefan Behnel wrote: > Chris Angelico, 24.01.2012 05:47: >> Lua and Pike both quite happily solved hash collision attacks in their >> interning of strings by randomizing the hash used, because there's no >> way to rely on it. Presu

Re: How to work around a unicode problem?

2012-01-24 Thread Chris Rebert
   Traceback (most recent call last): >      File "/home/chris/bin/eview.py", line 87, in >        image = pyexiv2.ImageMetadata(filepath) >      File "/usr/lib/python2.7/dist-packages/pyexiv2/metadata.py", line 65, in > __init__ >        self.filename = filenam

Re: The devolution of English language and slothful c.l.p behaviors exposed!

2012-01-24 Thread Chris Angelico
On Wed, Jan 25, 2012 at 3:26 AM, Martin P. Hellwig wrote: > Having said that,  I do like to bring to your attention that her Majesty, > never ratified the 'Declaration of Independence'. :-) Oh, stop it. It's high time we got rid of these silly distinctions of English and American. Rick's right -

Re: windows and home path

2012-01-24 Thread Chris Angelico
On Wed, Jan 25, 2012 at 3:36 AM, Andrea Crotti wrote: > I just would like to be able to write somewhere in a place that should > always exist, > why Windows you're so annoying :(? Can you use the current directory, and rely on the user running your program from a viable default? ChrisA -- http:

Re: dynamically creating classes from text

2012-01-24 Thread Chris Angelico
On Wed, Jan 25, 2012 at 4:22 AM, T H wrote: > I’m new to python, sorry if my question is a bit naive, I was > wondering if it is possible to parse some text (ie. from a text file > or say html) and then dynamically create a class? Presuming that your class name comes from somewhere (eg the name o

Re: The devolution of English language and slothful c.l.p behaviors exposed!

2012-01-24 Thread Chris Angelico
On Wed, Jan 25, 2012 at 8:13 AM, Blockheads Oi Oi wrote: > On 24/01/2012 20:03, Joshua Landau wrote: >> A simple version number doesn't imply huge breakages. Try "English2 v1.0"! >> >> In fact, why would a perfect language need a version number? >> > It would be difficult to maintain Python withou

Re: search google with python

2012-01-25 Thread Chris Rebert
PI or modules i can use? https://developers.google.com/image-search/v1/jsondevguide http://docs.python.org/library/json.html http://docs.python.org/library/urllib2.html Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

<    17   18   19   20   21   22   23   24   25   26   >