Re: Working around multiple files in a folder

2016-11-21 Thread Emile van Sebille
for file_name in list_of_files: FI = open(file_name, 'r') FI1=FI.read().split() FO = open(file_name.replace('txt', 'out'), 'w') for line in FI: at this point, there's nothing left to be read from FI having been full

Re: Deviding N(1,2,3,..,N) part from numeric list as summation of each values(don't sorted) has highest as possible.

2016-10-10 Thread Emile van Sebille
s = [0]*n ln=0 while idx < len(land) and ln lavg-close: ln+=1 print lnsums -- Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: working with ctypes and complex data structures

2016-10-05 Thread Emile van Sebille
uot;", line 84, in __init__ TypeError: call takes exactly 1 arguments (2 given) Thanks for your attention. the line it's objecting to is: >+84 cpu_total(buff=buff, size=sizeof(buff)) because the expectation is defined as: >+77 def __init__(self): HTH, Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: how to automate java application in window using python

2016-09-28 Thread Emile van Sebille
On 09/28/2016 02:52 PM, Lawrence D’Oliveiro wrote: On Thursday, September 29, 2016 at 4:57:10 AM UTC+13, Emile van Sebille wrote: My point was that it is possible to automate windows reliably as long as the programming is robust. Sounds like circular reasoning. Which worked for me! You

Re: how to automate java application in window using python

2016-09-28 Thread Emile van Sebille
On 09/23/2016 05:02 PM, Lawrence D’Oliveiro wrote: On Thursday, September 22, 2016 at 8:34:20 AM UTC+12, Emile wrote: Hmm, then I'll have to wait longer to experience the unreliability as the handful of automated gui tools I'm running has only been up 10 to 12 years or so. You soun

Re: how to automate java application in window using python

2016-09-21 Thread Emile
g can never work reliably... Hmm, then I'll have to wait longer to experience the unreliability as the handful of automated gui tools I'm running has only been up 10 to 12 years or so. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: subprocess startup error

2016-02-26 Thread Emile van Sebille
he standard library, mystring.py for example, and IDLE should work again. It's ridiculous that it's this easy to accidentally crash IDLE and the Python shell. I don't think there's a way to protect against it -- how could you work on string.py otherwise? Emile -- https://m

Re: child.before taking almost 1 minute to execute

2016-02-24 Thread Emile van Sebille
7; in p.before: print "No such directory exists!!" sys.exit(1) I'd guess that you've got your p.expect line wrong -- it looks to me like you're allowing that line to complete only upon seeing an EOF or TIMEOUT, and tha

Re: There has to be a better way to split this string!

2016-02-15 Thread Emile van Sebille
:-) Not to worry -- you find out quick enough. :) Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: How to resize an animated gif to fit the window

2016-02-05 Thread Emile van Sebille
Googling that finds https://cloud.google.com/appengine/docs/python/images/ which may be of some help. Emile On 1/29/2016 5:50 PM, kwe...@gmail.com wrote: Hi, I am able to display animated gif using pyglet using below code, but I would like the image to stretch and fit the window as i

Re: Stop writing Python 4 incompatible code

2016-01-15 Thread Emile van Sebille
oice but to sell, or face bankruptcy. Yep, just another tactic of economic warfare. Hmm, sounds like they're stealing plays from Micro$oft. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: "Downloading"

2015-12-02 Thread Emile van Sebille
n the Internet, and I download things to the circuit board on my bench. In both cases I initiate the transaction Forget the ups and downs and just load the file. Nowadays I suspect push and pull are better terms. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Emile van Sebille
think-obfustication-is-the-point-ly y'rs, Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-25 Thread Emile van Sebille
ely for my specific use case. Unfortunately, there are issues determining if python is in either camp, which certainly leads to confusion. see http://www.python-course.eu/passing_arguments.php or google "python pass by value or reference" for more examples. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: any practise site about python?

2015-11-04 Thread Emile van Sebille
beginners Any of the top four hits googling 'getting started with python' should provide you a thread to pull on. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: 2.7.9: PhotoImage get/put

2015-10-20 Thread Emile van Sebille
process hght in ten (pick a number) steps? Emile I've tried various forms of refresh(), update(), etc., within the loop, but so far no luck. Am I missing something simple? def process(): # Ordinarily this would be process(photo,wdth,hgt) global wdth # but I ran into problems call

Re: Extended functions in embedded code

2015-10-13 Thread Emile van Sebille
On 10/13/2015 1:32 PM, Ervin Hegedüs wrote: Hi, On Tue, Oct 13, 2015 at 08:55:42AM -0700, Emile van Sebille wrote: On 10/13/2015 8:29 AM, Ervin Hegedüs wrote: Hi Chris, On Wed, Oct 14, 2015 at 02:05:43AM +1100, Chris Angelico wrote: Sounds to me like the easiest way would be to inject

Re: Extended functions in embedded code

2015-10-13 Thread Emile van Sebille
ot;python extend built-in module" is may be too simple expression :). Maybe the site module helps you. See https://docs.python.org/3/library/site.html Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Using pipe in a system call

2015-10-10 Thread Emile van Sebille
leading spaces work better for me -- they line up nicely on the left rather than the trailing ragged edge. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Recover data over the network

2015-10-09 Thread Emile van Sebille
On 10/9/2015 7:47 PM, Arshpreet Singh wrote: On Friday, 9 October 2015 22:51:16 UTC+5:30, Emile van Sebille wrote: without extensive clues as to the nature of the data to be recovered you're not going to get much further with this. It is mostly /home partition data on disk. Those are

Re: Recover data over the network

2015-10-09 Thread Emile van Sebille
scp if it's an option. :) Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: reg multiple login python

2015-10-07 Thread Emile van Sebille
this ? any one pls help... the best you're likely to do to get them running near simultaneously is to launch a detached process for each request. you could adapt your current for loop to do so. emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Trouble running

2015-10-06 Thread Emile van Sebille
On 10/5/2015 11:06 AM, Cameroni123 ™ wrote: Hi I have recently installed python on windows 10 and I’m trying to save in order to run the module and I cant I don’t know why, could you please help? you might find the following helpful: http://www.cs.utexas.edu/~mitra/bytes/start.html emile

Re: Check if a given value is out of certain range

2015-10-01 Thread Emile van Sebille
inion, the latter one takes slightly less effort to grok. Wouldn't x < 0 or 10 < x be even more visual? Well, I had to parse that one twice to grok it. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about regular expression

2015-09-30 Thread Emile van Sebille
is is why I use python. That looks too much like a hex sector disk dump rot /x20. :) No-really-that's-sick-ly yr's, Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about regular expression

2015-09-30 Thread Emile van Sebille
... format, try starting with >>> "name1 name2(1) name3 name4(1,4) name5(2)".split() ['name1', 'name2(1)', 'name3', 'name4(1,4)', 'name5(2)'] then create the dict from the result. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Check if a given value is out of certain range

2015-09-29 Thread Emile van Sebille
On 9/29/2015 2:04 PM, Random832 wrote: On Tue, Sep 29, 2015, at 16:32, Mark Lawrence wrote: not (0 <= x <= 10) Yuck. How about x not in range(11)? x = 5.5 Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Hello

2015-09-19 Thread Emile van Sebille
evel of windows compatibility. emile -- https://mail.python.org/mailman/listinfo/python-list

Re: True == 1 weirdness

2015-09-16 Thread Emile van Sebille
y-my-daughter-the-english-teacher-won't-see-this-ly y'rs, Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: True == 1 weirdness

2015-09-16 Thread Emile van Sebille
e for consenting adults -- I don't consider it a wart. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: True == 1 weirdness

2015-09-16 Thread Emile van Sebille
operators are either <= or < I'm not all that sure A and B should be allowed. I find A convenient for initializing: aname = bname = cname = None Nut I don't recall ever having used is this way. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Terminology: "reference" versus "pointer"

2015-09-14 Thread Emile van Sebille
t also is known as kitty to my youngest daughter. The cat has no idea what its name is, it just is and eats. So three labels, one object. Putting the object in three boxes isn't right -- how could you know (other than checking the id()) that they're the same? Shroedingers-cat-was

Re: Terminology: "reference" versus "pointer"

2015-09-12 Thread Emile van Sebille
ts python sense? Is-there-no-hammer-in-this-toolbox-ly y'rs Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Python handles globals badly.

2015-09-12 Thread Emile van Sebille
On 9/11/2015 10:22 PM, Skybuck Flying wrote: I didn't learn anything from this posting, sorry ! ;) I'm seeing a pattern here... Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Terminology: "reference" versus "pointer"

2015-09-12 Thread Emile van Sebille
? From the definition it would seem it's not a pointer, as from the perspective of the programming language, you can't get there from the id. Look-ma,-no-pointers-ly y'rs, Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: monospaced font in MS Windows with wxpython

2015-09-11 Thread Emile van Sebille
so want to try posting to http://www.wxpython.org/maillist.php as they're more wxpython focused. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Python handles globals badly.

2015-09-10 Thread Emile van Sebille
On 9/10/2015 3:25 PM, t...@freenet.de wrote: > Who decides it? The BDFL or his delegate. It's simplest that way. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Hi am new to python

2015-09-09 Thread Emile van Sebille
ly be used as a precursor to discussing better methods of achieving the required result. As I understand it, the OP was given the homework assignment to sum up a list of numbers using while. Too bad he didn't also specify using binary operators along with while. :) Emile

Re: Python handles globals badly.

2015-09-09 Thread Emile van Sebille
On 9/9/2015 10:55 AM, Steven D'Aprano wrote: (I wanted to link to the "Everything Is Broken" essay on The Medium, but the page appears to be gone. Is this it? http://www.sott.net/article/280956-Everything-is-broken-on-the-Internet -- https://mail.python.org/mailman/listinfo/python-list

Re: Python handles globals badly.

2015-09-02 Thread Emile van Sebille
#x27;re feeling like you need to add global statements to a lot of functions to enable variable sharing/access, it may be codesmell indicating it's time to make a class of things. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Hi am new to python

2015-08-31 Thread Emile van Sebille
# Use a while loop to sum all numbers in list_a# If you store the sums into sum_a print(sum_a) # should print 19 You should familiarize yourself with the language -- there's a really easy answer to this. Review the tutorial at https://docs.python.org/3/tutorial/ Emile --

Re: Why Python is not both an interpreter and a compiler?

2015-08-31 Thread Emile van Sebille
hing their own itch. And if it is really easy, then why cx_freeze, pytoexe developer are doing it in such a rubbish way instead of creating one (compiler)? You'd have to ask them. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Please don't make unfounded legalistic demands (was: [a, b, c, d] = 1, 2, 3, 4)

2015-08-27 Thread Emile van Sebille
On 8/26/2015 2:14 PM, Grant Edwards wrote: On 2015-08-26, Emile van Sebille wrote: On 8/26/2015 9:06 AM, Grant Edwards wrote: It's also unfortunate that there's no way to to access the mailing list via an NNTP server Huh? -- gmane.comp.python.general at news://nntp.gma

Re: Please don't make unfounded legalistic demands (was: [a, b, c, d] = 1, 2, 3, 4)

2015-08-26 Thread Emile van Sebille
On 8/26/2015 9:06 AM, Grant Edwards wrote: It's also unfortunate that there's no way to to access the mailing list via an NNTP server Huh? -- gmane.comp.python.general at news://nntp.gmane.com:119/gmane.comp.python.general Or do you mean by the OP? Emile -- https://mail.python.o

Re: AttributeError

2015-08-12 Thread Emile van Sebille
nd tell us where the label 'filename' is defined. We can't find it. Neither can python. That's what the error message means. Was that not clear? You do understand the difference between text and labels, right? You have by now reviewed the tutorial? Emile The revised co

Re: AttributeError

2015-08-12 Thread Emile van Sebille
*mart (or was that dell?) for comments like that. :) However-a-propos-ly y'rs, Emile @ltc -- read this -- then re-read all the responses you've been given. Repeat ad nauseam. Until you can understand and incorporate advice given you're wasting your time and ours asking. -

Re: AttributeError

2015-08-12 Thread Emile van Sebille
On 8/12/2015 10:24 AM, MRAB wrote: What is it _actually_ trying to split? Aah, reading. Such an underused skill. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Developer- Houston, TX

2015-08-10 Thread Emile van Sebille
d at https://www.python.org/community/jobs/howto/ next time. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Pipes

2015-08-09 Thread Emile van Sebille
old, is not entirely obsolete and still provides a nice overview of things. See http://effbot.org/zone/librarybook-index.htm Emile [1] and del from not while aselif globalorwith assertelse ifpass yield break excepti

Re: Python Scheduling

2015-08-07 Thread Emile van Sebille
On 8/7/2015 7:17 AM, Laura Creighton wrote: In a message of Fri, 07 Aug 2015 06:48:32 -0700, Emile van Sebille writes: On 8/6/2015 11:06 AM, sairam kumar wrote: Hi Experts, I am Automating some repetitive works through Sikuli and Python scripting languages.I have multiple workflows.i

Re: Python Scheduling

2015-08-07 Thread Emile van Sebille
there any way to schedule the python programming through Task scheduler in windows platform. The windows task scheduler works fine -- have you tried it? Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Uninstall

2015-08-05 Thread Emile van Sebille
e pedantry to your civility. But-neither-is-much-to-my-liking-ly y'rs, Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Linux script to get most expensive processes

2015-08-04 Thread Emile van Sebille
On 8/4/2015 2:30 PM, Cecil Westerhof wrote: On Tuesday 4 Aug 2015 22:52 CEST, Emile van Sebille wrote: My platform shows as linux2 and it worked fine for me when checking for that. I heard that that was possible also, but none of my systems gives this. I should change it. You could also

Re: Linux script to get most expensive processes

2015-08-04 Thread Emile van Sebille
processes. For this I wrote the following script. Is this a reasonable way to do this? Getting the parameter is done quit simple, but I did not think fancy was necessary here. My platform shows as linux2 and it worked fine for me when checking for that. Emile -- https://mail.python.org/mailman

Re: Most pythonic way of rotating a circular list to a canonical point

2015-08-01 Thread Emile van Sebille
On 8/1/2015 2:24 PM, Lukas Barth wrote: Perhaps I should clarify a bit: - I definitely need a "canonical rotation" - just a comparison result is not enough Well, it looks to me that I don't know what a 'canonical rotation' is -- there's no wikipedia article and googling yields all sorts of

Re: Most pythonic way of rotating a circular list to a canonical point

2015-08-01 Thread Emile van Sebille
On 8/1/2015 2:12 PM, Lukas Barth wrote: On Saturday, August 1, 2015 at 10:51:03 PM UTC+2, Emile van Sebille wrote: Is the problem to determine if one list of circular numbers 'matches' another one despite rotation status? If so, I'd do something like: Well.. no. I actually r

Re: Most pythonic way of rotating a circular list to a canonical point

2015-08-01 Thread Emile van Sebille
n "".join(map(str,L1)) in "".join(map(str,L2+L2)) Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Which Python do I need for the below?

2015-08-01 Thread Emile van Sebille
On 8/1/2015 10:09 AM, Rustom Mody wrote: On Saturday, August 1, 2015 at 10:07:37 PM UTC+5:30, Emile van Sebille wrote: Seeing that you have no responses yet I'm guessing most potential responders along with me are not opening attachments. Most recipients are not receiving at all! [I

Re: Which Python do I need for the below?

2015-08-01 Thread Emile van Sebille
is of screen output, please copy that as text and ask again -- you're more likely to get a response that way. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: I'm a newbie and I'm stumped...

2015-08-01 Thread Emile van Sebille
n is actually running (sys.version): Python 3.4.0 (default, Apr 11 2014, 13:05:11) [GCC 4.8.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> word = (input('enter a word ')) enter a word test >>&

Re: Error: valueError: ordinal must be >= 1

2015-07-27 Thread Emile van Sebille
to allow the script to continue processing. Otherwise, you'll need to complete debugging the code (as indicated by the break) or comment out/remove the set_trace. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Hi

2015-07-25 Thread Emile van Sebille
nswer. My computer is 64bit windows 7. You may find the activestate distribution works better for you. See http://www.activestate.com/activepython/downloads Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Stripping sRGB profile from PNGs in python

2015-07-23 Thread Emile van Sebille
-- on the system I'm at today running Python 2.5 I'm using the commands module. For example: commands.getoutput('for ii in /proc/[0-9]*/environ; do echo $ii; strings $ii ; done').split() Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Find Minimum for element in multiple dimensional array

2015-07-22 Thread Emile van Sebille
zippair = (None,None) for ky,rec in L: if ky[:2] == lastzippair: continue print ky,":",rec lastzippair=ky[:2] ---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<--- The results are what you'd write to the csv file. Tested only with the data you provided. HTH, Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Can I copy/paste Python code?

2015-07-22 Thread Emile van Sebille
On 7/22/2015 12:35 PM, Grant Edwards wrote: On 2015-07-22, Emile van Sebille wrote: On 7/21/2015 5:10 PM, Grant Edwards wrote: On 2015-07-21, Emile van Sebille wrote: On 7/21/2015 2:47 PM, Grant Edwards wrote: 1) You can't copy/paste text from evince _at_all_. Hmm, i just c

Re: Can I copy/paste Python code?

2015-07-22 Thread Emile van Sebille
On 7/21/2015 5:10 PM, Grant Edwards wrote: On 2015-07-21, Emile van Sebille wrote: On 7/21/2015 2:47 PM, Grant Edwards wrote: 1) You can't copy/paste text from evince _at_all_. Hmm, i just copied "Acorsa Artichoke Heart - Quarter, Water, Can" from a catalog pdf, so _at_

Re: Can I copy/paste Python code?

2015-07-21 Thread Emile van Sebille
On 7/21/2015 2:47 PM, Grant Edwards wrote: On 2015-07-21, Emile van Sebille wrote: On 7/21/2015 1:32 PM, Grant Edwards wrote: But, it apears foxit reader is Windows-only so it's a moot point for Linux/Unix/Mac users. I've been happy with https://wiki.gnome.org/Apps/Evince on li

Re: Can I copy/paste Python code?

2015-07-21 Thread Emile van Sebille
On 7/21/2015 1:32 PM, Grant Edwards wrote: But, it apears foxit reader is Windows-only so it's a moot point for Linux/Unix/Mac users. I've been happy with https://wiki.gnome.org/Apps/Evince on linux. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Integers with leading zeroes

2015-07-21 Thread Emile van Sebille
On 7/21/2015 10:58 AM, sohcahto...@gmail.com wrote: IMO, leading zeroes just looks like visual noise, and if I wanted to align numbers, I'd just use spaces. Aligning numbers using spaces doesn't always align -- using zeros does. Emile -- https://mail.python.org/mailman/listi

Re: Noob in Python. Problem with fairly simple test case

2015-07-17 Thread Emile van Sebille
e 2.7 stop backporting, because no one cares if they do? That'd work for me. I'm not looking to upgrade the python versions of functioning productive code. Of course, neither are my customers looking to pay for me to f*ck^h^h^h^hupgrade up their non-buggy systems. Emil

Re: Need Help w. Getting the Eclipse Python Add-On.

2015-07-17 Thread Emile van Sebille
ly yields a lot of apparently valid links -- you might have better luck starting with a tutorial -- see perhaps http://www.vogella.com/tutorials/Python/article.html gets you further down the road. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Noob in Python. Problem with fairly simple test case

2015-07-16 Thread Emile van Sebille
ty. --anytime-- python v3 -- 143 python v2 -- 189 --Past month-- python v3 -- 386000 python v2 -- 554000 Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Emile van Sebille
On 6/24/2015 8:55 AM, Chris Angelico wrote: On Thu, Jun 25, 2015 at 1:52 AM, Emile van Sebille wrote: On 6/24/2015 7:02 AM, Grant Edwards wrote: And how does writing unmangled data to disk expose anybody to anything? I've never heard of an exploit where writing an evilly crafted bit-pa

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Emile van Sebille
least prevent it from executing. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: anomaly

2015-05-11 Thread Emile van Sebille
On 5/11/2015 8:34 AM, Grant Edwards wrote: > Yow! YOU PICKED KARL > MALDEN'S NOSE!! I'd bet most people familiar with Karl Malden wouldn't have a problem picking his from a selection of twenty random noses. :) Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Encrypt python files

2015-05-06 Thread Emile van Sebille
On 5/6/2015 12:23 AM, Palpandi wrote: On Wednesday, May 6, 2015 at 12:07:13 PM UTC+5:30, Palpandi wrote: Hi, What are the ways to encrypt python files? No, I just want to hide the scripts from others. See http://stackoverflow.com/questions/261638/how-do-i-protect-python-code Emile

Re: Is it normal to cry when given XML?

2015-05-05 Thread Emile van Sebille
anyone tell me who originated this line? I find references from 2006 attributing the quote to "Ted Neward" but can't confirm that's where it started. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Python re to extract useful information from each line

2015-04-29 Thread Emile van Sebille
that's why we avoid regular expressions... it makes my head hurt just looking at that line noise. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Problem running Python 2.7 on Ubuntu 10.04

2015-04-20 Thread Emile van Sebille
See http://faq.pygtk.org/index.py?req=show&file=faq01.010.htp Emile -- https://mail.python.org/mailman/listinfo/python-list

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

2015-04-17 Thread Emile van Sebille
On 4/17/2015 10:17 AM, saadaouijihed1...@gmail.com wrote: I have a swig module (.pyd).I followed the steps but it doesn't work please help me. Start here: http://catb.org/~esr/faqs/smart-questions.html Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Working with Access tables and python scripts

2015-04-14 Thread Emile van Sebille
e top of my head remember the details, but if no one else chimes in I could probably dig out that code. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: OOP for System Administrator

2015-04-04 Thread Emile van Sebille
s.linuxtone.org/ebooks/Python/OReilly.Python.for.Unix.and.Linux.System.Administration.Sep.2008.pdf Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Best way to calculate fraction part of x?

2015-03-26 Thread Emile van Sebille
On 3/24/2015 6:39 PM, Jason Swails wrote: On Mon, Mar 23, 2015 at 8:38 PM, Emile van Sebille float (("%6.3f" % x)[-4:]) ​In general you lose a lot of precision this way...​ Even more if you use %6.1 -- but feel free to flavor to taste. :) Emile -- https://mail.

Re: test1

2015-03-26 Thread Emile van Sebille
On 3/25/2015 12:49 PM, Tiglath Suriol wrote: On Tuesday, March 24, 2015 at 11:04:48 PM UTC-4, Chris Angelico wrote: On Wed, Mar 25, 2015 at 1:47 PM, Tiglath Suriol wrote: PLONK< -- https://mail.python.org/mailman/listinfo/python-list

Re: Best way to calculate fraction part of x?

2015-03-23 Thread Emile van Sebille
On 3/23/2015 5:52 AM, Steven D'Aprano wrote: Are there any other, possibly better, ways to calculate the fractional part of a number? float (("%6.3f" % x)[-4:]) Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Automation of Windows app?

2015-03-22 Thread Emile van Sebille
ndowOpen>Sheets* Wait>1 Press Alt Send Character/Text>ls Release Alt Wait>1 Wait>1 Press Alt Send Character/Text>fs Release Alt Wait>1 HTH, Emile [1] https://www.mjtnet.com/ -- https://mail.python.org/mailman/listinfo/python-list

Re: Odd ValueError using float

2015-03-17 Thread emile
On 03/15/2015 07:01 AM, Peter Otten wrote: Probably not helpful, but I can provoke the behaviour you see by toggling bytes with ctypes, thus simulating a corrupted str object: Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for

Re: Odd ValueError using float

2015-03-14 Thread emile
On 03/14/2015 11:24 AM, Peter Otten wrote: emile wrote: On 03/14/2015 09:08 AM, Peter Otten wrote: Why are you checking int(decval) because it sure smells like int should work: (Pdb) "3" That's a normal string comparison when decval is a string. This and the ValueEr

Re: Odd ValueError using float

2015-03-14 Thread emile
On 03/14/2015 08:52 AM, Chris Angelico wrote: On Sun, Mar 15, 2015 at 2:28 AM, emile wrote: It ran almost to completion before generating the error again -- (Pdb) decval '4' (Pdb) type(decval) (Pdb) len(decval) 1 (Pdb) int(decval) *** ValueError: invalid literal for int() wi

Re: Odd ValueError using float

2015-03-14 Thread emile
On 03/14/2015 09:08 AM, Peter Otten wrote: emile wrote: On 03/13/2015 08:09 PM, Chris Angelico wrote: On Sat, Mar 14, 2015 at 1:33 PM, Paul Rubin wrote: emile writes: *** NameError: name 'val' is not defined (Pdb) l 139 try: 140 val = round(float(decv

Re: Odd ValueError using float

2015-03-14 Thread emile
On 03/13/2015 08:09 PM, Chris Angelico wrote: On Sat, Mar 14, 2015 at 1:33 PM, Paul Rubin wrote: emile writes: *** NameError: name 'val' is not defined (Pdb) l 139 try: 140 val = round(float(decval),1) 141 except: 142 import pdb; pdb.set_tr

Re: Odd ValueError using float

2015-03-13 Thread emile
On 03/13/2015 03:14 PM, Chris Angelico wrote: On Sat, Mar 14, 2015 at 9:10 AM, emile wrote: (Pdb) decval '4' (Pdb) len(decval) 1 (Pdb) int(decval) *** ValueError: invalid literal for int() with base 10: '41.703' (Pdb) Any ideas? What's type(decval) te

Odd ValueError using float

2015-03-13 Thread emile
s for the ingredients of the foodlist referenced 149 # local internal use only to create sqlFoodListsByID (Pdb) decval '4' (Pdb) len(decval) 1 (Pdb) int(decval) *** ValueError: invalid literal for int() with base 10: '41.7000003' (Pdb) Any ideas? Thanks, E

Re: http: connection reset by peer

2015-03-06 Thread Emile van Sebille
, problem solved! Well, no remaining symptoms. I don't consider a problem solved if I fail to understand the context. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: (Still OT) Nationalism, language and monoculture [was Re: Python Worst Practices]

2015-03-04 Thread Emile van Sebille
which best expresses what they're trying to say, and no one will involved realise. Except for my poor grandmother who hadn't understood a word my mother had said the previous ten minutes. :) Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: Sort list of dictionaries

2015-03-02 Thread Emile van Sebille
ogle.Chrome', 'version': u'35.0.1916.114'}, {'name': u'com.google.Chrome', 'version': u'34.0.1847.137'}, {'name': u'com.google.Chrome', 'version': u'34.0.1847.131'}, {'name': u'com.google.Chrome', 'version': u'34.0.1847.116'}, {'name': u'com.google.Chrome', 'version': u'33.0.1750.152'}, {'name': u'com.google.Chrome', 'version': u'33.0.1750.149'}, {'name': u'com.google.Chrome', 'version': u'33.0.1750.146'}, {'name': u'com.google.Chrome', 'version': u'32.0.1700.107'}, {'name': u'com.google.Chrome', 'version': u'31.0.1650.63'}, {'name': u'com.google.Chrome', 'version': u'31.0.1650.57'}] sortedlist = sorted(mylist , key=lambda x, y: x['name'] LooseVersion(elem['version'])), reverse=True) You'll need to fix LooseVersion or elem or both -- or show them so we can help. Emile Thanks, Charlie -- https://mail.python.org/mailman/listinfo/python-list

Re: Odd version scheme

2015-02-12 Thread Emile van Sebille
On 2/12/2015 11:16 AM, Ian Kelly wrote: Things break down again when we get to Python XIX. 'XVIII' < 'XIX' False Looks to me like you better check if your PEP313 patch is installed properly. :) Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: fuzzysearch: find not exactly what you're looking for!

2015-02-12 Thread Emile van Sebille
eMatcher for my fuzzy search needs now -- can you provide some perspective on how fuzzysearch compares? Thanks, Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: __pycache__

2015-02-03 Thread Emile van Sebille
On 2/3/2015 8:31 AM, Mark Lawrence wrote: On 03/02/2015 14:34, Emile van Sebille wrote: On 2/3/2015 6:21 AM, Dennis Lee Bieber wrote: The second is to use Google... https://www.google.com/?gws_rd=ssl#q=python+idle+can%27t+make+connection but the first page of results isn't he

Re: __pycache__

2015-02-03 Thread Emile van Sebille
On 2/3/2015 6:21 AM, Dennis Lee Bieber wrote: The second is to use Google... https://www.google.com/?gws_rd=ssl#q=python+idle+can%27t+make+connection but the first page of results isn't helping -- lots of reports of the problem, but no firm remedy listed. it was suggested to me rec

  1   2   3   4   5   6   7   >