Re: references/addrresses in imperative languages

2005-06-20 Thread pete
Xah Lee wrote: > > in coding Python yesterday, It seems to be giving you anxiety. Have you considered not coding on python? -- pete -- http://mail.python.org/mailman/listinfo/python-list

Making a calendar

2005-02-26 Thread Pete.....
Hi all. I'm trying to make a calendar for my webpage, python and html is the only programming languages that I know, is it possible to make such a calendar with pythong code and some html. The Idea is that when I click the link calendar on my webpage, then the user will be linked to the calend

Re: Making a calendar

2005-02-27 Thread Pete.....
Thanks all. I will look at your links tonight :D Hopefully they will make me smile and jump around as a happy man... Cheers "Brian Sutherland" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sat, Feb 26, 2005 at 01:57:20PM +0100, Pete. wrote: >

Working on a log in script to my webpage

2005-03-08 Thread Pete.....
Hi all I am working on a log in script for my webpage. I have the username and the password stored in a PostgreSQL database. The first I do is I make a html form, where the user can type in his username and code, when this is done I want to run the script(testifcodeisokay) that verifies that th

Re: Working on a log in script to my webpage

2005-03-08 Thread Pete.....
> How am I going to stop user from navigating directly to page1? > > Answering this question will involve learning about HTTP session state and > writing web applications. I could write a book on that subject :-) > > regards > Steve > Thanks Steve And yes I havnt thought about that, guess I

Re: Working on a log in script to my webpage

2005-03-08 Thread Pete.....
roach will give you a > better/faster solution to your problem. > > -regards > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf > Of Steve Holden > Sent: Tuesday, March 08, 2005 4:02 PM > To: python-list@python.org > Su

Re: Working on a log in script to my webpage

2005-03-09 Thread Pete.....
> wrote in message news:[EMAIL PROTECTED] > pete... > > simply use google and search for "php scripts login user authentication > mysql session etc..." > > these terms will give you lots of examples... you could also look at some > of > the bulletin board/for

Re: Working on a log in script to my webpage

2005-03-09 Thread Pete.....
googling, but didnt really find anything, that helpfull... Any more advice... Once again thanks for your time Sincerly Pete "Pete." <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi again. > > This question might sound a bit strange, but here I

Re: Working on a log in script to my webpage

2005-03-09 Thread Pete.....
ea Members Area Welcome to our members area! In my code I have allready tested if the username and password is correct, so I just need to do the cookie thing :D Thanks all, hope all my questions dosnt make you tired, I just really wanna figure this out, and I am doing this as a little ho

Re: Working on a log in script to my webpage

2005-03-11 Thread Pete.....
Hi all. Unfortunaly it looks like I dont have to skill to make a secure log in, cant figure out how the code has to look like, so guess my webpage has to live with a security issue. Thanks for the effort you put into teaching me the use of cookies. Best wishes Pete "Pete.&quo

Re: try / except not worknig correctly

2005-03-12 Thread Pete
'@'.join([..join(['fred','dixon']),..join(['gmail','com'])]) wrote: 1) the tutor list is really slow. but thanks. 2) Thanks Brain, i was missing the string bit. the code i posted (opps) was not exactly where i was having problems, it just looked like it. also thanks for the 'in' test, that will com

HTTP GET Explodes...

2006-09-23 Thread Pete
I was running the HTTP GET example at http://www.python.org/doc/current/lib/httplib-examples.html and ran into a bit of trouble... >>> import httplib # This works. >>> conn = httplib.HTTPConnection("www.python.org") # This works. >>> conn.request("GET", "/index.html") # This does not work... T

Re: HTTP GET Explodes...

2006-09-23 Thread Pete
won't know until you give the *full* traceback. Do you > get the same results when you try what I did at the interpreter > interactive prompt? The error I received was from the interactive prompt thing. Is there some way I can get more verbose information or something that would be more hel

Re: HTTP GET Explodes...

2006-09-23 Thread Pete
> ... > I'm going to upgrade Python and see if that has any effect... > ... I upgraded Python, it had an effect, but not a positive one. My interactivity is below. Where is the "Hello World." text coming from? Python 2.4.3 (#1, Jun 13 2006, 11:46:08) [GCC 4.1.1 20060525 (Red Hat 4.1.1-1)] on linu

Re: HTTP GET Explodes...

2006-09-23 Thread Pete
John Machin wrote: > Pete wrote: > > Fade in to episode II... > > > > > ... > > > This is compiling a *constant* regular expression, and works OK on the > > > Windows distribution of Python 2.4.3 : > > > > H. Here's the version informa

What is the best way to "get" a web page?

2006-09-23 Thread Pete
The file "temp.html" is created, but it doesn't look like the page at www.python.org. I'm guessing there are multiple frames and my code did not get everything. Can anyone point me to a tutorial or other reference on how to "get" all of the html contents at a par

Re: What is the best way to "get" a web page?

2006-09-23 Thread Pete
g. Can anyone point me to a tutorial or other > > reference on how to "get" all of the html contents at a particular > > page? > > > > Why did Python print the line after "file.close"? > > > > Thanks, > > Pete > > > > A. You di

Re: HTTP GET Explodes...

2006-09-23 Thread Pete
andable... In my confused state I created a new user, fired up python, slung the example code, and had no problem (except for "r2", but that was understandable). So, I looked at my search path under the account that was experiencing the problem. That wasn't it... Then I&#x

Re: HTTP GET Explodes...

2006-09-23 Thread Pete
andable... In my confused state I created a new user, fired up python, slung the example code, and had no problem (except for "r2", but that was understandable). So, I looked at my search path under the account that was experiencing the problem. That wasn't it... Then I&#x

Re: HTTP GET Explodes...

2006-09-24 Thread Pete
ack down the environmental variables I rebooted the system a few times and the example code I was working with does indeed work on my system. After upgrading python I exited my interactive session and jumped back in to an interactive session which displayed the new python version number. Experienced problems. Now, no problems. Not sure what made the problem(s) go away... Very odd... -- Pete -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the best way to "get" a web page?

2006-09-24 Thread Pete
ml: 1 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 http://www.w3.org/1999/xhtml";> Here are the first two lines of www.python.org as saved from Firefox: 1 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 http://www.w3.org/1999/xhtml"; lang="en"> Lines one are identical. Lines two are different. Why would lines two differ? H... Thanks, Pete -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the best way to "get" a web page?

2006-09-24 Thread Pete
t; -- > My email-address is correct. > Do NOT remove ".nospam" to reply. Thanks for the tip. I'll check that out. Is that your code? -- Pete -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the best way to "get" a web page?

2006-09-24 Thread Pete
y you'll get exactly the same > bytes (assuming the page is static). > > -- > Felipe. A. wget - most cool. My temp.html matches wget. Now to capture that pesky css stuff... Thanks, Pete -- http://mail.python.org/mailman/listinfo/python-list

Re: Concurrency Email List

2009-05-18 Thread Pete
On May 16, 2009, at 7:26 PM, Aahz wrote: [posted and e-mailed] On Sat, May 16, 2009, Pete wrote: python-concurre...@googlegroups.com is a new email list for discussion of concurrency issues in python. It arose out of Dave Beazley's class on the subject last week: http://www.dabea

Uninstalling Python

2006-03-29 Thread Pete
mmend that I keep them even though I will probably never use them (ie for the future just in case). Or could something else get screwed up if I uninstalled them. Is this analogous to java (which I also do not believe I have a need for). Thanks...Pete -- http://mail.python.org/mailman/listi

Re: Uninstalling Python

2006-03-29 Thread Pete
Ben Finney wrote: > "Pete" <[EMAIL PROTECTED]> writes: > >> I googled "python" and have no interest in it and know nothing about >> it. >> >> Therefore, I would like to uninstall both the versions since I do >> not believe I need them.

Re: Uninstalling Python

2006-03-29 Thread Pete
but I will leave it. Am I correct in assuming that "administrative tools" and "user accounts" in the control panel is windows driven and not HP driven (excuse my choice of words if not correct). This gets into the folders in c:\docs and settings, so I'm not sure what the

Ignoring XML Namespaces with ElementTree

2009-12-03 Thread Pete
Is there anyway to configure ElementTree to ignore the XML namespace? For the past couple months, I've been using minidom to parse an XML file that is generated by a unit within my organization that can't stick with a standard. This hasnt been a problem until recently when the script was provided a

Re: Ignoring XML Namespaces with ElementTree

2009-12-03 Thread Pete
On Dec 3, 2:55 pm, Stefan Behnel wrote: > Pete, 03.12.2009 19:21: > > > Is there anyway to configure ElementTree to ignore the XML namespace? > > For the past couple months, I've been using minidom to parse an XML > > file that is generated by a unit within my orga

Re: Popen and reading stdout in windows

2013-06-11 Thread Pete Forman
the exe with communicate() and I have sent > stdout to PIPE without luck. Just not sure what is the proper way to > iterate over the stdout as it eventually makes its way from the > buffer. You could try Sarge which is a wrapper for subprocess providing command pipeline functionality. http

Re: Parsing ISO date/time strings - where did the parser go?

2012-09-12 Thread Pete Forman
ure time-offset of -00:00 means UTC but local time is unknown -- Pete Forman -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL or something to open EXIF Metadata with Python

2013-01-10 Thread Pete Forman
thon.org/pypi/hachoir-metadata https://bitbucket.org/haypo/hachoir/wiki/Home -- Pete Forman -- http://mail.python.org/mailman/listinfo/python-list

setdefault behaviour question

2012-05-19 Thread pete McEvoy
I am confused by some of the dictionary setdefault behaviour, I think I am probably missing the obvious here. def someOtherFunct(): print "in someOtherFunct" return 42 def someFunct(): myDict = {1: 2} if myDict.has_key(1): print "myDict has key 1" x = myDict.setdefault

Re: setdefault behaviour question

2012-05-19 Thread pete McEvoy
Ah - I have checked some previous posts (sorry, should have done this first) and I now can see that the lazy style evaluation approach would not be good. I can see the reasons it behaves this way. many thanks anyway. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to read in the newsreader

2017-10-15 Thread Pete Forman
;s what i use too - gmail. But i get the digest only >> > and can't really reply that way. i was hoping to get the >> > mail.python.org list >> >> Turn off digests then. Easy! If you do stick with a digest then check your newsreader for a feature to expand it. The

Re: how to read in the newsreader

2017-10-16 Thread Pete Forman
Thomas Jollans writes: > On 2017-10-16 08:48, Pete Forman wrote: >> Andrew Z writes: >> >>> hmm. i did do that. maybe just a delay. >>> I'll see how it will go tomorrow then. Thank you gents. >>> >>> On Mon, Oct 16, 2017 at 12:30 AM, Chri

Re: how to read in the newsreader

2017-10-17 Thread Pete Forman
Thomas Jollans writes: > On 16/10/17 20:02, Pete Forman wrote: >> Thomas Jollans writes: >> >>> On 2017-10-16 08:48, Pete Forman wrote: >>>> Andrew Z writes: >>>> >>>>> hmm. i did do that. maybe just a delay. >>>>&

Re: This newsgroup (comp.lang.python) may soon be blocked by Google Groups

2018-02-01 Thread Pete Forman
searchable archive > of comp.lang.idl-pvwave available. This was the real benefit of Google > groups, from my point of view. > > There is something called "narkive", but its search function seems to > be broken, and it doesn't archive very far back in time. A couple of other mail archivers are: https://www.mail-archive.com https://marc.info -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: XML Considered Harmful

2021-09-21 Thread Pete Forman
gt;> for the job in hand. > > Naturally. That's what I'm exploring. You might also like to consider HDF5. It is targeted at large volumes of scientific data and its capabilities are well above what you need. MATLAB, Octave and Scilab use it as their native format. PyTables and h2py provide Python/NumPy bindings to it. -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: XML Considered Harmful

2021-09-22 Thread Pete Forman
Jon Ribbens writes: > On 2021-09-21, Pete Forman wrote: >> CSV is quite good as a lowest common denominator exchange format. I >> say quite because I would characterize it by 8 attributes and you >> need to pick a dialect such as MS Excel which sets out what those >

Re: lxml and xpath(?)

2016-10-27 Thread Pete Forman
;./name/text()") That enforces a single result. The original code will detect a lack of results but if the query returns multiple results when only one is expected then it silently returns the first. -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

PEP 393 vs UTF-8 Everywhere

2017-01-20 Thread Pete Forman
as a sequence of characters, is that a reason to shoehorn the subtleties of Unicode into that model? -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP 393 vs UTF-8 Everywhere

2017-01-20 Thread Pete Forman
Chris Kaynor writes: > On Fri, Jan 20, 2017 at 2:35 PM, Pete Forman wrote: >> Can anyone point me at a rationale for PEP 393 being incorporated in >> Python 3.3 over using UTF-8 as an internal string representation? >> I've found good articles by Nick Coghlan, Armin

Re: PEP 393 vs UTF-8 Everywhere

2017-01-20 Thread Pete Forman
ace the deficient old implementations rather than another approach. The implicit question is whether a UTF-8 internal representation should replace that of PEP 393. -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP 393 vs UTF-8 Everywhere

2017-01-21 Thread Pete Forman
Unicode 4 and RFC 3629 (2003). There is CESU-8 if you really need a naive encoding of UTF-16 to UTF-8-alike. py> low = '\uDC37' is only meaningful on narrow builds pre Python 3.3 where the user must do extra to correctly handle characters outside the BMP. -- Pete Forman https://payg-petef.rhcloud.com -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP 393 vs UTF-8 Everywhere

2017-01-21 Thread Pete Forman
.3+ then all is rosy. (At this point I'm tempted to put in a winky emoji but that might push the internal representation into UCS-4.) -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: Guido sees the light: PEP 8 updated

2016-04-18 Thread Pete Forman
with hard tabs, that is not germane to my question). The content of the line need not be bound by the rules needed to position its start. -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: Guido sees the light: PEP 8 updated

2016-04-18 Thread Pete Forman
Ian Kelly writes: > On Mon, Apr 18, 2016 at 3:14 PM, Pete Forman wrote: >> Why is it that Python continues to use a fixed width font and >> therefore specifies the maximum line width as a character count? >> >> An essential part of the language is indentation wh

Re: Guido sees the light: PEP 8 updated

2016-04-19 Thread Pete Forman
Rustom Mody writes: > On Tuesday, April 19, 2016 at 6:49:34 AM UTC+5:30, sohcatoa wrote: >> On Monday, April 18, 2016 at 2:14:17 PM UTC-7, Pete Forman wrote: >> > Why is it that Python continues to use a fixed width font and therefore >> > specifies the maximum line

Re: RFC: name for project of a cross version disassembler, and unmarshal program

2016-05-22 Thread Pete Forman
See > https://github.com/rocky/python-pyxdis. > > In the past I've been told by Polish-speaking people that my names are > hard to pronounce. (If you've ever heard any Polish tongue twisters, > you'll know that this really hurts.) > > Any suggestions for a better name? relipmoc -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: RFC: name for project of a cross version disassembler, and unmarshal program

2016-05-23 Thread Pete Forman
Rustom Mody writes: > On Monday, May 23, 2016 at 1:38:41 PM UTC+5:30, rocky wrote: >> On Monday, May 23, 2016 at 2:17:07 AM UTC-4, Pete Forman wrote: >> > rocky writes: >> > >> > > I'm looking for a good name for a relatively new project I'll pu

Re: for / while else doesn't make sense

2016-05-23 Thread Pete Forman
ing point is an inexact representation. Just because integers and binary fractions have an exact correspondence we ought not to be affording them special significance. Floating point 1 is not the integer 1, it stands for a range of numbers some fraction either side of 1. There are other ways of handling non-integral numbers, such as fixed point, rational and unum. However current computing hardware is very much oriented to floating point, IEEE in particular. -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: for / while else doesn't make sense

2016-05-23 Thread Pete Forman
Ian Kelly writes: > On Mon, May 23, 2016 at 12:16 PM, Pete Forman wrote: >> Something else which I do not think has been stated yet in this >> thread is that floating point is an inexact representation. Just >> because integers and binary fractions have an exact correspon

Re: for / while else doesn't make sense

2016-05-24 Thread Pete Forman
Gregory Ewing writes: > Pete Forman wrote: >> However I am coming from scientific measurements where 1.0 is the >> stored value for observations between 0.95 and 1.05. > > You only know that because you're keeping some extra information in > your head about what th

Re: Format a timedelta object

2016-05-27 Thread Pete Forman
> > Thanks Zach. Unfortunately, the format is not quite how I want it, so I > guess I'll have to extract the H:M:S fields manually from the seconds. It might be useful if timedelta were to get an isoformat() method. ISO 8601 specifies formats for durations; most people are fami

Re: Method Chaining

2016-06-18 Thread Pete Forman
tations is that VB uses a leading dot. Might that lessening of ambiguity enable a future Python to allow this? class Foo: def .set(a): # equivalent to def set(self, a): .a = a# equivalent to self.a = a Unless it is in a with statement with obj: .a = 1# equivalent to obj.a = 1 .total = .total + 1 # obj.total = obj.total + 1 -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: value of pi and 22/7

2016-06-18 Thread Pete Forman
o the ratio of the two measurements >> should only have one significant digit. > > I’m not sure how you can write “30” with one digit... >>> int('U', 36) 30 -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: Method Chaining

2016-06-18 Thread Pete Forman
Joonas Liik writes: > On 18 June 2016 at 15:04, Pete Forman wrote: >> Rustom Mody writes: >> >>> On Friday, June 17, 2016 at 2:58:19 PM UTC+5:30, Steven D'Aprano wrote: >>>> On Fri, 17 Jun 2016 06:13 pm, Ned Batchelder wrote: >>>> >>

Re: Method Chaining

2016-06-19 Thread Pete Forman
Rustom Mody writes: > On Saturday, June 18, 2016 at 5:34:30 PM UTC+5:30, Pete Forman wrote: >> Rustom Mody writes: >> [snip] >> >> One subtle difference between your two citations is that VB uses a >> leading dot. Might that lessening of ambiguity enable

Re: best text editor for programming Python on a Mac

2016-06-19 Thread Pete Forman
gt; about vim is that it is on every linux system, so you don't have to > load your editor if you are ssh-ing to some machine Both emacs and vim are powerful tools in the hands of experienced users but I would recommend neither to someone starting out who is just looking for a code-aware editor. Emacs and vim are much more than editors. I'm composing this message using Emacs/Gnus on a Mac. TRAMP is invaluable to me for my daily work. -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: Python packages listed in PyPI

2016-07-20 Thread Pete Forman
bundle a compiler. -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: Python packages listed in PyPI

2016-07-21 Thread Pete Forman
c in pip. If the package you are installing requires some other packages then it will install those too. -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: What is your experience porting Python 2.7.x scripts to Python 3.x?

2019-01-24 Thread Pete Forman
int reportlab will be made 3.x only which will require more > effort. Packages like reportlab with a need to support both Python 2 and 3 end up with the worst of both worlds. The initial drive for Py3k was to drop cruft that had accumulated over the years. Mixing old and new hampers your ability to write clean 3 code. -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: Replacement for pygtk?

2020-09-07 Thread Pete Forman
t PyQt. Most KDE apps do pull in > hundreds of packages, but I haven't had to install that many just to > use PyQt. Once you have one Qt app in a Gtk DE, or vice versa, then you have taken most of the hit for packages. I doubt that many people run pure versions of either. -- Pete

Re: What is Expresiveness in a Computer Language?

2005-07-10 Thread Pete Barrett
o dig the garden, but you wouldn't if a spade was available). Similarly with computer languages - some are better for certain tasks than others, but I don't think 'expressiveness' is the way to describe that. Pete Barrett -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANN] Python 2.4 Quick Reference available

2005-02-19 Thread Pete Havens
The is awesome! Thanks. I did notice one thing while reading it. In the "File Object" section, it states: "Created with built-in functions open() [preferred] or its alias file()." ...this seems to be the opposite of the Python documentation: "The file() constructor is new in Python 2.2. The prev

UML modeling tools

2005-03-02 Thread Pete Brunet
ing HTML - can round trip with Python (and C/C++) code - well recommended by other users Thanks, Pete-- http://mail.python.org/mailman/listinfo/python-list

Re: injecting "set" into 2.3's builtins?

2005-03-14 Thread Pete Forman
e cruft altogether) is likely to cause problems. I think not, certainly > based on what little surveying I've done at work. I was hoping someone else > had already tried this and could report on their experience. This is what I use to allow my 2.4 code to run on 2.3. if not 

Makeing TopLevel Modal ?

2005-04-03 Thread Pete Moscatt
) top.title("Server Settings") top.minsize(width=230,height=270) top.maxsize(width=230,height=270) Pete -- http://mail.python.org/mailman/listinfo/python-list

Testing for EOF ?

2005-04-04 Thread Pete Moscatt
I am reasonably new to python and am trying to read several lines of text from an open file. Typically in other languages I used to use code like: while not EOF() read_text_in ... How is this achieved with python ? Regards Pete -- http://mail.python.org/mailman/listinfo/python-list

Placing Toplevel over the parent ?

2005-04-05 Thread Pete Moscatt
When calling a dialog box using the Toplevel widget, how do I place it over the calling parent ? Currently when I call the dialog it appears to the side of the calling parent. Pete -- http://mail.python.org/mailman/listinfo/python-list

Re: Guessing the encoding from a BOM

2014-01-17 Thread Pete Forman
: > Table 2.4 here > http://www.unicode.org/versions/Unicode5.0.0/ch02.pdf It would have been nice if there was an eighth encoding scheme defined there UTF-8NB which would be UTF-8 with BOM not allowed. -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: Guessing the encoding from a BOM

2014-01-17 Thread Pete Forman
t; :) > > Special delivery, a berm! Were you expecting one? Endian detection: Does my BOM look big in this? -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: pytz question: GMT vs. UTC

2014-02-02 Thread Pete Forman
gt; temperatures other than 1 K. And remember to write kelvins. SI units named after people such as kelvin, watt and pascal are lower case while their symbols have a leading capital: K, W, Pa. -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: Using virtualenv to bypass sudoer issues

2014-02-10 Thread Pete Forman
hing from > execnet to fabric as well (I hate redoing stuff that works :-/ ). Call the venv version of python and activation is handled. E.g. in a fabfile myenv/bin/python myscript.py -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: Sorting dictionary by datetime value

2014-02-10 Thread pete suchsland
How about make it simple by using sorted(a.values()) ... >>> a = {} >>> a['first'] = datetime.datetime.now() >>> a['second'] = datetime.datetime.now() >>> a['third'] = datetime.datetime.now() >>> a['forth'] = datetime.datetime.now() >>> a['fifth'] = datetime.datetime.now() >>> sorted(a.values())

Re: Calculating longitudinal acceleration, lateral acceleration and normal acceleration

2016-01-24 Thread Pete Dowdell
On 24/01/16 07:27, Robert James Liguori wrote: Is there a python library to calculate longitudinal acceleration, lateral acceleration and normal acceleration? Might be rocket science... pd -- https://mail.python.org/mailman/listinfo/python-list

Re: Continuing indentation

2016-03-02 Thread Pete Forman
the letter of the law, > without really improving anything. I beg to differ. If an expression is long or complex then splitting it up and, importantly, giving good names to the intermediates makes the code clearer. That advice is not restricted to if statements. -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: pip3.x error using LIST instead of list

2014-02-12 Thread Pete Forman
my own DOS, Windows, and Linux > computers for years: > > disable the caps-lock key My solution on Windows is to turn on Toggle Keys in the Accessibility options. That beeps when the Caps Lock (or Num or Scroll) is pressed. -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: How to begin

2014-02-13 Thread pete suchsland
On Thursday, February 13, 2014 6:18:26 AM UTC-7, weixixiao wrote: > http://www.codecademy.com > > > > I have learned the basic rules of Python in this website. > > > > What should I do next?where to go? > > > > I download the Pycharm the free version and I think I dunno how to use it > e

Re: Martijn Faassen: The Call of Python 2.8

2014-04-14 Thread Pete Forman
rent answer > for the time span. Would it help if we adopted a non-numeric name for this product to support eXisting Python for those who were notified some years ago that Python 2 would be superseded? How about Python XP? I thought not ;-) -- Pete Forman -- https://mail.python.org/mailman/listinfo/python-list

Re: PyQt5 and virtualenv problem

2013-08-02 Thread Pete Forman
l works. https://pypi.python.org/pypi/PySide The Riverbank installer can install PyQt5 to your master copy of Python. You can then use the --system-site-packages flag when creating a virtualenv. The default behavior of virtualenv changed in 1.7 (2011-11-30) from including system packages

Re: Encoding of surrogate code points to UTF-8

2013-10-08 Thread Pete Forman
ated code units in other encoding forms also have no interpretation on their own. For example, the isolated byte [\x80] has no interpretation in UTF-8; it can be used only as part of a multibyte sequence. (See Table 3-7). It could be argued that this line by itself should raise an e

Re: Sudoku solver

2015-03-26 Thread Pete Forman
*|5*9|*** ***|***|418 ---+---+--- ***|*81|*** **2|***|*5* *4*|***|3** Solved, rating: dead easy Calculation took 18.006 ms 264|715|839 137|892|645 598|436|271 ---+---+--- 423|178|596 816|549|723 759|623|418 ---+---+--- 375|281|964 982|364|157 641|957|382 -- Pete Forman http://petef.22web.org/payg

Re: file.write() of non-ASCII characters differs in Interpreted Python than in script run

2015-08-26 Thread Pete Dowdell
On 26/08/15 04:19, RAH wrote: UnicodeEncodeError: 'ascii' codec can't encode character '\\xc7' in position 15: ordinal not in range(128) (Hi all, this is my first post to the list) This can be a frustrating issue to resolve, but your issue might be solved with this environment variable: P

Re: Problem working with subprocess.check_call

2015-10-29 Thread Pete Dowdell
On 29/10/15 16:52, David Aldrich wrote: Hi I am working on Linux with Python 3.4. I want to do a bash diff on two text files and show just the first 20 lines of diff’s output. So I tried: >>> cmd = 'head -20 <(diff ' + file1 + ' ' + file2 + ')' >>> subprocess.check_call(cmd, shell=True)

Re: Converting a string into a float that includes the negative

2015-11-08 Thread Pete Dowdell
On 08/11/15 09:11, phamton...@gmail.com wrote: I am having issue with converting the string into a float because there is a negative, so only end up with "ValueError: invalid literal for float(): 81.4]"81.4] The error is right there in the exception: you are trying to cast '81.4]' - that's a

Re: Extracting and summing student scores from a JSON file using Python 2.7.10

2015-11-10 Thread Pete Dowdell
On 10/11/15 08:12, Bernie Lazlo wrote: > > import json > >import urllib > >url ="http://www.wickson.net/geography_assignment.json"; > >response = urllib.urlopen(url) > >data = json.loads(response.read()) All good up to data. Now: # make a list of scores scores = [d['score'] for d in data['comme

Re: LBYL vs EAFP

2013-02-05 Thread Pete Forman
riterion depends on what your code is aiming to do with the value. BTW what if the value is Not-a-Number? ;-) -- Pete Forman -- http://mail.python.org/mailman/listinfo/python-list

zipfile and file permissions

2006-01-20 Thread Pete Forman
thing with external_attr in ZipInfo, any pointers? -- Pete Forman-./\.- Disclaimer: This post is originated WesternGeco -./\.- by myself and does not represent [EMAIL PROTECTED]-./\.- opinion of Schlumberger, Baker http://petef.port5.com -./\.- Hughe

Re: How to measure execution time of a program

2006-06-28 Thread Pete Forman
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > simplest way: > > t0 = time.time() You can get better resolution by using time.clock() instead of time.time(). -- Pete Forman-./\.- Disclaimer: This post is originated WesternGeco -.

Re: Coding style and else statements

2006-08-31 Thread Pete Forman
Ben Finney <[EMAIL PROTECTED]> writes: > Why not ensure that there is one return point from the function, so > the reader doesn't have to remind themselves to look for hidden > return points? There will always be more potential return points in languages that support

Windows upgrade incomplete

2006-12-21 Thread Pete Forman
ot; %* Presumably if I'd uninstalled the old Python first I'd have not seen this. I've amended my file type associations and all is now well. Someone might care to look at the installer. I've used the MSIs since 2.4. -- Pete Forman-./\.- Discla

Re: Internet Survey

2007-01-09 Thread Pete Fenelon
In comp.arch.embedded [EMAIL PROTECTED] wrote: > Hello all, > > I represent Octabox, an Internet Start-up developing a wide-scale Hello. F*ck off, spammer. pete -- [EMAIL PROTECTED] "he just stuck to buying beer and pointing at other stuff" -- http://mail.python.org/mail

Re: zipfile and file permissions

2006-01-23 Thread Pete Forman
Robert Kern <[EMAIL PROTECTED]> writes: > Pete Forman wrote: >> I'm trying to move the building of a zip file from a shell script into >> python. It is mostly working but when I unzip the files the UNIX >> permissions are not preserved. The zip program I've

Ovum quote about Python

2006-01-26 Thread Pete Forman
's moderately hardcore open source stuff". http://news.zdnet.co.uk/software/applications/0,39020384,39248923,00.htm -- Pete Forman-./\.- Disclaimer: This post is originated WesternGeco -./\.- by myself and does not represent [EMAIL PROTECTED]-./\.-

Re: SimplePrograms challenge

2007-06-20 Thread Pete Forman
00.0 >>> add_money([0, -13.00, 13.00]) 0.0 3) which fails :-( So both the unittest and doctest examples ought to be redone to emphasize what they are doing without getting bogged down by issues of floating point representations. http://wiki.python.org/moin/SimplePrograms -- Pe

Re: SimplePrograms challenge

2007-06-20 Thread Pete Forman
d I agree that the subtleties of floating point do > kind of cloud the issue. I welcome a better example. > What I didn't realize is that there's an actual error. > Are you saying the program fails? On which test? Python 2.5.1 on XP: Failed example: add_money([0.13, 0.0

Re: SimplePrograms challenge

2007-06-20 Thread Pete Forman
e Pythonic use of attribute (no get/set). 3) Pare some lines. -- Pete Forman-./\.- Disclaimer: This post is originated WesternGeco -./\.- by myself and does not represent [EMAIL PROTECTED]-./\.- the opinion of Schlumberger or http://petef.port5.com -./

Re: SimplePrograms challenge

2007-06-20 Thread Pete Forman
its input has an odd number of elements? But it's tough squeezing all that discourse into 13 or 14 lines ;-) BankAccount allows arbitrarily large withdrawals, is that to be fixed too? -- Pete Forman-./\.- Disclaimer: This post is originated WesternGeco -./\

  1   2   >