Re: newbie

2020-09-10 Thread edmondo . giovannozzi
You can also have a look at www.scipy.org where you can find some packages used for scientific programming like numpy, scipy, matplotlib. The last one is a graphic package that may be useful to make some initial plots. Il giorno martedì 8 settembre 2020 22:57:36 UTC+2, Don Edwards ha scritto: >

Re: newbie

2020-09-09 Thread Michael Torrie
On 9/8/20 7:24 PM, Grant Edwards wrote: > On 2020-09-08, Don Edwards wrote: > >> I may need. My aim is to write a program >> that simulates croquet - 2 balls colliding with the strikers (cue) ball >> going into the hoop (pocket), not the target ball. I want to be able to >> move the balls around

Re: newbie

2020-09-08 Thread Cameron Simpson
On 09Sep2020 01:24, Grant Edwards wrote: >On 2020-09-08, Don Edwards wrote: >> I may need. My aim is to write a program >> that simulates croquet - 2 balls colliding with the strikers (cue) ball >> going into the hoop (pocket), not the target ball. I want to be able to >> move the balls around an

Re: newbie

2020-09-08 Thread Grant Edwards
On 2020-09-08, Don Edwards wrote: > I may need. My aim is to write a program > that simulates croquet - 2 balls colliding with the strikers (cue) ball > going into the hoop (pocket), not the target ball. I want to be able to > move the balls around and draw trajectory lines to evaluate different

Re: newbie

2020-09-08 Thread Cameron Simpson
On 08Sep2020 10:22, Don Edwards wrote: >Purchased the book python-basics-2020-05-18.pdf a few days ago. >To direct my learning I have a project in mind as per below; A project is an excellent way to learn something; personally I find it hard to learn something without something to which to apply

Re: NEWBIE: how to get text onto 2 lines on a 16x2 lcd display

2019-09-28 Thread RobH
On 28/09/2019 15:59, Dennis Lee Bieber wrote: On Fri, 27 Sep 2019 19:46:58 +0100, RobH declaimed the following: Thanks for all that information, but first of all using just import adafruit blinka did not work as it returned bas: import: command not found. Were you in the Python3 in

Re: NEWBIE: how to get text onto 2 lines on a 16x2 lcd display

2019-09-27 Thread RobH
On 27/09/2019 15:28, Dennis Lee Bieber wrote: On Fri, 27 Sep 2019 10:48:29 +0100, RobH declaimed the following: Ok, the adafruit_character_lcd is in the same directory as yours, and so is Blinka and Purio. It seems to be a bit of a long path to type to get to the Adafruit_Charlcd directory, bu

Re: NEWBIE: how to get text onto 2 lines on a 16x2 lcd display

2019-09-27 Thread RobH
On 27/09/2019 04:51, Dennis Lee Bieber wrote: On Thu, 26 Sep 2019 23:04:15 +0100, RobH declaimed the following: As I said, I have downloaded the circuitpython chalcd files from the link using pip3 install, but after downloading I can't find any Adafruit folders on my pi zero. Doing a search

Re: NEWBIE: how to get text onto 2 lines on a 16x2 lcd display

2019-09-26 Thread DL Neil via Python-list
On 27/09/19 7:21 AM, RobH wrote: On 26/09/2019 17:51, Dennis Lee Bieber wrote: On Thu, 26 Sep 2019 11:58:15 +0100, RobH declaimed the following: ... Check out this guide for info on using character LCDs with the CircuitPython library: https://learn.adafruit.com/character-lcds/python-circuit

Re: NEWBIE: how to get text onto 2 lines on a 16x2 lcd display

2019-09-26 Thread RobH
On 26/09/2019 20:21, RobH wrote: On 26/09/2019 17:51, Dennis Lee Bieber wrote: On Thu, 26 Sep 2019 11:58:15 +0100, RobH declaimed the following: import Adafruit_CharLCD as LCD FYI: from Adafruit's download site: https://github.com/adafruit/Adafruit_Python_CharLCD """ DEPRECATED LIBR

Re: NEWBIE: how to get text onto 2 lines on a 16x2 lcd display

2019-09-26 Thread RobH
On 26/09/2019 17:51, Dennis Lee Bieber wrote: On Thu, 26 Sep 2019 11:58:15 +0100, RobH declaimed the following: import Adafruit_CharLCD as LCD FYI: from Adafruit's download site: https://github.com/adafruit/Adafruit_Python_CharLCD """ DEPRECATED LIBRARY. Adafruit Python CharLCD T

Re: NEWBIE: how to get text onto 2 lines on a 16x2 lcd display

2019-09-26 Thread RobH
On 26/09/2019 15:22, Chris Angelico wrote: On Thu, Sep 26, 2019 at 9:01 PM RobH wrote: import Adafruit_CharLCD as LCD # Raspberry Pi pin configuration: Ah, it's an RPi with Adafruit. That's the same library that my brother uses. I don't know much of the details, but in case it's helpful, h

Re: NEWBIE: how to get text onto 2 lines on a 16x2 lcd display

2019-09-26 Thread RobH
On 26/09/2019 12:55, Rhodri James wrote: On 26/09/2019 11:58, RobH wrote: Thanks, but was is Python REPR. DL was referring to the interactive program you get when you type "python" at a Linux or Windows command prompt.  Here's an example, copied from my Linux box: rhodri@scrote:~$ python P

Re: NEWBIE: how to get text onto 2 lines on a 16x2 lcd display

2019-09-26 Thread Chris Angelico
On Thu, Sep 26, 2019 at 9:01 PM RobH wrote: > > import Adafruit_CharLCD as LCD > > > # Raspberry Pi pin configuration: Ah, it's an RPi with Adafruit. That's the same library that my brother uses. I don't know much of the details, but in case it's helpful, here's the code that currently runs his s

Re: NEWBIE: how to get text onto 2 lines on a 16x2 lcd display

2019-09-26 Thread Rhodri James
On 26/09/2019 11:58, RobH wrote: Thanks, but was is Python REPR. DL was referring to the interactive program you get when you type "python" at a Linux or Windows command prompt. Here's an example, copied from my Linux box: rhodri@scrote:~$ python Python 2.7.15+ (default, Jul 9 2019, 16:51

Re: NEWBIE: how to get text onto 2 lines on a 16x2 lcd display

2019-09-26 Thread RobH
On 26/09/2019 11:08, DL Neil wrote: On 26/09/19 9:14 PM, RobH wrote: I have some sample/demo python code for scrolling and outputting text onto a 16x2 lcd display. I would like to put my own message or text outputting to the lcd on 2 lines. I have tried using lcd.message('my message',1) and

Re: NEWBIE: how to get text onto 2 lines on a 16x2 lcd display

2019-09-26 Thread DL Neil via Python-list
On 26/09/19 9:14 PM, RobH wrote: I have some sample/demo python code for scrolling and outputting text onto a 16x2 lcd display. I would like to put my own message or text outputting to the lcd on 2 lines. I have tried using lcd.message('my message',1) and lcd.message('my message', 2), but the

Re: Newbie question about Python syntax

2019-08-26 Thread Paul St George
On 25/08/2019 02:39, Cameron Simpson wrote: On 24Aug2019 21:52, Paul St George wrote: [snip]> Aside from "map" being a poor name (it is also a builtin Python function), it seems that one creates one of these to control how some rendering process is done. The class reference page you origina

Re: Newbie question about Python syntax

2019-08-24 Thread Cameron Simpson
On 24Aug2019 21:52, Paul St George wrote: Have you not got one of these handed to you from something? Or are you right at the outside with some "opaque" blender handle or something? (Disclaimer: I've never used Blender.) Thank you once again. If I understand your question, I am right outside

Re: Newbie question about Python syntax

2019-08-24 Thread Barry
Have you tried asking on a blender user mailing list for help with this problem? It seems that someone familiar with blender and its python interface should be able to help get you going. Barry > On 24 Aug 2019, at 20:52, Paul St George wrote: > >> On 24/08/2019 01:23, Cameron Simpson wrote:

Re: Newbie question about Python syntax

2019-08-24 Thread Paul St George
On 24/08/2019 01:23, Cameron Simpson wrote: On 23Aug2019 13:49, Paul St George wrote: Context: I am using Python to interrogate the value of some thing in Blender (just as someone else might want to use Python to look at an email in a Mail program or an image in Photoshop). Assumptions: So,

Re: Newbie question about Python syntax

2019-08-23 Thread Cameron Simpson
On 23Aug2019 13:49, Paul St George wrote: Context: I am using Python to interrogate the value of some thing in Blender (just as someone else might want to use Python to look at an email in a Mail program or an image in Photoshop). Assumptions: So, I want to look at the attribute of an instan

Re: Newbie question about Python syntax

2019-08-23 Thread Paul St George
On 22/08/2019 23:21, Kyle Stanley wrote: [snip] The tutorial that Terry was referring to was the one on docs.python.org, here's a couple of links for the sections he was referring to: Full section on classes: https://docs.python.org/3/tutorial/classes.html Section on instantiating objects from

Re: Newbie question about Python syntax

2019-08-22 Thread Kyle Stanley
> You are right, but it is even worse than you think. I do not have a tutorial so I have no examples to understand. The tutorial that Terry was referring to was the one on docs.python.org, here's a couple of links for the sections he was referring to: Full section on classes: https://docs.python.

Re: Newbie question about Python syntax

2019-08-22 Thread Paul St George
On 22/08/2019 20:02, Terry Reedy wrote: On 8/22/2019 3:34 AM, Paul St George wrote: I have the Python API for the Map Value Node here: . All well and good. Now I just want to write a simple line of code such as: i

Re: Newbie question about Python syntax

2019-08-22 Thread Terry Reedy
On 8/22/2019 3:34 AM, Paul St George wrote: I have the Python API for the Map Value Node here: . All well and good. Now I just want to write a simple line of code such as: import bpy ... >>>print(bpy.types.Composi

Re: Newbie question about Python syntax

2019-08-22 Thread Chris Angelico
On Thu, Aug 22, 2019 at 9:20 PM Paul St George wrote: > > On 22/08/2019 11:49, Cameron Simpson wrote: > > On 22Aug2019 09:34, Paul St George wrote: > >> I have the Python API for the Map Value Node here: > >> . > >> > >>

Re: Newbie question about Python syntax

2019-08-22 Thread Paul St George
On 22/08/2019 11:49, Cameron Simpson wrote: On 22Aug2019 09:34, Paul St George wrote: I have the Python API for the Map Value Node here: . All well and good. Now I just want to write a simple line of code such as:

Re: Newbie question about Python syntax

2019-08-22 Thread Cameron Simpson
On 22Aug2019 09:34, Paul St George wrote: I have the Python API for the Map Value Node here: . All well and good. Now I just want to write a simple line of code such as: import bpy print(bpy.types.CompositorNodeMapVa

Re: newbie question

2019-08-01 Thread Sidney Langweil
On Thursday, August 1, 2019 at 7:57:31 AM UTC-7, Calvin Spealman wrote: > Sorry, but you can't. If you have two python modules, neither has access to > things in the other without an import. > > That's the whole point of an import. > > On Thu, Aug 1, 2019 at 10:30 AM Sidney Langweil > wrote: >

Re: newbie question

2019-08-01 Thread Calvin Spealman
Sorry, but you can't. If you have two python modules, neither has access to things in the other without an import. That's the whole point of an import. On Thu, Aug 1, 2019 at 10:30 AM Sidney Langweil wrote: > A Python script invokes a function in another file in the same directory. > > I would

Re: RE newbie question

2018-04-18 Thread Steven D'Aprano
On Wed, 18 Apr 2018 12:37:29 -0700, TUA wrote: > My intention is to implement a max. length of 8 for an input string. The > above works well in all other respects, but does allow for strings that > are too long. if len(input_string) > 8: raise ValueError('string is too long') -- Steve --

Re: RE newbie question

2018-04-18 Thread Albert-Jan Roskam
On Apr 18, 2018 21:42, TUA wrote: > > import re > > compval = 'A123456_8' > regex = '[a-zA-Z]\w{0,7}' > > if re.match(regex, compval): >print('Yes') > else: >print('No') > > > My intention is to implement a max. length of 8 for an input string. The > above works well in all other respect

Re: RE newbie question

2018-04-18 Thread TUA
Thanks much! -- https://mail.python.org/mailman/listinfo/python-list

Re: RE newbie question

2018-04-18 Thread Ian Kelly
On Wed, Apr 18, 2018 at 1:57 PM, Rob Gaddi wrote: > On 04/18/2018 12:37 PM, TUA wrote: >> >> import re >> >> compval = 'A123456_8' >> regex = '[a-zA-Z]\w{0,7}' >> >> if re.match(regex, compval): >> print('Yes') >> else: >> print('No') >> >> >> My intention is to implement a max. length of

Re: RE newbie question

2018-04-18 Thread Rob Gaddi
On 04/18/2018 12:37 PM, TUA wrote: import re compval = 'A123456_8' regex = '[a-zA-Z]\w{0,7}' if re.match(regex, compval): print('Yes') else: print('No') My intention is to implement a max. length of 8 for an input string. The above works well in all other respects, but does allow for

RE newbie question

2018-04-18 Thread TUA
import re compval = 'A123456_8' regex = '[a-zA-Z]\w{0,7}' if re.match(regex, compval): print('Yes') else: print('No') My intention is to implement a max. length of 8 for an input string. The above works well in all other respects, but does allow for strings that are too long. What is

Re: [newbie] how to remove empty lines from webpage/file

2018-02-27 Thread Dan Stromberg
Perhaps replace: lines=soup.get_text() file.write(lines) ...with something like: text = soup.get_text() lines = text.split('\n') for line in lines: if line.strip(): file.write('%s\n' % (line, )) (untested) On Tue, Feb 27, 2018 at 2:50 AM, wrote: > Dear all, > I try to get the nume

Re: Newbie problem with urllib.request.urlopen

2017-09-26 Thread Bernie Connors
On Tuesday, September 26, 2017 at 12:32:18 PM UTC-3, Bernie Connors wrote: > Hello, > > My first post here on C.L.P. I have only written a few python scripts > in 2.7 and now I'm trying my first python 3 script. Can you tell me why this > snippet won't run? > --- > fr

Re: Newbie problem with urllib.request.urlopen

2017-09-26 Thread Peter Otten
Bernie Connors wrote: > On Tuesday, September 26, 2017 at 12:32:18 PM UTC-3, Bernie Connors wrote: >> Hello, >> >> My first post here on C.L.P. I have only written a few python >> scripts in 2.7 and now I'm trying my first python 3 script. Can >> you tell me why this snippet w

Re: Newbie problem with urllib.request.urlopen

2017-09-26 Thread Bernie Connors
On Tuesday, September 26, 2017 at 12:32:18 PM UTC-3, Bernie Connors wrote: > Hello, > > My first post here on C.L.P. I have only written a few python scripts > in 2.7 and now I'm trying my first python 3 script. Can you tell me why this > snippet won't run? > --- > fr

Re: Newbie problem with urllib.request.urlopen

2017-09-26 Thread MRAB
On 2017-09-26 16:31, berniejconn...@gmail.com wrote: Hello, My first post here on C.L.P. I have only written a few python scripts in 2.7 and now I'm trying my first python 3 script. Can you tell me why this snippet won't run? --- from urllib.request import urlopen

Re: Newbie problem with urllib.request.urlopen

2017-09-26 Thread Thomas Jollans
On 2017-09-26 17:31, berniejconn...@gmail.com wrote: > Hello, > > My first post here on C.L.P. I have only written a few python scripts > in 2.7 and now I'm trying my first python 3 script. Can you tell me why this > snippet won't run? What do you mean, "won't run"? Is there an error me

Re: newbie question re classes and self

2017-03-29 Thread Rick Johnson
On Tuesday, March 28, 2017 at 3:09:45 AM UTC-5, loial wrote: > Can I pass self(or all its variables) to a class? > Basically, how do I make all the variables defined in self > in the calling python script available to the python class > I want to call? Your question, as presented, is difficult to

Re: newbie question re classes and self

2017-03-28 Thread Terry Reedy
On 3/28/2017 4:09 AM, loial wrote: Can I pass self(or all its variables) to a class? In Python, every argument to every function is an instance of some class. The function can access any attribute of the arguments it receives with arg.attribute. -- Terry Jan Reedy -- https://mail.python.o

Re: newbie question re classes and self

2017-03-28 Thread Peter Otten
loial wrote: > Can I pass self(or all its variables) to a class? > > Basically, how do I make all the variables defined in self in the calling > python script available to the python class I want to call? Inside a method you can access attributes of an instance as self.whatever: >>> class A: ..

Re: Newbie Need Help On Regex!

2016-10-10 Thread breamoreboy
On Monday, October 10, 2016 at 3:58:56 PM UTC+1, infos...@gmail.com wrote: > Hey guys! > > I am new to learning regex in python and I'm wondering how do I use regex in > python to store the integers(positive and negative) i want into a list! > > For e.g. > > This is the data in a list. > >

Re: newbie question

2016-03-29 Thread Sven R. Kunze
On 28.03.2016 17:34, ast wrote: "Matt Wheeler" a écrit dans le message de news:mailman.92.1458825746.2244.python-l...@python.org... On Thu, 24 Mar 2016 11:10 Sven R. Kunze, wrote: On 24.03.2016 11:57, Matt Wheeler wrote: import ast s = "(1, 2, 3, 4)" t = ast.literal_eval(s

Re: [newbie] tkFileDialog does not show title

2016-03-28 Thread jenswaelkens
Op dinsdag 29 maart 2016 00:29:29 UTC+2 schreef Peter Pearson: > On Mon, 28 Mar 2016 14:10:28 -0700 (PDT), jenswaelk...@gmail.com wrote: > > I'm using the tkFileDialog-module in Python 2.7, it works fine except > > for one thing: when I add a title, the title isn't shown. > > > > e.g. I have this l

Re: [newbie] tkFileDialog does not show title

2016-03-28 Thread Peter Pearson
On Mon, 28 Mar 2016 14:10:28 -0700 (PDT), jenswaelk...@gmail.com wrote: > I'm using the tkFileDialog-module in Python 2.7, it works fine except > for one thing: when I add a title, the title isn't shown. > > e.g. I have this line of code: > inputfilename=tkFileDialog.askopenfilename(defaultextensio

Re: [newbie] tkFileDialog does not show title

2016-03-28 Thread Wildman via Python-list
On Mon, 28 Mar 2016 14:10:28 -0700, jenswaelkens wrote: > I'm using the tkFileDialog-module in Python 2.7, it works fine except for one > thing: when I add a title, the title isn't shown. > > e.g. I have this line of code: > inputfilename=tkFileDialog.askopenfilename(defaultextension=".dat", >

Re: newbie question

2016-03-28 Thread ast
"Matt Wheeler" a écrit dans le message de news:mailman.92.1458825746.2244.python-l...@python.org... On Thu, 24 Mar 2016 11:10 Sven R. Kunze, wrote: On 24.03.2016 11:57, Matt Wheeler wrote: import ast s = "(1, 2, 3, 4)" t = ast.literal_eval(s) t > (1, 2, 3, 4) I suppose

Re: newbie question

2016-03-24 Thread Sven R. Kunze
On 24.03.2016 14:22, Matt Wheeler wrote: On Thu, 24 Mar 2016 11:10 Sven R. Kunze, wrote: On 24.03.2016 11:57, Matt Wheeler wrote: import ast s = "(1, 2, 3, 4)" t = ast.literal_eval(s) t (1, 2, 3, 4) I suppose that's the better solution in terms of safety. It has the added advantage that t

Re: newbie question

2016-03-24 Thread Grant Edwards
On 2016-03-24, Steven D'Aprano wrote: > On Thu, 24 Mar 2016 09:49 pm, David Palao wrote: > >> Hi, >> Use "eval": >> s = "(1, 2, 3, 4)" >> t = eval(s) > > Don't use eval unless you absolutely, categorically, 100% trust the source > of the string. And then still don't use it. :) eval is only safe

Re: newbie question

2016-03-24 Thread Steven D'Aprano
On Thu, 24 Mar 2016 09:49 pm, David Palao wrote: > Hi, > Use "eval": > s = "(1, 2, 3, 4)" > t = eval(s) Don't use eval unless you absolutely, categorically, 100% trust the source of the string. Otherwise, you are letting the person who provided the string run any code they like on your computer.

Re: newbie question

2016-03-24 Thread Matt Wheeler
On Thu, 24 Mar 2016 11:10 Sven R. Kunze, wrote: > On 24.03.2016 11:57, Matt Wheeler wrote: > import ast > s = "(1, 2, 3, 4)" > t = ast.literal_eval(s) > t > > (1, 2, 3, 4) > > I suppose that's the better solution in terms of safety. > It has the added advantage that the enqui

Re: newbie question

2016-03-24 Thread Steven D'Aprano
On Thu, 24 Mar 2016 09:39 pm, ast wrote: > Hi > > I have a string which contains a tupe, eg: > > s = "(1, 2, 3, 4)" > > and I want to recover the tuple in a variable t > > t = (1, 2, 3, 4) > > how would you do ? py> import ast py> ast.literal_eval("(1, 2, 3, 4)") (1, 2, 3, 4) -- Steven

Re: newbie question

2016-03-24 Thread Sven R. Kunze
On 24.03.2016 11:57, Matt Wheeler wrote: import ast s = "(1, 2, 3, 4)" t = ast.literal_eval(s) t (1, 2, 3, 4) I suppose that's the better solution in terms of safety. -- https://mail.python.org/mailman/listinfo/python-list

Re: newbie question

2016-03-24 Thread Tim Chase
On 2016-03-24 11:49, David Palao wrote: >> s = "(1, 2, 3, 4)" >> >> and I want to recover the tuple in a variable t >> >> t = (1, 2, 3, 4) >> >> how would you do ? > > Use "eval": > s = "(1, 2, 3, 4)" > t = eval(s) Using eval() has security implications. Use ast.literal_eval for safety instead:

Re: newbie question

2016-03-24 Thread Matt Wheeler
>>> import ast >>> s = "(1, 2, 3, 4)" >>> t = ast.literal_eval(s) >>> t (1, 2, 3, 4) On 24 March 2016 at 10:39, ast wrote: > Hi > > I have a string which contains a tupe, eg: > > s = "(1, 2, 3, 4)" > > and I want to recover the tuple in a variable t > > t = (1, 2, 3, 4) > > how would you do ? > >

Re: newbie question

2016-03-24 Thread ast
"David Palao" a écrit dans le message de news:mailman.86.1458816553.2244.python-l...@python.org... Hi, Use "eval": s = "(1, 2, 3, 4)" t = eval(s) Best Thank you -- https://mail.python.org/mailman/listinfo/python-list

Re: newbie question

2016-03-24 Thread David Palao
Hi, Use "eval": s = "(1, 2, 3, 4)" t = eval(s) Best 2016-03-24 11:39 GMT+01:00 ast : > Hi > > I have a string which contains a tupe, eg: > > s = "(1, 2, 3, 4)" > > and I want to recover the tuple in a variable t > > t = (1, 2, 3, 4) > > how would you do ? > > > -- > https://mail.python.org/mailma

Re: [Newbie] Tkinter Question

2016-02-25 Thread Randy Day
In article , best_...@yahoo.com says... [snip] > Anyway, I am happy with the outcome even though I have > not found a way to detect when the program is force > killed. It is unlikely that would ever occur as long When your peogram starts, have it create a small file. As part of your graceful s

Re: [Newbie] Tkinter Question

2016-02-24 Thread Wildman via Python-list
On Tue, 23 Feb 2016 16:19:43 -0600, Wildman wrote: > Thanks to Christian and Chris. You both gave me much to think about and to experiment with. That adds to my on-going learning experience. This is the first thing I tried: The Exit button has this: command=self.quit Then I have this: def

Re: [Newbie] Tkinter Question

2016-02-23 Thread Chris Kaynor
On Tue, Feb 23, 2016 at 2:19 PM, Wildman via Python-list < python-list@python.org> wrote: > I am familiar with OO programming but I am new to Python > and Tkinter. I am working on a gui program that creates > a couple of temporary files. As part of the Exit button > command they are deleted. If

Re: [Newbie] Tkinter Question

2016-02-23 Thread Christian Gollwitzer
Am 23.02.16 um 23:19 schrieb Wildman: I am familiar with OO programming but I am new to Python and Tkinter. I am working on a gui program that creates a couple of temporary files. As part of the Exit button command they are deleted. If the program is shut down using the window close button [X]

Re: [newbie] Problem with matplotlib

2016-02-20 Thread jenswaelkens
Op zaterdag 20 februari 2016 09:43:35 UTC+1 schreef Mark Lawrence: > On 20/02/2016 07:42, jenswaelk...@gmail.com wrote: > > When I use either of the following commands I get an error for which I > > don't have a solution, could someone here help me further? > > These are the commands: > > import m

Re: [newbie] Problem with matplotlib

2016-02-20 Thread jenswaelkens
Op zaterdag 20 februari 2016 09:50:05 UTC+1 schreef Dave Farrance: > It occurs to me now that the trackback might misidentify the module in > use, if say, you'd named a file "numbers.py" then got rid of it later > leaving a "numbers.pyc" somewhere. If so, see where it is: > > import numbers > prin

Re: [newbie] Problem with matplotlib

2016-02-20 Thread Dave Farrance
Dave Farrance wrote: >It occurs to me now that the trackback might misidentify the module in >use, if say, you'd named a file "numbers.py" then got rid of it later >leaving a "numbers.pyc" somewhere. If so, see where it is: > >import numbers >print numbers.__file__ I seem to have "numbers" on th

Re: [newbie] Problem with matplotlib

2016-02-20 Thread Dave Farrance
It occurs to me now that the trackback might misidentify the module in use, if say, you'd named a file "numbers.py" then got rid of it later leaving a "numbers.pyc" somewhere. If so, see where it is: import numbers print numbers.__file__ -- https://mail.python.org/mailman/listinfo/python-list

Re: [newbie] Problem with matplotlib

2016-02-20 Thread Mark Lawrence
On 20/02/2016 07:42, jenswaelk...@gmail.com wrote: When I use either of the following commands I get an error for which I don't have a solution, could someone here help me further? These are the commands: import matplotlib.pyplot as plt Are you certain that this is what you typed? C:\Users\Ma

Re: [newbie] Problem with matplotlib

2016-02-20 Thread Dave Farrance
jenswaelk...@gmail.com wrote: > File "/usr/lib/python2.7/decimal.py", line 3744, in >_numbers.Number.register(Decimal) >AttributeError: 'module' object has no attribute 'Number' Your decimal module seems broken. Confirm that in the Python shell: import numbers print numbers.Number I'm gue

Re: newbie. how can i solve this looping problem?

2016-02-09 Thread asdasdqeqe
http://pastebin.com/uQSW5iwZ here's the part of the code which I would like to change. I don't know how to get the following line to not "Timeout" and instead continue onwards to printTweet(driver) elem = WebDriverWait(driver,10).until(EC.visibility_of_element_located((By.CSS_SELECTOR,lastTwee

Re: newbie. how can i solve this looping problem?

2016-02-09 Thread Joel Goldstick
On Tue, Feb 9, 2016 at 5:49 AM, wrote: > http://pastebin.com/Khrm3gHq > > for the code above, everytime it scraps off tweets and loads the next 13 > tweets, it'll re-run through the previous scrapped tweets before recording > the new ones. I'm up to 700 over tweets and it'll keep re-running the >

Re: [newbie] how to create log files

2016-02-09 Thread Mark Lawrence
On 09/02/2016 09:33, jenswaelk...@gmail.com wrote: Hello and welcome. When I run my Python scripts from the command prompt in Linux, I can make visible all kinds of information I want to check by using print statements e.g. print (top.winfo_width()), this is very useful when debugging. However

Re: [newbie] how to create log files

2016-02-09 Thread marco . nawijn
Hello Jens, Are you aware of Python's own logging facility? It is quite powerful and flexible. Python 2: https://docs.python.org/2/library/logging.html Python 3: https://docs.python.org/3/library/logging.html Marco -- https://mail.python.org/mailman/listinfo/python-list

Re: [newbie] problem with geometry setting in Tkinter

2016-02-08 Thread Christian Gollwitzer
Am 08.02.16 um 15:34 schrieb jenswaelk...@gmail.com: Op maandag 8 februari 2016 13:26:56 UTC+1 schreef Peter Otten: jenswaelk...@gmail.com wrote: I'm trying to set the geometry of my top window, but the size is unaffected. This is the code: top.geometry('900x460') thanks a lot for helpi

Re: [newbie] problem with geometry setting in Tkinter

2016-02-08 Thread jenswaelkens
Op maandag 8 februari 2016 13:26:56 UTC+1 schreef Peter Otten: > jenswaelk...@gmail.com wrote: > > > I'm trying to set the geometry of my top window, but the size is > > unaffected. > > This is the code: > > > > #!/usr/bin/env python > > import Tkinter > > top=Tkinter.Tk() > > top.geometry=('900x

Re: [newbie] problem with geometry setting in Tkinter

2016-02-08 Thread Peter Otten
jenswaelk...@gmail.com wrote: > I'm trying to set the geometry of my top window, but the size is > unaffected. > This is the code: > > #!/usr/bin/env python > import Tkinter > top=Tkinter.Tk() > top.geometry=('900x460') That's an assignment, but geometry() is a method that you have to invoke: t

Re: Newbie: Check first two non-whitespace characters

2016-01-01 Thread Karim
On 01/01/2016 00:25, Mark Lawrence wrote: On 31/12/2015 18:54, Karim wrote: On 31/12/2015 19:18, otaksoftspamt...@gmail.com wrote: I need to check a string over which I have no control for the first 2 non-white space characters (which should be '[{'). The string would ideally be: '[{...' b

Re: Newbie: Check first two non-whitespace characters

2016-01-01 Thread Jussi Piitulainen
otaksoftspamt...@gmail.com writes: > I need to check a string over which I have no control for the first 2 > non-white space characters (which should be '[{'). > > The string would ideally be: '[{...' but could also be something like > ' [ { '. > > Best to use re and how? Something else?

Re: Newbie: Check first two non-whitespace characters

2015-12-31 Thread Cameron Simpson
On 31Dec2015 18:38, MRAB wrote: On 2015-12-31 18:18, otaksoftspamt...@gmail.com wrote: I need to check a string over which I have no control for the first 2 non-white space characters (which should be '[{'). The string would ideally be: '[{...' but could also be something like ' [ { '.

Re: Newbie: Check first two non-whitespace characters

2015-12-31 Thread Random832
otaksoftspamt...@gmail.com writes: > I need to check a string over which I have no control for the first 2 > non-white space characters (which should be '[{'). > > The string would ideally be: '[{...' but could also be something like > ' [ { '. > > Best to use re and how? Something else? I

Re: Newbie: Check first two non-whitespace characters

2015-12-31 Thread Steven D'Aprano
On Fri, 1 Jan 2016 05:18 am, otaksoftspamt...@gmail.com wrote: > I need to check a string over which I have no control for the first 2 > non-white space characters (which should be '[{'). > > The string would ideally be: '[{...' but could also be something like > ' [ { '. > > Best to use

Re: Newbie: Check first two non-whitespace characters

2015-12-31 Thread Steven D'Aprano
On Fri, 1 Jan 2016 10:25 am, Mark Lawrence wrote: > Congratulations for writing up one of the most overengineered pile of > cobblers I've ever seen. You should get out more. -- Steven -- https://mail.python.org/mailman/listinfo/python-list

Re: Newbie: Check first two non-whitespace characters

2015-12-31 Thread Mark Lawrence
On 31/12/2015 18:54, Karim wrote: On 31/12/2015 19:18, otaksoftspamt...@gmail.com wrote: I need to check a string over which I have no control for the first 2 non-white space characters (which should be '[{'). The string would ideally be: '[{...' but could also be something like ' [ {

Re: Newbie: Check first two non-whitespace characters

2015-12-31 Thread Denis McMahon
On Thu, 31 Dec 2015 10:18:52 -0800, otaksoftspamtrap wrote: > Best to use re and how? Something else? Split the string on the space character and check the first two non blank elements of the resulting list? Maybe something similar to the following: if [x for x in s.split(' ') if x != ''][0:3]

Re: Newbie: Check first two non-whitespace characters

2015-12-31 Thread Cory Madden
I would personally use re here. test_string = ' [{blah blah blah' matches = re.findall(r'[^\s]', t) result = ''.join(matches)[:2] >> '[{' On Thu, Dec 31, 2015 at 10:18 AM, wrote: > I need to check a string over which I have no control for the first 2 > non-white space characters (which should

Re: Newbie: Check first two non-whitespace characters

2015-12-31 Thread cassius . fechter
Thanks much to both of you! On Thursday, December 31, 2015 at 11:05:26 AM UTC-8, Karim wrote: > On 31/12/2015 19:54, Karim wrote: > > > > > > On 31/12/2015 19:18, snailp...@gmail.com wrote: > >> I need to check a string over which I have no control for the first 2 > >> non-white space characters

Re: Newbie: Check first two non-whitespace characters

2015-12-31 Thread Karim
On 31/12/2015 19:54, Karim wrote: On 31/12/2015 19:18, otaksoftspamt...@gmail.com wrote: I need to check a string over which I have no control for the first 2 non-white space characters (which should be '[{'). The string would ideally be: '[{...' but could also be something like ' [ { .

Re: Newbie: Check first two non-whitespace characters

2015-12-31 Thread Karim
On 31/12/2015 19:18, otaksoftspamt...@gmail.com wrote: I need to check a string over which I have no control for the first 2 non-white space characters (which should be '[{'). The string would ideally be: '[{...' but could also be something like ' [ { '. Best to use re and how? Someth

Re: Newbie: Check first two non-whitespace characters

2015-12-31 Thread MRAB
On 2015-12-31 18:18, otaksoftspamt...@gmail.com wrote: I need to check a string over which I have no control for the first 2 non-white space characters (which should be '[{'). The string would ideally be: '[{...' but could also be something like ' [ { '. Best to use re and how? Somethin

Re: Newbie: How to convert a tuple of strings into a tuple of ints

2015-12-30 Thread otaksoftspamtrap
Thanks much - both solutions work well for me On Wednesday, December 30, 2015 at 2:57:50 PM UTC-8, Ben Finney wrote: > kierkega...@gmail.com writes: > > > How do I get from here > > > > t = ('1024', '1280') > > > > to > > > > t = (1024, 1280) > > Both of those are assignment statements, so I

Re: Newbie: How to convert a tuple of strings into a tuple of ints

2015-12-30 Thread Ian Kelly
On Wed, Dec 30, 2015 at 3:46 PM, wrote: > How do I get from here > > t = ('1024', '1280') > > to > > t = (1024, 1280) Deja vu: https://mail.python.org/pipermail/python-list/2015-December/701017.html -- https://mail.python.org/mailman/listinfo/python-list

Re: Newbie: How to convert a tuple of strings into a tuple of ints

2015-12-30 Thread Ben Finney
otaksoftspamt...@gmail.com writes: > How do I get from here > > t = ('1024', '1280') > > to > > t = (1024, 1280) Both of those are assignment statements, so I'm not sure what you mean by “get from … to”. To translate one assignment statement to a different assignment statement, re-write the stat

Re: Newbie: How to convert a tuple of strings into a tuple of ints

2015-12-30 Thread Chris Angelico
On Thu, Dec 31, 2015 at 9:46 AM, wrote: > How do I get from here > > t = ('1024', '1280') > > to > > t = (1024, 1280) > > > Thanks for all help! t = (int(t[0]), int(t[1])) If the situation is more general than that, post your actual code and we can help out more. Working with a single line isn'

Re: Newbie: Convert strings in nested dict to tuples

2015-12-22 Thread KP
Beautiful - thanks! On Tuesday, 22 December 2015 15:23:25 UTC-8, Peter Otten wrote: > KP wrote: > > > I now know how to convert a string cont. coordinates to a tuple, but hwo > > can I do this? > > > > Given > > > > cfg = {'canvas': ('3840', '1024'), > > 'panel1': {'gpio': '1', 'id': '4'

Re: Newbie: Convert strings in nested dict to tuples

2015-12-22 Thread Peter Otten
KP wrote: > I now know how to convert a string cont. coordinates to a tuple, but hwo > can I do this? > > Given > > cfg = {'canvas': ('3840', '1024'), > 'panel1': {'gpio': '1', 'id': '4', 'co': '0,0,1280,1024'}, > 'panel2': {'gpio': '2', 'id': '5', 'co': '1280,0,2560,1024'}, >

Re: Newbie: String to Tuple

2015-12-22 Thread KP
On Tuesday, 22 December 2015 12:59:59 UTC-8, Mark Lawrence wrote: > On 22/12/2015 20:53, KP wrote: > > How do I convert > > > > '1280,1024' > > > > to > > > > (1280,1024) ? > > > > Thanks for all help! > > > > Start with this https://docs.python.org/3/library/stdtypes.html#str.split > > -- > My

Re: Newbie: String to Tuple

2015-12-22 Thread Peter Otten
KP wrote: > How do I convert > > '1280,1024' > > to > > (1280,1024) ? >>> import ast >>> ast.literal_eval('1280,1024') (1280, 1024) -- https://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   6   7   8   9   10   >