Re: how can I solve this problem simply and clearly

2018-11-08 Thread dieter
lampahome writes: > I have two categories A,B, and A has 2 items A1,A2, and B have 2 items B1, > B2. > > I have two class A and B, and A will handle A1,A2, B handle B1,B2. > > I want to parse one of A1,A2,B1,B2 to script and generate the corresponding > class(object). > > Ex: Both in class A and B

Re: What's wrong with these codes as failed to read the strings in Chinese? Is it because Chinese characters can't be read on Mac? Many thanks

2018-11-08 Thread Cameron Simpson
On 08Nov2018 19:30, Annie Lu wrote: # -*- coding: UTF-8 -*- ... f = open('/Users/annielu/Desktop/namelist1801.txt') namelist1801txt = f.read() f.close() namelist1801txt '\xe9\x99\x88\xe5\xb7\x8d\n\xe8\x83\xa1\xe6\x99\xba\xe5\x81\xa5\r\xe9\xbb\x84\xe5\x9d\xa4\xe6\xa6\x95\r\xe6\x9d\x8e\xe6\x98\x

What's wrong with these codes as failed to read the strings in Chinese? Is it because Chinese characters can't be read on Mac? Many thanks

2018-11-08 Thread Annie Lu
# -*- coding: UTF-8 -*- ... f = open('/Users/annielu/Desktop/namelist1801.txt') >>> namelist1801txt = f.read() >>> f.close() >>> namelist1801txt '\xe9\x99\x88\xe5\xb7\x8d\n\xe8\x83\xa1\xe6\x99\xba\xe5\x81\xa5\r\xe9\xbb\x84\xe5\x9d\xa4\xe6\xa6\x95\r\xe6\x9d\x8e\xe6\x98\x9f\xe7\x81\xbf\r\xe5\x88\x98\

how can I solve this problem simply and clearly

2018-11-08 Thread lampahome
I have two categories A,B, and A has 2 items A1,A2, and B have 2 items B1, B2. I have two class A and B, and A will handle A1,A2, B handle B1,B2. I want to parse one of A1,A2,B1,B2 to script and generate the corresponding class(object). Ex: Both in class A and B, all have func1(), func2(). What

Suggestions for plotting slide rule & sector scales?

2018-11-08 Thread Adam Funk
I like old scientific instruments & that sort of thing, & am wondering what libraries I could use for programmatically generating mathematical scales, ideally able to display the result in the GUI & save it as a png (or other standard graphics format). Ideally, I'd like to be able to write code li

Re: Number 7 syntax ERROR

2018-11-08 Thread Terry Reedy
On 11/7/2018 8:52 PM, NoHaxAllSwagg wrote: I have been experiencing difficulty while trying to run scripts on my IDLE software, considering that when I run my program, I get an error at the top of the page in the “Python 3.7.1” area, highlighting the seven telling me that there is a syntax er

Re: Does this behavior have a better design pattern?

2018-11-08 Thread Peter Otten
Grant Edwards wrote: > On 2018-11-07, Peter Otten <__pete...@web.de> wrote: >> lampahome wrote: >> >>> Above is I thought to make code clear, and this pattern is called simple >>> factory? > > [...] > >>> *Is there better design pattern for me?* > >> Generally speaking you get better solutions

TEST

2018-11-08 Thread Jack Gilbert
not to tick anybody off, I want to see if this is the correct way to post to the python list. Thanks to all who are helping me. Jack G -- https://mail.python.org/mailman/listinfo/python-list

Re: Does this behavior have a better design pattern?

2018-11-08 Thread Grant Edwards
On 2018-11-07, Peter Otten <__pete...@web.de> wrote: > lampahome wrote: > >> Above is I thought to make code clear, and this pattern is called simple >> factory? [...] >> *Is there better design pattern for me?* > Generally speaking you get better solutions when you ask yourself > "How can

Re: Number 7 syntax ERROR

2018-11-08 Thread Vlastimil Brom
2018-11-08 2:52 GMT+01:00, NoHaxAllSwagg : > Hello, > I have been experiencing difficulty while trying to run scripts on my IDLE > software, considering that when I run my program, I get an error at the top > of the page in the “Python 3.7.1” area, highlighting the seven telling me > that there is

Re: Number 7 syntax ERROR

2018-11-08 Thread Peter Otten
NoHaxAllSwagg wrote: > Hello, > I have been experiencing difficulty while trying to run scripts on my IDLE > software, considering that when I run my program, I get an error at the > top of the page in the “Python 3.7.1” area, highlighting the seven telling > me that there is a syntax error, in th

Re: Number 7 syntax ERROR

2018-11-08 Thread Jack Dangler
On 11/7/18 8:52 PM, NoHaxAllSwagg wrote: Hello, I have been experiencing difficulty while trying to run scripts on my IDLE software, considering that when I run my program, I get an error at the top of the page in the “Python 3.7.1” area, highlighting the seven telling me that there is a synta

Re: installing modules problem

2018-11-08 Thread Siva Sukumar Reddy
Also make sure that the Pythonpath contains the folder where the modules are installed in your machine. - site packages folder. On Thu 8 Nov, 2018, 16:28 Thomas Jollans On 2018-11-08 06:04, Ian K. wrote: > > Hello, > > > > My name is Ian Kilty and I have been having trouble with pip. I have pip >

Re: installing modules problem

2018-11-08 Thread Thomas Jollans
On 2018-11-08 06:04, Ian K. wrote: > Hello, > > My name is Ian Kilty and I have been having trouble with pip. I have pip > installed, and I have tried to install modules they say they are installed > in cmd, but when I go into python and import the module, it can't find it. > I hope there is a sim

installing modules problem

2018-11-08 Thread Ian K.
Hello, My name is Ian Kilty and I have been having trouble with pip. I have pip installed, and I have tried to install modules they say they are installed in cmd, but when I go into python and import the module, it can't find it. I hope there is a simple solution to this problem, please let me kno

Number 7 syntax ERROR

2018-11-08 Thread NoHaxAllSwagg
Hello, I have been experiencing difficulty while trying to run scripts on my IDLE software, considering that when I run my program, I get an error at the top of the page in the “Python 3.7.1” area, highlighting the seven telling me that there is a syntax error, in this case, I cant remove that a