Re: Python for philosophers

2013-05-13 Thread Grant Edwards
esigned to be economical, but the resource of concern is not computer memory, it's the programmer's time/effort. Computer memory gets cheaper every year. My time gets more valuable every year (hopefully). -- Grant Edwards grant.b.edwardsYow! The entire CHINESE

Re: Fractal

2013-05-15 Thread Grant Edwards
On 2013-05-13, Sharon COUKA wrote: > Hello, I'm new to python and i have to make a Mandelbrot fractal image for > school but I don't know how to zoom in my image. > Thank you for helping me. It's a fractal image, so you zoom in/out with the following Python instruction:

Re: Fwd: Python for philosophers

2013-05-15 Thread Grant Edwards
"taken because I've been told how things are" kind of >> actions, which is exactly the opposite of the point I'm trying to state. Firstly, watch your quoting, Steve D'Aprano didn't write that despite your claim that he did. Secondly, if a the person who named

Re: Python for philosophers

2013-05-16 Thread Grant Edwards
is the "lowest level of its existence"? >> >> --Ned. > > All You People are making this way too hard. To understand how > questions like the OPs ought be resolved, please read: > > http://pvspade.com/Sartre/cookbook.html Yea, I'

Re: Future standard GUI library

2013-05-20 Thread Grant Edwards
the moment, there is nothing really comparable that is a realistic >>> candidate to replace tkinter. >> >> FLTK? (http://www.fltk.org/index.php) > > tkinter is the Python wrapper of the tk library, just as wxpython is > the python wrapper of the wx libr

Re: Diagnosing socket "Connection reset by peer"

2013-05-22 Thread Grant Edwards
ery large on a busy network, >> but if you can quiet other traffic, you may not need to filter at >> all.) > > Or simply filter. It's not hard -- the capture filter "host > my-printer-hostname-or-address" is enough. Indeed. Even a simple filter can make life seve

Re: Future standard GUI library

2013-05-23 Thread Grant Edwards
ly > unusable for anything remotely resembling actual screenwork. What is "screenwork"? -- Grant Edwards grant.b.edwardsYow! Am I elected yet? at gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Text-to-Sound or Vice Versa (Method NOT the source code)

2013-05-28 Thread Grant Edwards
tp://code.google.com/p/pyfestival/ http://machakux.appspot.com/blog/44003/making_speech_with_python -- Grant Edwards grant.b.edwardsYow! at BI-BI-BI-BI-BI-BI gmail.com -- http://mai

Re: Short-circuit Logic

2013-05-28 Thread Grant Edwards
ot specific to Python. > > Can you show me a value of x where x == 0.0 returns False, but x actually > isn't zero? I'm confused. Don't all non-zero values satisfy your conditions? >>> x = 1.0 >>> x == 0.0 False >>> x is 0.0 Fa

Re: Output from to_bytes

2013-05-28 Thread Grant Edwards
'\x00\n' > b'\x00\x0b' > > I mean the 2nd and 3rd should be b'\x00\x09' and b'x00\x0a'. > Anyway, how could I get the output in the forms I want? Well, it would help if you told us what output form you want. -- Grant Edwards

Re: Future standard GUI library

2013-05-28 Thread Grant Edwards
Once again USENET proves to be an unsuitable RPC protocol for implementing irony. :) [OTOH, perhaps Micheal wasn't being ironic...] -- Grant Edwards grant.b.edwardsYow! Am I having fun yet? at

Re: how to compare two json file line by line using python?

2013-05-28 Thread Grant Edwards
en compare whether it > gives you the result you expect: > > a = json.load("file-a") > b = json.load("file-b") > if a == b: > print("file-a and file-b contain the same JSON data") > > If what you care about is the *data* stored in the JSON fil

Re: Making safe file names

2013-05-28 Thread Grant Edwards
o MS-DOS names. God forbid that this still holds on > more modern Microsoft operating systems? There are no more modern Microsoft operating systems. Only more recent ones. There are still lots of reserved filenames in recent versions of Windows. -- Grant Edwards grant.b.edwards

Re: How to get an integer from a sequence of bytes

2013-05-28 Thread Grant Edwards
On 2013-05-27, Mok-Kong Shen wrote: > From an int one can use to_bytes to get its individual bytes, > but how can one reconstruct the int from the sequence of bytes? One way is using the struct module. -- Grant Edwards grant.b.edwardsYow! Uh-oh!! I

Re: Future standard GUI library

2013-05-28 Thread Grant Edwards
On 2013-05-28, Wolfgang Keller wrote: > Actually productive work of significant intensity at a computer screen. Oh. You mean emacs. -- Grant Edwards grant.b.edwardsYow! Will it improve my at CASH F

Re: Python #ifdef

2013-05-28 Thread Grant Edwards
inal(n): m = 0 for b in n.to_bytes(6, 'big'): m = 256*m + b return m else: def original(n): -- Grant Edwards grant.b.edwardsYow! Am I having fun yet? at

Re: Python #ifdef

2013-05-28 Thread Grant Edwards
solving some particular underlying problem isn't going to go learn a new language so that they can understand your example and figure out what you're trying to accomplish. 2) Programming languages differ. X may be the best way to solve the problem in one lang

Re: Python #ifdef

2013-05-29 Thread Grant Edwards
On 2013-05-28, Carlos Nepomuceno wrote: > How do you have "invalid@invalid.invalid" instead of your email address? I have this in my .slrnrc: set hostname "invalid.invalid" set username "grant" set realname "Grant Edwards" I'm not sure why

Re: Python #ifdef

2013-05-29 Thread Grant Edwards
d to keep line numbers consistent. I was wondering whether or not to mention m4. Since m4 is (in my mind) inextricably linked to RATFOR and sendmail config files I try to avoid thinking about it lest the flashbacks start again... -- Grant Edwards grant.b.edwardsYo

Re: Python #ifdef

2013-05-29 Thread Grant Edwards
On 2013-05-29, Chris Angelico wrote: > On Thu, May 30, 2013 at 12:55 AM, Grant Edwards > wrote: >> On 2013-05-29, Dan Stromberg wrote: >> >>> And in case you still want a preprocessor for Python (you likely don't need >>> one this time), here's a

Re: The state of pySerial

2013-05-29 Thread Grant Edwards
re are still too many libraries that don't support 3.x for me to consider using 3.x for real work. -- Grant Edwards grant.b.edwardsYow! They collapsed at ... like nuns in the

Re: The state of pySerial

2013-05-29 Thread Grant Edwards
On 2013-05-29, Terry Jan Reedy wrote: > On 5/29/2013 3:47 PM, Grant Edwards wrote: >> On 2013-05-29, Ma Xiaojun wrote: [...] >>> Unforunately, pySerial project doesn't seem to have a good state. I >>> find pySerial + Python 3.3 broken on my machine (Python 2.7 i

Re: How to get an integer from a sequence of bytes

2013-06-03 Thread Grant Edwards
ctet" when referring a value containing 8 bits. Only recently has it become common to assume that an "byte" contains 8 bits. -- Grant Edwards grant.b.edwardsYow! It's a lot of fun at being alive ... I

Re: How to get an integer from a sequence of bytes

2013-06-03 Thread Grant Edwards
On 2013-06-03, Dave Angel wrote: > On 06/03/2013 10:31 AM, Grant Edwards wrote: >> On 2013-06-03, Dennis Lee Bieber wrote: >>> On Sun, 02 Jun 2013 21:25:45 +0200, Mok-Kong Shen >>> declaimed the following in >>> gmane.comp.python.general: >>> >&g

Re: How to get an integer from a sequence of bytes

2013-06-04 Thread Grant Edwards
On 2013-06-03, Dan Stromberg wrote: > On Mon, Jun 3, 2013 at 7:31 AM, Grant Edwards wrote: > >> That's a common assumption, but historically, a "byte" was merely the >> smallest addressable unit of memory. The size of a "byte" on widely >

Re: How to get an integer from a sequence of bytes

2013-06-04 Thread Grant Edwards
y" still Von Neumann designs from the programmer's point of view (there's only a single address space for both data and instructions). The fact that there are two sparate caches is almost entirely hidden from the user. If you start to do stuff like write self-modifying code, th

Re: Bools and explicitness [was Re: PyWart: The problem with "print"]

2013-06-06 Thread Grant Edwards
aintined a few largish pieces of software for well over a decade, I'm fairly convinced that's true -- especially if you also consider post-deployment maintenance (since at that point you're usually also trying to add features at the same time you're fixing bugs). -- Grant Edward

Re: Popen and reading stdout in windows

2013-06-10 Thread Grant Edwards
solved in Linux. > Anyone currently doing this with Python 2.7 in windows and can share > some guidance? http://docs.python.org/2/library/subprocess.html -- Grant Edwards grant.b.edwardsYow! All of life is a blur at of

Re: Newbie: question regarding references and class relationships

2013-06-10 Thread Grant Edwards
On 2013-06-10, Terry Jan Reedy wrote: > Another principle similar to 'Don't add extraneous code' is 'Don't > rebind builtins'. OK, we've all done it by accident (especially when starting out), but are there people that rebind b

Re: "Don't rebind built-in names*" - it confuses readers

2013-06-11 Thread Grant Edwards
ed for your shopping convenience. Other than the fact that they're pre-imported for you, they're no different than symbols imported from any other module. -- Grant Edwards grant.b.edwardsYow! Could I have a drug at ov

Re: "Don't rebind built-in names*" - it confuses readers

2013-06-12 Thread Grant Edwards
hat is a keyword. You can't choose a vriable name that is a keyword: the compiler won't allow it. "list" isn't a keyword. -- Grant Edwards grant.b.edwardsYow! Maybe I should have at asked for my Neutron Bomb

Re: How to get an integer from a sequence of bytes

2013-06-12 Thread Grant Edwards
er long words can inadverten be cropped. Only the first 10 characters in variable names were significant when you wrote Pascal programs (I don't remember if that was true for FORTRAN, but I bet it was). -- Grant Edwards grant.b.edwardsYow! I'm gliding over a

Re: A certainl part of an if() structure never gets executed.

2013-06-12 Thread Grant Edwards
year ): >> cur.execute( '''SELECT * FROM works WHERE >> YEAR(lastvisit) = %s ORDER BY lastvisit ASC''', year ) > > There is so much you didn't tell us here, including which database you are > using. Are you guys _still_ on

Re: Version Control Software

2013-06-13 Thread Grant Edwards
go), Windows support for get, bzr, and hg was definitely lacking compared to svn. The lack of something like tortoisesvn for hg/git/bzr was a killer. It looks like the situation has improved since then, but I'd be curious to hear from people who do their development on Windows. -- Grant

Re: Turnign greek-iso filenames => utf-8 iso

2013-06-13 Thread Grant Edwards
week or next month when a new privelege elevation exploit is discovered for your OS. > Are you implying that for example one could elevate his privileges to > root level access form within a normal restricted user account? Yes, that's what he's implying. -- Grant Edwards

Re: Turnign greek-iso filenames => utf-8 iso

2013-06-13 Thread Grant Edwards
"single detail I am missing" Seriously? -- Grant Edwards grant.b.edwardsYow! What I want to find at out is -- do parrots know gmail.commuch about Astro-Turf? -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrong website loaded when other requested

2013-06-13 Thread Grant Edwards
t; Andrea i need to fix this my friend. Then shut up, stop bothering us, and fix it. -- Grant Edwards grant.b.edwardsYow! I'm into SOFTWARE! at gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Version Control Software

2013-06-13 Thread Grant Edwards
On 2013-06-13, Chris Angelico wrote: > On Fri, Jun 14, 2013 at 3:06 AM, Grant Edwards > wrote: > >> The last time we made the choice (4-5 years ago), Windows support for >> get, bzr, and hg was definitely lacking compared to svn. The lack of >> something like torto

Re: Version Control Software

2013-06-14 Thread Grant Edwards
requires a full-time administrator for every 10 or so users. The other systems seemed to require almost no regular administration, and what was required was handled by the developers themselves (mayby a couple hours per month). The cost of ClearCase was also sky-high. -- Grant Edwards

Re: A certainl part of an if() structure never gets executed.

2013-06-14 Thread Grant Edwards
On 2013-06-14, Nick the Gr33k wrote: > Well i do not understand it. Yea. We know. -- Grant Edwards grant.b.edwardsYow! I feel like a wet at parking meter on Darvon! gmail.

Re: Wrong website loaded when other requested

2013-06-14 Thread Grant Edwards
On 2013-06-14, Nick the Gr33k wrote: > On 13/6/2013 10:31 ????, Grant Edwards wrote: >> On 2013-06-13, Nick the Gr33k wrote: >>> On 13/6/2013 9:37 , Andreas Perstinger wrote: >>>> On 13.06.2013 20:10, Nick the Gr33k wrote: >>>> [nothing new] >>

Re: Eval of expr with 'or' and 'and' within

2013-06-14 Thread Grant Edwards
opyright", "credits" or "license" for more information. >>> name="abcd" >>> month="efgh" >>> year="ijkl" >>> >>> "k" in (name and month and year) True >>> (name and month and

Re: Eval of expr with 'or' and 'and' within

2013-06-14 Thread Grant Edwards
t can lead to some hard-to-read code, so it's often discouraged as being too clever. It's important to note that these are somewhat orthogonal: You can have #1 and #2 (like Python). You can have #1 without #2 (like C). You can have #2 without

Re: Eval of expr with 'or' and 'and' within

2013-06-14 Thread Grant Edwards
few random oddities: > >>>> bool(float("nan")) > True > > I somehow expected NaN to be false. Maybe that's just my expectations > that are wrong, though. If you work with floating point long enough you realize that most of your expectations are wrong. Sometimes

Re: Eval of expr with 'or' and 'and' within

2013-06-14 Thread Grant Edwards
uot;truthness" and you can be guaranteed that if A or B or C: will behave exactly the same way whether the "or" operator returns True or it returns one of it's operands. -- Grant Edwards grant.b.edwardsYow! Where do your SOCKS

Re: Don't feed the troll... (was: Re: A few questiosn about encoding)

2013-06-14 Thread Grant Edwards
) I think the answer is to automatically kill all threads stared by "him". Unfortunately, I don't know if that's possible in most newsreaders. -- Grant Edwards grant.b.edwardsYow! A dwarf is passing out at somewhere in Detroit! gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: A few questiosn about encoding

2013-06-15 Thread Grant Edwards
On 2013-06-15, Denis McMahon wrote: > On Fri, 14 Jun 2013 16:58:20 +0300, Nick the Gr33k wrote: > >> On 14/6/2013 1:14 , Cameron Simpson wrote: >>> Normally a character in a b'...' item represents the byte value >>> matching the character's Unicode ordinal value. > >> The only thing that i did

Re: Don't feed the troll...

2013-06-17 Thread Grant Edwards
n that case. > This message was sent with a CC, and you got only one copy. I don't want _any_ copies from from Mailman. I don't subscribe to whatever mailing list you're talking about. I'm reading this via an NNTP server. Keep replies in the

Re: Why 'files.py' does not print the filenames into a table format?

2013-06-17 Thread Grant Edwards
On 2013-06-15, Nick the Gr33k wrote: > On 15/6/2013 10:46 ??, Jarrod Henry wrote: >> Nick, at this point, you need to hire someone to do your work for you. > > The code is completely ready. OK. Good-bye then. -- Grant Edwards grant.b.edwardsYow! Th

Re: Don't feed the troll...

2013-06-17 Thread Grant Edwards
No. I first try and inevitably i fail. But failing _isn't_ inevitible. If you take the time to actually learn Python by reading the references people provide, by studying small examples, and by experimenting with Python code, there's no reason why you should fail. -- Gr

Re: Don't feed the troll...

2013-06-18 Thread Grant Edwards
to discuss questions about internals (though we hopefully know enough not to depend on the answers being the same tomorrow). -- Grant Edwards grant.b.edwardsYow! What I want to find at out is -- do parrots know

Re: Don't feed the troll...

2013-06-18 Thread Grant Edwards
ess his unwillingness to read the > documentation which was IMO rather apparant. It's not only apparent, he explicitly stated that he refused to go read the references he has been provided because he prefers to have his questions answered by a "live" persion. IMO, anybody who beh

Re: Why is regex so slow?

2013-06-18 Thread Grant Edwards
rithm that's way faster than another O(log(n)) algorithm. [Though that becomes a lot less likely as n gets large.] -- Grant Edwards grant.b.edwardsYow! Where's SANDY DUNCAN? at gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Don't feed the troll...

2013-06-18 Thread Grant Edwards
On 2013-06-18, Dennis Lee Bieber wrote: > On Tue, 18 Jun 2013 13:38:40 + (UTC), Grant Edwards >>On 2013-06-18, Chris Angelico wrote: >>> On Tue, Jun 18, 2013 at 2:39 PM, alex23 wrote: >>>> tl;dr Stop acting like a troll and we'll stop perceiving you as s

Re: Default Value

2013-06-24 Thread Grant Edwards
terminates(f, args) that I can use to determine whether a function > will terminate before I actually call it. I think it should be terminate_time() -- so you can also find out how long it's going to run. It can return None if it's not going to terminate... -- Grant Edwards

Re: Python development tools

2013-06-24 Thread Grant Edwards
tools. -- Grant Edwards grant.b.edwardsYow! I'm shaving!! at I'M SHAVING!! gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python development tools

2013-06-25 Thread Grant Edwards
you didn't have to do it more that a few times. -- Grant Edwards grant.b.edwardsYow! I'm a fuschia bowling at ball somewhere in Brittany gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is the argparse module so inflexible?

2013-06-27 Thread Grant Edwards
own argument parsing class to service it, I can appreciate what the > OP is trying to do (and it's clever IMO). Unfortunately, when writing software, being "clever" turns out to be A Bad Thing(tm) as often as not. ;) -- Grant Edwards grant.b.edw

Re: Bug reports [was Re: Python list code of conduct]

2013-07-03 Thread Grant Edwards
ue shipping IPv4-only stuff for many years to come, and all our customers would be perfectly happy. -- Grant Edwards grant.b.edwardsYow! My NOSE is NUMB! at gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Bug reports [was Re: Python list code of conduct]

2013-07-03 Thread Grant Edwards
On 2013-07-03, Roy Smith wrote: > In article , > Grant Edwards wrote: > >> On 2013-07-03, Roy Smith wrote: >> > In article , >> > Chris Angelico wrote: >> > >> >> Of course, it's possible for there to be dark corners. But if you&#

Re: Important features for editors

2013-07-04 Thread Grant Edwards
On 2013-07-04, ?? wrote: > > If you guys want to use it i can send you a patch for it. I know its > illegal thing to say but it will help you use it without buying it. A new low. Now he's offering to help people steal others' work. -- Grant -- http://mail.python.org/mailman/listinfo

Re: Important features for editors

2013-07-05 Thread Grant Edwards
On 2013-07-04, Ferrous Cranus wrote: > 4/7/2013 9:40 , ??/?? Grant Edwards : >> On 2013-07-04, ?? wrote: >>> >>> If you guys want to use it i can send you a patch for it. I know its >>> illegal thing to say but it will help y

Re: Geo Location extracted from visitors ip address

2013-07-05 Thread Grant Edwards
dress and geographical location. I know that users of the ISPs in hometown are consistently mis-identified as being from towns 1500km away. -- Grant Edwards grant.b.edwardsYow! If elected, Zippy at pledges to each

Re: Geo Location extracted from visitors ip address

2013-07-08 Thread Grant Edwards
;am from Europe/Thessaloniki (sub-capital of Greece) > > If we can pin-point the uvisitor more accurately plz let me know. For the Nth time: you can't. -- Grant Edwards grant.b.edwardsYow! HOORAY, Ronald!! at

Re: Geo Location extracted from visitors ip address

2013-07-08 Thread Grant Edwards
t; All my Greece visitors as Dave correctly said have the ISP address which > here in Greece is Europe/Athens, so i have now way to distinct the > cities of the visitors. > > Is there any way to pinpoint the visitor's exact location? No. -- Grant Edwards grant.b

Re: looking for a new router

2013-07-09 Thread Grant Edwards
t a Bosch combo model (both plunge and fixed base), and I'm very happy with it: http://www.boschtools.com/Products/Tools/Pages/BoschProductDetail.aspx?pid=1617EVSPK It did take me a few days to find the extra 1/4" collet that came with it since it had worked it's w

Re: looking for a new router

2013-07-09 Thread Grant Edwards
er-Cable 693 plunge base will work: http://www.routerforums.com/introductions/41838-bosch-1604-question.html http://forums.finewoodworking.com/fine-woodworking-knots/power-tools-and-machinery/pc-6931-plunge-base -- Grant Edwards grant.b.edwardsYow! Where's the Coke

Re: Best Scripting Language for Embedded Work?

2013-07-10 Thread Grant Edwards
an OS environment intended for software development rather than generating time-wasting power-point presentations. -- Grant Edwards grant.b.edwardsYow! Look! A ladder! at Maybe it leads to heaven,

Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread Grant Edwards
o run it present sit instantly. So you've reached your conclusion on a sample size of one? -- Grant Edwards grant.b.edwardsYow! I'm encased in the at lining of a pure pork gmail.com

Re: Storing a very large number

2013-07-17 Thread Grant Edwards
>>> sys.getsizeof(x) 288 >>> math.log10(x) 619.8859949077654 It has 600+ digits and requires 288 bytes to store. Counting from the left-hand side, starting '7' as digit 0, the 209th digit in the base-10 representation is: >>> str(x)[209] '3' -- Gran

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 Grant Edwards
2) You can post from the gmane web UI. 3) It offers both a threaded and a flat, blog-like version. -- Grant Edwards grant.b.edwardsYow! We just joined the at civil hair patrol! gmail.com -- http://mail.python.org/mailman/listinfo/python-list

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 Grant Edwards
stings. I really can't recommend gmane.org highly enough. [I don't actually read the python list using gmane.org, since I've read it from a Usenet news server via the group comp.lang.python since long before I discovered gmane.org.] -- Grant Edwards

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-21 Thread Grant Edwards
On 2013-07-21, Gilles wrote: > Every once in a while, my ISP's SMTP server refuses to send > perfectly legit e-mails because it considers them as SPAM. > > So I'd like to install a dead-simple SMTP server on my XP computer > just to act as SMTP backup server. All I'd need is to change the SMTP >

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-22 Thread Grant Edwards
On 2013-07-22, Gilles wrote: > On Sun, 21 Jul 2013 21:01:09 + (UTC), Grant Edwards > wrote: >>Unless you've got a static IP address, a domain name, and a valid MX >>record that will match up when they do a reverse DNS lookup, it's >>pretty unlikely that you&

Re: Is it that easy to install Python ?

2013-07-25 Thread Grant Edwards
that didn't include Python as part of the base installation. > I just finished downloading, configuring, making and installing. > > The binary is now installed in : > /usr/local/Python-2.7.5/bin/python2.7 Why not just apt-get install python? -- Grant Edwards gra

Re: Unexpected results comparing float to Fraction

2013-07-29 Thread Grant Edwards
ing floats. You check for equality if equality is what you want to check. However much of the time when people _think_ they want to check for FP equality, they're wrong. You'll have to consult with a spiritual advisor to determin what you are "meant" to do... -

Re: Bitwise Operations

2013-07-29 Thread Grant Edwards
On 2013-07-29, Devyn Collier Johnson wrote: > On Python3, how can I perform bitwise operations? For instance, I want > something that will 'and', 'or', and 'xor' a binary integer. http://www.google.com/search?q=python+bitwise+operations -- Grant E

Re: PEP8 79 char max

2013-07-30 Thread Grant Edwards
I also find intializers for tables of data to be much more easily read and maintained if the columns can be aligned. -- Grant Edwards grant.b.edwardsYow! MMM-MM!! So THIS is at BIO-NEBULATION! gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP8 79 char max

2013-07-31 Thread Grant Edwards
On 2013-07-31, Tim Chase wrote: > On 2013-07-31 07:16, Joshua Landau wrote: >> On 30 July 2013 18:52, Grant Edwards wrote: >>> I also find intializers for tables of data to be much more easily >>> read and maintained if the columns can be aligned. >> >> Why

Re: PEP8 79 char max

2013-07-31 Thread Grant Edwards
On 2013-07-31, Neil Cerutti wrote: > On 2013-07-31, Tim Chase wrote: >> On 2013-07-31 07:16, Joshua Landau wrote: >>> On 30 July 2013 18:52, Grant Edwards wrote: >>>> I also find intializers for tables of data to be much more easily >>>> read an

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Grant Edwards
orts. Is some device emulating a serial port? It shouldn't matter. If other apps can open COM4, then pyserial should be able to open COM4. >> Thanks, and yes, I am using VirtualBox. My laptop does not have a >> serial port so I use a USB-to-serial converter, which is assigne

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Grant Edwards
n to Win32. You can't open a serial port that's already open. [Linux doesn't have that restriction.] Why do you need to open it a second time? -- Grant Edwards grant.b.edwardsYow! Send your questions to at

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Grant Edwards
On 2012-06-27, Adam wrote: > "Grant Edwards" wrote: >> On 2012-06-27, Adam wrote: >> >>> The Python script needed a call to ser.close() before ser.open() in >>> order to work. >> >> IOW, the port opened OK, but when you tried to open it a

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Grant Edwards
On 2012-06-27, Grant Edwards wrote: > On 2012-06-27, Adam wrote: >> "Grant Edwards" wrote: >>> Why do you need to open it a second time? >> >> As far as I can tell, the wireless hardware connected to the >> USB-to-serial converter is receiving data

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Grant Edwards
ne) self._isOpen = True If you have to add the call "ser.close()" before you can open the port with "ser.open()", then that means that the port _was_already_open_. -- Grant Edwards grant.b.edwardsYow! World War III? at No thanks! gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-28 Thread Grant Edwards
83 84 # open up the FTDI serial port to get data transmitted to xbee 85 ser = serial.Serial(SERIALPORT, BAUDRATE) 86 ser.open() 87 Just delete line 86. See how simple it was to get the problem solved once you posted the actual code? -- Grant Edwards gr

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Grant Edwards
ing about the tabs vs. spaces argument. In that case, people who use 4 spaces per level are 'correct'; people who use a different number of spaces are a bit less correct; people who use tabs are wrong; and people who mix spaces and tabs -- well, we don't talk about them in polite

Re: Foxpro goto command and deleted records

2012-07-18 Thread Grant Edwards
On 2012-07-17, Ethan Furman wrote: > In Foxpro if you do a Foxpro? -- Grant Edwards grant.b.edwardsYow! I am NOT a nut at gmail.com -- http://mail.python.org/mailman/listi

Re: Converting a list of strings into a list of integers?

2012-07-23 Thread Grant Edwards
was the definitive answer. 2) When I first learned Python it didn't have list comprehensions. That said, "map" seems to be frowned upon by the Python community for reasons I've never really understood, and most people are going to prefer reading a list comprehension. "What

Re: OT: Text editors

2012-07-29 Thread Grant Edwards
On 2012-07-29, Mark Lawrence wrote: > Point taken, snag being I've never used any nix box in anger. This > thread reminds of the good 'ole days when I were a lad using TPU on > VMS. Have we got any VMS aficionados here? It's been a long time, but I used eve/tpu as my main editor for several y

Re: Is Python a commercial proposition ?

2012-07-30 Thread Grant Edwards
llar microcontrollers that are programmed in assembly language or in C without external libraries (sometimes not even the "libc" that's included in the C language definition). Those microcontrollers are everywhere in toys, appliances, and all sorts of other "non-computer" t

Re: Extracting bit fields from an IEEE-784 float

2012-07-30 Thread Grant Edwards
on that where the FP format wasn't IEEE were the DEC VAX and TI's line if 32-bit floating-point DSPs. I don't think Python runs on the latter, but it might on the former. -- Grant Edwards grant.b.edwardsYow! I was born in a at

Re: Extracting bit fields from an IEEE-784 float

2012-07-30 Thread Grant Edwards
On 2012-07-30, Mark Lawrence wrote: > On 30/07/2012 15:16, Grant Edwards wrote: >> On 2012-07-30, Steven D'Aprano wrote: >> >>> 1) Are there any known implementations or platforms where Python floats >>> are not C doubles? If so, what are they? >> &

Re: Pass data to a subprocess

2012-08-01 Thread Grant Edwards
e tricky, because I can't use queues and pipes to >> communicate with a running process that it's noit my child, correct? >> > Yes, I think that is correct. I don't understand why detaching a child process on Linux/Unix would make IPC sto

Re: Pass data to a subprocess

2012-08-01 Thread Grant Edwards
rocesses that are holding open file handles unmap/close them. So not only will detached children not crash, they'll still be able to use the shared memory objects to talk to each other. -- Grant Edwards grant.b.edwardsYow! Why is it that when

Re: Pass data to a subprocess

2012-08-02 Thread Grant Edwards
child process is detatched (which I'm assuming means being removed from the process group and/or detached from the controlling tty). But, I'm not aware of any underlying Unix IPC mechanism that breaks when a child is detached, so I was curious about what would cause multiprocessing

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Grant Edwards
On 2012-08-06, Grant Edwards wrote: > On 2012-08-06, Tom P wrote: >> On 08/06/2012 06:18 PM, Nobody wrote: >>> On Mon, 06 Aug 2012 17:52:31 +0200, Tom P wrote: >>> >>>> consider a nested loop algorithm - >>>> >>>> for i in range(100)

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Grant Edwards
,100) and then range(0,N) In 2.x: for i in range(M,100)+range(0,M): for j in range(N,100)+range(0,N): do_something(i,j) Dunno if that still works in 3.x. I doubt it, since I think in 3.x range returns an iterator, not? -- Grant Edwards grant.b.e

Re: looking for a neat solution to a nested loop problem

2012-08-06 Thread Grant Edwards
uess it works in 2.x as well? I don't know. Let me test that for you... $ python Python 2.6.8 (unknown, May 18 2012, 11:56:26) [GCC 4.5.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from i

Re: Threads and sockets

2012-08-10 Thread Grant Edwards
On 2012-08-10, loial wrote: > At the moment I do not start to read responses until the data has > been sent to the printer. However it seems I am missing some > responses from the printer whilst sending the data, so I need to be > able to do the 2 things at the same time. > > Can I open a port on

  1   2   3   4   5   6   7   8   9   10   >