Re: Printing UTF-8 mail to terminal

2024-11-02 Thread Eli the Bearded via Python-list
In comp.lang.python, Gilmeh Serda wrote: > Python 3.12.6 (main, Sep 8 2024, 13:18:56) [GCC 14.2.1 20240805] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> help('modules') > > Please wait a moment while I gather a list of all available modules... > > Ass

Re: Find the path of a shell command

2022-10-13 Thread Eli the Bearded
In comp.lang.python, jkn wrote: > On Wednesday, October 12, 2022 at 6:12:23 AM UTC+1, jak wrote: >> I'm afraid you will have to look for the command in every path listed in >> the PATH environment variable. > erm, or try 'which rm' ? It is so hilarious seeing the responses to this thread. Hint:

-ffast-math

2022-09-07 Thread Eli the Bearded
https://twitter.com/moyix/status/1567167774039973888 Brendan Dolan-Gavitt @moyix New blog post is live! In which I download 4 TB of Python packages containing native x86-64 libraries and see how many of them use -ffast-math, potentially altering floating point behavior in any

news to me today: RIP Aahz

2021-11-18 Thread Eli the Bearded
Aahz, co-author of Python for Dummies with Stef Maruch, recently passed away. Tiny death notice (with name typo) from the wilds of the Internet: http://file770.com/pixel-scroll-10-15-21-i-know-what-pixel-you-scrolled-last-summer/ (12) AAHZ MARUCH (1967-2021). [Item by James Davis Nicoll.] Py

Re: The task is to invent names for things

2021-10-27 Thread Eli the Bearded
In comp.lang.python, Peter J. Holzer wrote: ^^ > On 2021-10-27 12:41:56 +0200, Karsten Hilbert wrote: >> In that situation, is it preferable to choose a nonsensical >> name over a mediocre one ? > I don't know. A mediocre name conveys at least some information, and > that seems t

Re: XML Considered Harmful

2021-09-25 Thread Eli the Bearded
In comp.lang.python, Chris Angelico wrote: > Eli the Bearded <*@eli.users.panix.com> wrote: >> I'd use one of the netpbm formats instead of JPEG. PBM for one bit >> bitmaps, PGM for one channel (typically grayscale), PPM for three >> channel RGB, and PAM for anyt

Re: XML Considered Harmful

2021-09-23 Thread Eli the Bearded
In comp.lang.python, Christian Gollwitzer wrote: > Am 22.09.21 um 16:52 schrieb Michael F. Stemper: >> On 21/09/2021 19.30, Eli the Bearded wrote: >>> Yes, CSV files can model that. But it would not be my first choice of >>> data format. (Neither would JSON.) I'

Re: XML Considered Harmful

2021-09-21 Thread Eli the Bearded
In comp.lang.python, Michael F. Stemper wrote: > I've heard of JSON, but never done anything with it. You probably have used it inadvertantly on a regular basis over the past few years. Websites live on it. > How does CSV handle hierarchical data? For instance, I have > generators[1], each of wh

Re: basic auth request

2021-08-25 Thread Eli the Bearded
In comp.lang.python, Barry wrote: > It is possible to sign an ip address in a certificate, but that is not > often done. It's bad practice. I've never seen one in the wild. > Getting to reuse the IP address that example.com was using will not help > the attacker unless they can make a cert that

Re: basic auth request

2021-08-25 Thread Eli the Bearded
In comp.lang.python, Jon Ribbens wrote: > On 2021-08-25, Eli the Bearded <*@eli.users.panix.com> wrote: >> $COMPANY puts out a lot of things on different IP addresses from >> a shared public(ish) pool like AWS and assigns different names >> to them. Later $COMPANY

Re: basic auth request

2021-08-25 Thread Eli the Bearded
In comp.lang.python, Jon Ribbens wrote: > Another attempt at combatting this problem is DNS CAA records, > which are a way of politely asking all CAs in the world except the > ones you choose "please don't issue a certificate for my domain". > By definition someone who had hacked a CA would pay n

Re: python text://protocol client?

2021-04-09 Thread Eli the Bearded
In comp.lang.python, Petite Abeille wrote: > Would you know of any python text://protocol client? Or server? The whole thing was started (judging by git commits) about a month ago. https://github.com/textprotocol?tab=overview&from=2021-03-01&to=2021-03-31 March 7: First repository I suspe

Re: A 35mm film camera represented in Python object

2021-04-01 Thread Eli the Bearded
In comp.lang.python, Richard Damon wrote: > On 4/1/21 6:41 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: >> Richard Damon wrote: >>> If you keep track of the positions as a floating point number, the >>> precision will be more than you could actually measure it. >> I won't disagree with Richard,

Re: A 35mm film camera represented in Python object

2021-03-17 Thread Eli the Bearded
In comp.lang.python, D.M. Procida wrote: > Eli the Bearded <*@eli.users.panix.com> wrote: >> I see you don't even attempt to tackle ISO outside of >> supported range (and I have no idea how the camera itself deals with >> that). Is the camera sensing the ISO f

Re: A 35mm film camera represented in Python object

2021-03-17 Thread Eli the Bearded
In comp.lang.python, D.M. Procida wrote: > Hi everyone, I've created - > a representation of a Canonet G-III QL17 in Python. > > There's also documentation: . This is interesting. Some feedback. > It's a pure P

Re: Exploring terminfo

2021-01-19 Thread Eli the Bearded
In comp.lang.python, Greg Ewing wrote: > On 18/01/21 3:34 am, Alan Gauld wrote: >> The problem is terminfo is not really part of curses. >> Curses is built on top of terminfo. > As far as I can tell from the man pages, terminfo itself > is just a file format. The only programmatic interfaces I >

Re: why sqrt is not a built-in function?

2021-01-15 Thread Eli the Bearded
In comp.lang.python, Chris Angelico wrote: > Michael F. Stemper wrote: >> On 15/01/2021 14.01, Stefan Ram wrote: >>> __import__( "math" ).sqrt( 4 ) >> I had no idea that syntax existed, and find it completely at odds >> with The Zen of Python. I'm torn between forgetting that I ever saw >> it an

Re: why sqrt is not a built-in function?

2021-01-14 Thread Eli the Bearded
In comp.lang.python, Ethan Furman wrote: > On 1/14/21 11:06 AM, Eli the Bearded wrote: >> "There should be one-- and preferably only one --obvious way to do it." >> Plus the ** operation ("root = x ** 0.5"), that's now three ways. > Yes, but which

Re: Exploring terminfo

2021-01-14 Thread Eli the Bearded
In comp.lang.python, Barry Scott wrote: > Alan Gauld via Python-list wrote: >> I've written a short program that is supposed to >> - *clear the screen*, >> - read some input >> - display the result in a message *highlighted in bold*. >> - get input to end the program > It seems that curses does

Re: why sqrt is not a built-in function?

2021-01-14 Thread Eli the Bearded
In comp.lang.python, Skip Montanaro wrote: > Finally, should have never considered it, I think you might want to > study the output of > > import this > > Think on the second and last lines in particular. >>> import this The Zen of Python, by Tim Peters Beautiful is better than ugly.

Re: Application window geometry specifier

2021-01-12 Thread Eli the Bearded
In comp.lang.python, Rich Shepard wrote: >> Keep in mind that if you target Linux, the "modern" window server >> (Wayland) will not allow user code to decide the positioning and size of > I suspect that Slackware will continue with X11. Even with traditional X11, geometry is "preferred" size and

Re: dayofyear is not great when going into a new year

2021-01-05 Thread Eli the Bearded
In comp.lang.python, Mats Wichmann wrote: > "workweeks" has always been fun, ISO standard or not, there's been a > variation for ages since people don't seem to always follow ISO for > that. I spent over a decade at a place that lived and died by their > WorkWeek references ("due WW22" or the

Re: dayofyear is not great when going into a new year

2021-01-05 Thread Eli the Bearded
In comp.lang.python, Chris Angelico wrote: > There are multiple definitions for "day of year", depending on how you > want to handle certain oddities. The simplest is to identify Jan 1st > as 1, Jan 2nd as 2, etc, to Dec 31st as either 365 or 366; but some > libraries will define the year as star

Re: Changing strings in files

2020-11-10 Thread Eli the Bearded
In comp.lang.python, Chris Angelico wrote: > Eli the Bearded <*@eli.users.panix.com> wrote: >> Read first N lines of a file. If all parse as valid UTF-8, consider it text. >> That's probably the rough method file(1) and Perl's -T use. (In >> particular a

Re: Changing strings in files

2020-11-10 Thread Eli the Bearded
In comp.lang.python, Loris Bennett wrote: > Manfred Lotz writes: > > My idea was to do > > > > - os.scandir and for each file > >- check if a file is a text file ^^ > >- if it is not a text file skip that file > >- change the string as often as it

Re: why no camelCase in PEP 8?

2020-05-18 Thread Eli the Bearded
In comp.lang.python, Paul Rubin wrote: > Eli the Bearded <*@eli.users.panix.com> writes: >> One of those is easier to "grep" for than the other. > grep -i might help. Or might not, if I want case sensitivity in the rest of my RE. Elijah -- can, but doesn&#

Re: why no camelCase in PEP 8?

2020-05-18 Thread Eli the Bearded
In comp.lang.python, Paul Rubin wrote: > I don't know if this was the explicit motivation for PEP 8, but it > has always seemed valid to me: > > https://en.wikipedia.org/wiki/Camel_case#Readability_studies There are three things cited there. One is a NYTimes story from 2009 "Against Camel Case"

news.bbs.nz is spewing duplicates to comp.lang.python

2020-04-21 Thread Eli the Bearded
This just arrived at my newserver: Path: reader2.panix.com!panix!goblin2!goblin.stu.neva.ru!news.unit0.net!2.eu.feeder.erje.net!4.us.feeder.erje.net!feeder.erje.net!xmission!csiph.com!news.bbs.nz!.POSTED.agency.bbs.nz!not-for-mail From: Eli the Bearded <*@eli.users.panix.com> (E

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-20 Thread Eli the Bearded
In comp.lang.python, wrote: > On Monday, April 20, 2020 at 5:02:23 PM UTC-4, Eli the Bearded wrote: > > For an example, back to telnet again. > > > > $ telnet example.com 80 > > Trying 255.11.22.123... > > Connected to example.com > > Escape character is &

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-20 Thread Eli the Bearded
In comp.lang.python, wrote, in reply to me: > "What do you think it is doing?" > I thought the timeout was waiting for a successful connection. A successful *connection* and a successful *authentication* are different things. $ telnet example.com 80 Trying 255.11.22.123... Connected to example

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-20 Thread Eli the Bearded
In comp.lang.python, wrote: > However, one of them immediately returns a 401. I'm using the exact > same credentials to check this site, as when loggin in. > > Also, interestingly, it returns the 401 right away. I tried setting the > timeout value for a ridiculously long time, but it passes th

Re: on sorting things

2019-12-19 Thread Eli the Bearded
In comp.lang.python, Peter Otten <__pete...@web.de> wrote: > Eli the Bearded wrote: >> But what caught my eye most, as someone relatively new to Python but >> with long experience in C in Perl, is sorting doesn't take a s/C in /C and/ Ugh. >> *comparison* fun

on sorting things

2019-12-18 Thread Eli the Bearded
I recently saw a link to an old post on a blog and then started looking at the newer posts. This one: https://leancrew.com/all-this/2019/11/the-key-to-sorting-in-python/ discusses ways to deal with useful sorting of movie / television show titles. Some initial words should be re-ordered for sorti

Re: Artifact repository?

2019-10-31 Thread Eli the Bearded
In comp.lang.python, Paul Rubin wrote: > Dan Stromberg writes: >> By an Artifact Repository, I mean something that can version largish >> binaries that are mostly produced by a build process. > I'm not familiar with the term "artifact repository" and hadn't heard of > the ones you mentioned, but

Re: How to decode UTF strings?

2019-10-26 Thread Eli the Bearded
In comp.lang.python, DFS wrote: > On 10/25/2019 10:57 PM, MRAB wrote: >> Here's a simple example, based in your code: >> >> from email.header import decode_header >> >> def test(header, default_encoding='utf-8'): >> parts = [] >> >> for data, encoding in decode_header(header): >>

Re: question about making an App for Android

2019-10-11 Thread Eli the Bearded
In comp.lang.python, Dennis Lee Bieber wrote: > pyotr filipivich declaimed the following: >> "A simple program" to divide the amount of "today's" daylight into 12 >> even '"hours", so that Dawn begins the First hour, the third hour is >> mid-morning, noon is the middle of the day, the ninth hour

Re: Generate simple image on a standalone Raspberrry Pi

2019-09-27 Thread Eli the Bearded
In comp.lang.python, Roy Hann wrote: > I am designing a mobile application to run on a Raspberry Pi 3 model B. > It will not have any Internet access. I need to generate a static image > consisting of a simple arc representing (say) a speedometer or a > pressure gauge. The image will need to be r

Re: python3 subprocess run sudo cmd in remote failed

2019-09-17 Thread Eli the Bearded
In comp.lang.python, lampahome wrote: > what I tried many times like enter password, but it failed. > I just want to use ps.stdin.write(password) to send password, but it always > jump password prompt immediately. Passwords are frequently read from stderr, not stdin, so that tools can get a huma

Re: Unicode UCS2, UCS4 and ... UCS1

2019-09-17 Thread Eli the Bearded
In comp.lang.python, moi wrote: > I hope, one day, for those who are interested in Unicode, > they find a book, publication, ... which will explain > what is UCS1. There isn't anything called UCS1. There is a UTF-1, but don't use it. UTF-8 is better in every way. https://en.wikipedia.org/wiki/U

Re: [OT(?)] Ubuntu 18 vim now defaults to 4-space tabs

2019-09-10 Thread Eli the Bearded
In comp.lang.python, Tobiah wrote: >> Your subject missed a critical word: vim. > It's there! I added it. > > Run vim. Then ':set' to see what's set different than default. Then, > > if it is tabstop you want to know about, ':verbose set tabstop?' will > > tell you where that setting was last a

Re: [OT(?)] Ubuntu 18 vim now defaults to 4-space tabs

2019-09-09 Thread Eli the Bearded
In comp.lang.python, Tobiah wrote: > We upgraded a server to 18.04 and now when I start typing Your subject missed a critical word: vim. There are a lot of editors in Ubuntu, and probably they don't all do that. > This is more of a vim question perhaps, but I'm already > subscribed here and I f

Re: Proper shebang for python3

2019-07-25 Thread Eli the Bearded
In comp.lang.python, Thomas 'PointedEars' Lahn wrote: > Michael Torrie wrote: >> On 7/24/19 4:20 PM, Cameron Simpson wrote: >>> That is some progress, hooray. Then there's just sbin -> bin to go. >> I suppose in the olden days sbin was for static binaries, […] > No, “sbin” is short for “*system*

Re: Hermetic environments

2019-07-24 Thread Eli the Bearded
In comp.lang.python, DL Neil wrote: > Is Python going 'the right way' with virtual environments? ... > Am I 'getting away with it', perhaps because my work-pattern doesn't > touch some 'gotcha' or show-stopper? > > Why, if so much of 'the rest of the world' is utilising "containers", > both fo

Re: Proper shebang for python3

2019-07-22 Thread Eli the Bearded
In comp.lang.python, Tim Daneliuk wrote: > On 7/20/19 1:20 PM, Chris Angelico wrote: > > On Sun, Jul 21, 2019 at 4:13 AM Michael Speer wrote: > >> You may want to use `#!/usr/bin/env python3` instead. I no longer have one to verify, but I recall Solaris boxen used /bin/env not /usr/bin/env. >

Re: convert .py to Android ?

2019-05-14 Thread Eli the Bearded
In comp.lang.python, Ben Finney wrote: > "Steve" writes: >> I have a working .py program >> that I want to get into my Android Moto G phone. > To my knowledge, an Android app must be implemented, at some level, in > Java and specifically linked to Android Java libraries. That's a hard > limitati

Re: Conway's game of Life, just because.

2019-05-07 Thread Eli the Bearded
In comp.lang.python, MRAB wrote: > I've never seen a version of Conway's Game of Life where the board > doesn't wrap around. The one I wrote in vi macros doesn't. It's a design choice you can make. (Thanks for the explainations everyone.) Elijah -- the vi macro one is included in the vim

Re: Conway's game of Life, just because.

2019-05-07 Thread Eli the Bearded
In comp.lang.python, Paul Rubin wrote: Thanks for posting this. I'm learning python and am very familiar with this "game". > #!/usr/bin/python3 > from itertools import chain > > def adjacents(cell):# generate coordinates of cell neighbors > x, y = cell # a cell

Re: Generating generations of files

2019-04-29 Thread Eli the Bearded
In comp.lang.python, DL Neil wrote: > On 30/04/19 10:59 AM, Chris Angelico wrote: >>> bet a FAT filesystem would produce a different error >> Probably it'd raise BadFileSystemError or something. Which is a > Fortunately, it runs on a Linux 'compute server'. I mount FAT under Linux all the time.

Re: Generating generations of files

2019-04-29 Thread Eli the Bearded
In comp.lang.python, Peter J. Holzer wrote: > On 2019-04-29 20:12:28 -, Grant Edwards wrote: >> Well, the FILES-11 filesystem on VAX/VMS did that automatically, but >> that's probably not too helpful. > Until this is finished you could use something like this: > > #!/usr/bin/python3 > > impo

Re: need help understanding: converting text to binary

2019-04-23 Thread Eli the Bearded
In comp.lang.python, Cameron Simpson wrote: > On 23Apr2019 20:35, Eli the Bearded <*@eli.users.panix.com> wrote: >> That feels entirely wrong. I don't know what b'\x9A' means without >> knowing the character set and character encoding. If the encoding is a &g

Re: need help understanding: converting text to binary

2019-04-23 Thread Eli the Bearded
In comp.lang.python, Paul Rubin wrote: > Eli the Bearded <*@eli.users.panix.com> writes: >> # decode a single hex digit >> def hord(c): ... > >def hord(c): return int(c, 16) That's a good method, thanks. > > # decode quoted printable, specificall

Re: need help understanding: converting text to binary

2019-04-23 Thread Eli the Bearded
In comp.lang.python, Chris Angelico wrote: > Have you checked to see if Python can already do this? You mention I'm sure there's a library already. I'm trying to mix library usage with my own code to get practice writing in python. In this case, I want code to deal with MIME encoding in email he

need help understanding: converting text to binary

2019-04-22 Thread Eli the Bearded
Here's some code I wrote today: -- cut here 8< -- HEXCHARS = (b'0', b'1', b'2', b'3', b'4', b'5', b'6', b'7', b'8', b'9', b'A', b'B', b'C', b'D', b'E', b'F', b'a', b'b', b'c', b'd', b'e', b'f') # decode a single hex digit def hord(c): c = ord(c) if c >= or

Re: [python-cffi] Fwd: Re: Progress migrating cffi and pycparser to libclang

2018-01-06 Thread Eli Bendersky
ase which remembers for each file what the exact flags to compile it are (https://clang.llvm.org/docs/JSONCompilationDatabase.html) To make this *really* work for CFFI you'd have to take all of this into account -- do you really want to deal with this on the CFFI level? Eli > >

Re: Different names for Unicode codepoint

2016-04-21 Thread Eli Zaretskii
> From: Lele Gaifax > Date: Thu, 21 Apr 2016 21:04:32 +0200 > Cc: python-list@python.org > > is there a particular reason for the slightly different names that Emacs > (version 25.0.92) and Python (version 3.6.0a0) give to a single Unicode > entity? They don't. > Just to mention one codepoint,

Video tutorial for making a guess the number game in python

2013-05-04 Thread eli m
I made a video tutorial for making a guess the number game in python. You can check it out here: http://www.youtube.com/watch?v=0WSQb-7wMJQ -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem this random seed()

2013-03-18 Thread eli m
On Monday, March 18, 2013 6:57:30 PM UTC-7, NZach wrote: > Hello everyone, > > > > i am using the MMK.py example from a SimPy tutorial, which can be found here: > http://heather.cs.ucdavis.edu/~matloff/156/PLN/DESimIntro.pdf > > > > I have made very little changes to the code and i have uplo

Re: Small program ideas

2013-03-18 Thread eli m
Any other ideas? -- http://mail.python.org/mailman/listinfo/python-list

Insert comma in number?

2013-03-06 Thread eli m
I have a python program that accepts input and calculates the factorial of that number, and i want to know if i can make it so commas get inserted in the number. For example: instead of 1000 it would say 1,000 -- http://mail.python.org/mailman/listinfo/python-list

Re: Input wont work with if statement if it has a space

2013-03-05 Thread eli m
On Tuesday, March 5, 2013 3:47:31 PM UTC-8, emile wrote: > On 03/05/2013 03:33 PM, eli m wrote: > > > On Tuesday, March 5, 2013 3:31:13 PM UTC-8, eli m wrote: > > >> Hi guys, i have a program like this: (A lot of code is not included) > > >> > >

Re: Input wont work with if statement if it has a space

2013-03-05 Thread eli m
On Tuesday, March 5, 2013 3:31:13 PM UTC-8, eli m wrote: > Hi guys, i have a program like this: (A lot of code is not included) > > run = 0 > > while run == 0: > >raw_input("Type in a function:") > >if function == "Example":

Input wont work with if statement if it has a space

2013-03-05 Thread eli m
Hi guys, i have a program like this: (A lot of code is not included) run = 0 while run == 0: raw_input("Type in a function:") if function == "Example": print ("Hello World!") else: print ("blah blah blah") The problem is that whenever i type in example with a space after it th

Store a variable permanently

2013-02-28 Thread eli m
So i have a variable called funds that i want to store the value of even after the program is exited. My funds variable holds the total value of funds i have. I add a certain number of funds each time i run the program by entering how much i want to add. How would i store the funds variable to k

How would you do this?

2013-02-27 Thread eli m
How would you find the slope, y intercept, and slope-intercept form equation for a line in python? -- http://mail.python.org/mailman/listinfo/python-list

Display video in tkinter?

2013-02-27 Thread eli m
Is there a way to display video (an avi) in tkinter without having to download other modules? If not then are there any other options? -- http://mail.python.org/mailman/listinfo/python-list

Re: Small program ideas

2013-02-26 Thread eli m
On Tuesday, February 26, 2013 4:22:10 PM UTC-8, Joshua Landau wrote: > On 26 February 2013 22:47, eli m wrote: > > > > > > How hard would it be to change one file to another and would it be a > small-medium sized program? > > > How do you want to change

Re: Small program ideas

2013-02-26 Thread eli m
On Monday, February 25, 2013 10:15:24 PM UTC-8, Dave Angel wrote: > On 02/25/2013 10:48 PM, eli m wrote: > > > On Friday, February 15, 2013 7:22:41 PM UTC-8, eli m wrote: > > >> Any small program ideas? I would prefer to stick to command line ones. > >> Thanks.

Re: Small program ideas

2013-02-25 Thread eli m
On Friday, February 15, 2013 7:22:41 PM UTC-8, eli m wrote: > Any small program ideas? I would prefer to stick to command line ones. Thanks. Thank you guys for the suggestions. Any more? -- http://mail.python.org/mailman/listinfo/python-list

Import Question

2013-02-20 Thread eli m
How long does it take for the program to import something? I am asking this because i have like 7 imports at the beginning of my program and i am thinking thats the reason why it is slow to start up. Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: Small program ideas

2013-02-15 Thread eli m
On Friday, February 15, 2013 7:52:57 PM UTC-8, Mitya Sirenef wrote: > On 02/15/2013 10:22 PM, eli m wrote: > > > Any small program ideas? I would prefer to stick to command line ones. > > Thanks. > > > > How about these two: > > > > - simulation

Small program ideas

2013-02-15 Thread eli m
Any small program ideas? I would prefer to stick to command line ones. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: How would you do this?

2013-02-14 Thread eli m
On Thursday, February 14, 2013 4:09:37 PM UTC-8, Oscar Benjamin wrote: > On 14 February 2013 23:34, eli m wrote: > > > I want to make a guess the number game (Which i have), but i want to make > > the computer play the game against itself. How would i do this? > >

How would you do this?

2013-02-14 Thread eli m
I want to make a guess the number game (Which i have), but i want to make the computer play the game against itself. How would i do this? -- http://mail.python.org/mailman/listinfo/python-list

Pick random choice from variables

2013-02-10 Thread eli m
How do i make something with python that will ask the user for input, and then use the random.choice function to select a random choice from what the user entered. -- http://mail.python.org/mailman/listinfo/python-list

Re: Else statement executing when it shouldnt

2013-01-21 Thread eli m
On Sunday, January 20, 2013 9:56:59 PM UTC-8, alex23 wrote: > On Jan 21, 2:40 pm, eli m wrote: > > > an else statement is running when it shouldnt be. It is > > > on the last line. Whenever i am in the math or game > > > function, when i type in main, it goes b

Re: Else statement executing when it shouldnt

2013-01-20 Thread eli m
On Sunday, January 20, 2013 8:52:12 PM UTC-8, Chris Angelico wrote: > On Mon, Jan 21, 2013 at 3:40 PM, eli m wrote: > > > an else statement is running when it shouldnt be. It is on the last line. > > Whenever i am in the math or game function, when i type in main, it goes >

Re: Else statement executing when it shouldnt

2013-01-20 Thread eli m
On Sunday, January 20, 2013 8:40:47 PM UTC-8, eli m wrote: hint: Use the comments in the code to find out where my error is. > > Here is my code: > > #Cmd > > #Created By Eli M. > > #import modules > > import random > > import math > > gtn = 0 &

Re: Else statement executing when it shouldnt

2013-01-20 Thread eli m
> > > > Your else is lined up with while, not with if. > > > > -m > > > > > > -- > > Lark's Tongue Guide to Python: http://lightbird.net/larks/ > > > > When a friend succeeds, I die a little. Gore Vidal Its lined up. It got messed up when i copied the code into the post. -- ht

Re: Else statement executing when it shouldnt

2013-01-20 Thread eli m
On Sunday, January 20, 2013 8:54:13 PM UTC-8, René Klačan wrote: > You have to break while loop not to execute else branch > > > Rene > > > Can you explain in more detail please. -- http://mail.python.org/mailman/listinfo/python-list

Else statement executing when it shouldnt

2013-01-20 Thread eli m
an else statement is running when it shouldnt be. It is on the last line. Whenever i am in the math or game function, when i type in main, it goes back to the start of the program, but it also says not a valid function. I am stumped! Here is my code: #Cmd #Created By Eli M. #import modules

Re: [Python-Dev] [RELEASED] Python 3.3.0

2012-09-29 Thread Eli Bendersky
On Sat, Sep 29, 2012 at 5:18 AM, Georg Brandl wrote: > On behalf of the Python development team, I'm delighted to announce the > Python 3.3.0 final release. > Yay :) -- http://mail.python.org/mailman/listinfo/python-list

Re: question about speed of sequential string replacement vs regex or

2011-09-28 Thread Eli the Bearded
In comp.lang.perl.misc, Willem wrote: > In Perl, it would be applicable. You see, in Perl, you can call a function > in the replacement of the regex substitution, which can then look up the > html entity and return the wanted unicode literal. A function? I'd use a hash. > I think you can do th

Re: Calling super() in __init__ of a metaclass

2011-08-06 Thread Eli Bendersky
On Sat, Aug 6, 2011 at 11:04, Chris Rebert wrote: > On Sat, Aug 6, 2011 at 12:34 AM, Eli Bendersky wrote: >> Consider this standard metaclass definition: >> >> class MyMetaclass(type): >>    def __init__(cls, name, bases, dct): >>        super(MyMetaclas

Calling super() in __init__ of a metaclass

2011-08-06 Thread Eli Bendersky
he second argument is a type, issubclass(type2, type) must be true (this is useful for classmethods). Yes, 'cls' is a type (it's "class Foo"), but no, it's not a subclass of MyMetaclass, so this doesn't help. Eli -- http://mail.python.org/mailman/listinfo/python-list

stopping a thread with _Thread__stop

2011-08-05 Thread Eli Bendersky
d. In conformance to theory, the "timelimited" method this recipe defines leaves a thread running in the background if the function it's given is long-running (or infinite). Is there something I'm missing? Eli -- http://mail.python.org/mailman/listinfo/python-list

Re: Python enabled gdb on Windows and relocation

2011-05-14 Thread Eli Zaretskii
> Date: Sat, 14 May 2011 11:09:13 +0200 > From: Ruben Van Boxem > Cc: g...@sourceware.org, python-list@python.org > > 1. Check hardcoded path; my suggestion would be " executable>/../lib/python27" > 2. If this fails to find the necessary files/scripts, find it like you > described above in Linux,

Re: Bit fields in python?

2010-09-14 Thread Eli Bendersky
e')) StatusInfo = Struct('StatusInfo', ULInt16('size'), make_codec_info('mastercodec'), make_codec_info('slavecodec'), ) c = StatusInfo.parse('\x12\x13\x01\x02

Re: Bit fields in python?

2010-09-07 Thread Eli Bendersky
ommunicate with other devices over the network or some other link. In my work with Python and embedded devices I've found the construct library (http://construct.wikispaces.com/) very useful. It allows to you very easily define complex formats for frames/messages on the bit and byte level. The idea is to use construct

Re: Python library for Sequence Matching/Comparison

2010-08-07 Thread Eli Bendersky
of sub-libraries for almost anything you might need with processing natural text. Eli -- http://mail.python.org/mailman/listinfo/python-list

Re: parsing a c project

2010-08-04 Thread Eli Bendersky
te ISO C parser in pure Python. It has been used for tasks similar to this one (parsing of struct/union declarations for various purposes). Eli -- http://mail.python.org/mailman/listinfo/python-list

co_firstlineno on decorated functions

2010-08-01 Thread Eli Bendersky
.6] The side-effects of this behavior can be easily seen in the output of modules like trace and profile. Would you say it's normal, or could this be considered a bug? Eli -- http://mail.python.org/mailman/listinfo/python-list

Re: Basic Information about Python

2010-07-30 Thread Eli Bendersky
of a simple "hello world" script packed with py2exe or PyInstaller is around 2-3 MB. If you use large GUI libraries (like PyQt or wxPython) it goes up to 6-10MB, and so on (more libraries -> larger .exe) Eli -- http://mail.python.org/mailman/listinfo/python-list

Re: Hello

2010-07-10 Thread Eli Bendersky
://wiki.python.org/moin/FrontPage) is also useful. For example, it has a rather comprehensive page about editors: http://wiki.python.org/moin/PythonEditors Eli -- http://mail.python.org/mailman/listinfo/python-list

Re: ipython problem in opening a file

2010-07-09 Thread Eli Bendersky
irectory" ipython executes in, by either executing it directly (from the command line) in the directory of your choice, or calling the os.chdir function with the path of your choice. Eli -- http://mail.python.org/mailman/listinfo/python-list

Re: ipython problem in opening a file

2010-07-09 Thread Eli Bendersky
t;os" module. You may not have permissions in C:\Windows\system32, which is why the error is printed. Eli -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorting dicts inside dicts

2010-07-03 Thread Eli Bendersky
'abc','reg_addr':'2004'},'reg_dict_2':{'name':'pqr','reg_addr':'2008'}}*/ >> /* >> */ >> >> Is it possible to sort the things? What I guess is Python stores dicts in >> a tree like structu

accuracy issues with numpy arrays?

2008-04-29 Thread eli
image) print x 1.7400700016878545e-05 The script is below. Thanks for the help. Eli import pyfits as p import scipy as s import scipy.ndimage as nd import numpy as n def flux2int(name): d = p.getdata(name) x,y = n.shape(d) l = x*y arr1= n.array(d.reshape(

Re: subplot function in matplotlib

2008-04-16 Thread eli
On Apr 16, 8:27 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > eli wrote: > > Does anyone know a workaround to plotting beyond 9 subplots in > > matplotlib? It would be nice to have 20 plots under the subplot > > function for example (poster). > >

subplot function in matplotlib

2008-04-15 Thread eli
Does anyone know a workaround to plotting beyond 9 subplots in matplotlib? It would be nice to have 20 plots under the subplot function for example (poster). Cheers, Eli -- http://mail.python.org/mailman/listinfo/python-list

XML-RPC SSL and client side certs?

2007-04-10 Thread Eli Criffield
e setting it up here soon, but would be interested if anyone else has already written a solution like this or has used one (in python of course). Eli Criffield -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >