Re: questions re: calendar module

2020-08-01 Thread o1bigtenor
On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list 
wrote:

> On 31/07/2020 02:52, o1bigtenor wrote:
> > I regularly work in planning through multiple years at once.
> > This means that I like to have a lot of stuff available in a calendar
> > function.
> > Python seems to be locked when I need to display more than 1 year at a
> > time.
> > I don't see a way to display something like 3 years worth of calendar
> > starting at a point 23 months from now.
> > (I see how to display 1 year at a time but not multiple years.)
>
> This question seems a little vague. How are you creating this "calendar
> function"? Are you using the Python Standard Library calendar, or
> perhaps talking about datetime calculations?
>
> Please copy-paste code showing this "lock".
>

Maybe its not a lock - - - - but there seems to be no way to display a
calendar starting
from a date that is 3 years in time frame.

 python3
Python 3.7.7 (default, Apr  1 2020, 13:48:52)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import calendar
>>> print (calendar.calendar(2024,1,1,2,8))

 2024

  January   February   March
 April  May   June  July
 August
Mo Tu We Th Fr Sa Su  Mo Tu We Th Fr Sa Su  Mo Tu We Th Fr Sa Su  Mo Tu We
Th Fr Sa Su  Mo Tu We Th Fr Sa Su  Mo Tu We Th Fr Sa Su  Mo Tu We Th Fr Sa
Su  Mo Tu We Th Fr Sa Su
 1  2  3  4  5  6  71  2  3  4   1  2  3   1  2  3
4  5  6  7 1  2  3  4  5  1  2   1  2  3  4  5  6
71  2  3  4
 8  9 10 11 12 13 14   5  6  7  8  9 10 11   4  5  6  7  8  9 10   8  9 10
11 12 13 14   6  7  8  9 10 11 12   3  4  5  6  7  8  9   8  9 10 11 12 13
14   5  6  7  8  9 10 11
15 16 17 18 19 20 21  12 13 14 15 16 17 18  11 12 13 14 15 16 17  15 16 17
18 19 20 21  13 14 15 16 17 18 19  10 11 12 13 14 15 16  15 16 17 18 19 20
21  12 13 14 15 16 17 18
22 23 24 25 26 27 28  19 20 21 22 23 24 25  18 19 20 21 22 23 24  22 23 24
25 26 27 28  20 21 22 23 24 25 26  17 18 19 20 21 22 23  22 23 24 25 26 27
28  19 20 21 22 23 24 25
29 30 31  26 27 28 29   25 26 27 28 29 30 31  29 30
 27 28 29 30 3124 25 26 27 28 29 30  29 30 31
26 27 28 29 30 31

 September  October   November
December
Mo Tu We Th Fr Sa Su  Mo Tu We Th Fr Sa Su  Mo Tu We Th Fr Sa Su  Mo Tu We
Th Fr Sa Su
   1  1  2  3  4  5  6   1  2  3
 1
 2  3  4  5  6  7  8   7  8  9 10 11 12 13   4  5  6  7  8  9 10   2  3  4
5  6  7  8
 9 10 11 12 13 14 15  14 15 16 17 18 19 20  11 12 13 14 15 16 17   9 10 11
12 13 14 15
16 17 18 19 20 21 22  21 22 23 24 25 26 27  18 19 20 21 22 23 24  16 17 18
19 20 21 22
23 24 25 26 27 28 29  28 29 30 31   25 26 27 28 29 30 23 24 25
26 27 28 29
3030 31


I would like to show something like 2024 through the end of 2028.

TIA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: questions re: calendar module

2020-08-01 Thread Peter Otten
o1bigtenor wrote:

 import calendar
 print (calendar.calendar(2024,1,1,2,8))

> I would like to show something like 2024 through the end of 2028.

print("\n".join(cd.calendar(year) for year in range(2024, 2029)))


-- 
https://mail.python.org/mailman/listinfo/python-list


Pygobject style question

2020-08-01 Thread Chris Green
Having (after lots of help from here, thank you) finally converted my
Python 2, gtk 2 program to Python 3 and pygobject gtk 3 I'm left with
a couple of what might be called style questions.

I guess it's mostly down to what feels right to me but there may be
good reasons for choosing one way over another and, if so, I'd like to
know what they are.

So, my original code had:-

...
...
self.buffer = gtk.TextBuffer()
self.view = gtk.TextView(self.buffer)
...
...


This doesn't work in gtk+ 3 (or at least I don't think it does, the
converter script changed it) and there seem to be several ways of
doing it now:-

...
...
self.buffer = Gtk.TextBuffer()
self.view = Gtk.TextView(buffer = self.buffer)
...
...


...
...
self.buffer = Gtk.TextBuffer()
self.view = Gtk.TextView.new_with_buffer(self.buffer)
...
...


...
...
self.view = Gtk.TextView()
self.buffer = self.view.get_buffer()
...
...


...
...
self.view = Gtk.TextView()
self.buffer = Gtk.TextBuffer()
self.view.set_buffer(self.buffer)
...
...

Is there any reason to prefer any one of the above over the others?

Obviously the last one is a line more but lends itself to using
several Gtk.TextBuffer objects in on Gtk.TextView.

-- 
Chris Green
·
-- 
https://mail.python.org/mailman/listinfo/python-list


XanaNews Statistic for comp.lang.python. 8/1/2020 7:48:48 AM [2/2]

2020-08-01 Thread The Doctor via Python-list
 87 1  Mathiyazhagan S  
 88 1  Elias Fotinis   Mozilla  
 89 1  ??? Gnus 
 90 1  Oscar Benjamin   
 91 1  Wasdeq68 
 92 1  Robin BeckerMozilla  
 93 1  [email protected]   G2   
 94 1  [email protected]   G2   
 95 1  Sarvesh Poddar  WebService   
 96 1  Sumana HarihareswaraMozilla  
 97 1  [email protected]   G2   
 98 1  nhpythonOpen-Xchange Mailer  
 99 1  Bob7starMozilla  
100 1  David L NeilMozilla  
101 1  boB Stepp
102 1  BartMozilla  
103 1  Tanmay Shah  
104 1  R.WieserMicrosoft Outlook Express
105 1  Danilo Coccia   Mozilla  
106 1  Damian Johnson   
107 1  Liste guru  Mozilla  
108 1  Stephen Carboni  
109 1  Bolun Thompson   
110 1  [email protected] G2   
111 1  [email protected]  G2   
112 1  Raine Pretorius  
113 1  Romulus Schilling
114 1  LUIGI BISIGNANI:MAI PIU' C  G2   
115 1  WingwarePostbox  
116 1  [email protected] G2   
117 1  Nomen NescioUnison   
118 1  [email protected]   G2   
119 1  [email protected]   
120 1  Jim Mozilla  
121 1  Michio Suginoo   
122 1  [email protected]   
123 1  Vincent Davis
124 1  Chaitanya Patil  
125 1  Ralf M. Mozilla  
126 1  [email protected] G2   
127 1  Shivam Dutt Sharma   
128 1  Bob Gailer   
129 1  Christman, Roger Graydon 
130 1  Damilare 
131 1  [email protected] G2   
132 1  Bischoopslrn 
133 1  Deepak Didmania  
134 1  MICHELE CALZOLARI IGEA BAN  G2   
135 1  Ed Walser
136 1  [email protected]  tin  
137 1  [email protected]
138 1  [email protected]  G2   
139 1  Stephan Lukits  iPhone Mail (
140 1  [email protected]  G2   
141 1  Richard Damon   Mozilla  
142 1  kandolacherrydeepkaur@gmai  G2   
143 1  Stephen Rosen
144 1  Gazuslrn 
145 1  Shanmika Sugavaneswaran  
146 1  Bill Deegan  
147 1  J Conrado   Mozilla  
148 1  CMCC Info   Mozilla  
149 1  Reto 
150 1  Orges Leka   
151 1  Abhiram R
152 1  xuanwu348   Coremail Webmail Server V


Top Newsreaders

Ranking  Articles  NewsreaderUsers
---      -
  1   238  G

XanaNews Statistic for comp.lang.python. 8/1/2020 7:48:48 AM [1/2]

2020-08-01 Thread The Doctor via Python-list
XanaNews Statistic for comp.lang.python.  8/1/2020 7:48:48 AM

>From article 581998 (7/1/2020 6:44:35 AM) to article 582636 (7/31/2020
8:24:06 PM)

Number of threads  ... 318
Number of articles  .. 674
Average articles per thread  . 2.12
Number of unanswered posts  .. 245
Number of posts from XanaNews users .. 0


Top Threads

Ranking  Articles  Subject
---    --
  137  Formal Question to Steering Council (re recent PEP8
changes)
  228  Bulletproof json.dump?
  316  Fwd: [BUG] missing ')' causes syntax error on next
line
  414  Iterators, iterables and special objects
  512  frozendict: an experiment
  611  Symlinks already present
  710  Questioning the effects of multiple assignment
  8 9  "1,+2,", but not "(1,)+2,"
  9 9  EuroPython 2020: Data Science Track
 10 8  Installing Python 3.8.3 with tkinter
 11 8  The speed of glob()
 12 8  Python Program Help
 13 8  Re: Friday Finking: Limiting parameters
 14 8  Winreg
 15 7  Request help w/pip install jq
 16 7  True is True / False is False?
 17 7  Confused about np.polyfit()
 18 7  An I connected here?
 19 6  Need to 'import gtk' on Ubuntu 20.04, what do I need?
 20 6  Re: Dowloading package dependencies from locked down
machine
 21 6  RE: Local access to a file, How To ?
 22 6  Fake news Detect
 23 6  help
 24 6  A rule for your twitlist/mailing list
 25 6  Issues in downloading python
 26 5  Python pandas Excel
 27 5  python software foundation
 28 5  Dowloading package dependencies from locked down
machine
 29 5  why is requests 2.24 behaving differently on
different Win10Pro PCs?
 30 5  How to diagnose import error when importing from .so
file?
 31 5  Access last element after iteration
 32 5  trying to improve my knn algorithm
 33 5  Iterating over dict is slower than iterating over
iter(dict)?
 34 5  New to python - Just a question
 35 5  Friday Finking: Limiting parameters
 36 5  Need a Dynamic vlookup using python
 37 5  Winreg
 38 4  Unable to login | fbchat.Client
 39 4  Issues Download the Latest Version of Python
Programming Language
 40 4  Is sys.executable not supposed to follow symlinks?
 41 4  Windows and Subclassing - 'OverflowError': int too
long to convert
 42 4  How to limit *length* of PrettyPrinter
 43 4  Re: frozendict: an experiment
 44 4  Facing problem while opening phython
 45 4  Python Scripts
 46 4  python installation help
 47 4  Re: Assign Excel cell value from Datepicker widget
Selection using Python
 48 3  "OSError: [Errno 9] Bad file descriptor" When I try
to Install the library in conda prompt
 49 3  Equivalent of "make install" for Python on windows?
 50 3  python software foundation
 51 3  Upgrade from Python 3.6 to 3.8 and cx-freeze is not
available more
 52 3  Re: How to read barcoded value from PDF
 53 3  execution timing of the method QWidget.show()
 54 3  Typing modules
 55 3  Re: How to limit *length* of PrettyPrinter
 56 3  Support both asyncio and synchronous callers
 57 3  Re: Solutions, Testbank for Labor Economics 8th
Edition, 8e by George Borjas
 58 3  Urgent
 59 3  Re: solution manual for Operating System Concepts
9th Edition by Abraham
 60 3  Very Simple (Rather Dumb) Question
 61 3  PEP 622
 62 3  What's the enum for a button press event in
pygobject 3?
 63 3  How to find code that causes a 'deprecated' warning?
 64 3  Non IDE development strategy - what do others do
that's fairly simple?
 65 3  Issue with Python installation for a beginner Python
coder.
 66 3  App for Moto e6 using Python?
 67 3  Re: Seeking to convert a py timer app for my Moto E6
 68 3  Gtk.TextBuffer problem on converting from GTK+ 2 to
GTK+ 3
 69 2  excel (multiple sheets) to yml file for each sheet
 70 2  Downloading Python
 71 2  Re: FW: Pycharm Won't Do Long Underscore
 72 2  questions re: calendar module
 73 2  business analysis and valuation IFRS edition 5th
edition by Palepu Solution manual


Top Posters

Ranking  Articles  NameMost Used Newsreader
---    --  
  1   119  Vagrant   

Re: Downloading Python

2020-08-01 Thread Luuk



On 31-7-2020 22:10, Tanmay Shah wrote:

Hello to whoever this may concern,

After downloading Python 3.8.5 IDLE, an error message popped up, saying
the code execution cannot proceed because python38.dll was not found. What
should I do in order to use the Python interpreter?

Thank you!



It's WIndows, did you try to reboot ?

It seems to solve a lot of problems, on Windows

--
https://mail.python.org/mailman/listinfo/python-list


Re: questions re: calendar module

2020-08-01 Thread o1bigtenor
On Sat, Aug 1, 2020 at 6:58 AM Peter Otten <[email protected]> wrote:
>
> o1bigtenor wrote:
>
>  import calendar
>  print (calendar.calendar(2024,1,1,2,8))
>
> > I would like to show something like 2024 through the end of 2028.
>
> print("\n".join(cd.calendar(year) for year in range(2024, 2029)))


Sorry - - - - 1st response was to only Mr Peter - - - hopefully this is
useful to more than I so here is that to all.
>
>

>>> print("\n".join(cd.calendar(year) for year in range(2024, 2029)))
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 1, in 
NameError: name 'cd' is not defined

so 'cd' seems to be a problem.

Tried changing 'cd' to calendar and that gives the desired response.

Except its a neat 3 months wide very very very many rows of calendar.

I'm trying to figure out how to do something like this:

November 2022  December 2022
January 2023February 2023
March 2023April 2023
May 2023
   Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa  Su Mo Tu
We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
1231  2  3  4  5 127  1  2  3
132  1  2  3  4  5  6  7  136   1  2  3  4  140
1  2  3  4  1441  149 1  2  3  4  5  6
124  6  7  8  9 10 11 12  128  4  5  6  7  8  9 10  133  8  9 10 11 12
13 14  137  5  6  7  8  9 10 11  141  5  6  7  8  9 10 11  145  2  3
4  5  6  7  8  150  7  8  9 10 11 12 13
125 13 14 15 16 17 18 19  129 11 12 13 14 15 16 17  134 15 16 17 18 19
20 21  138 12 13 14 15 16 17 18  142 12 13 14 15 16 17 18  146  9 10
11 12 13 14 15  151 14 15 16 17 18 19 20
126 20 21 22 23 24 25 26  130 18 19 20 21 22 23 24  135 22 23 24 25 26
27 28  139 19 20 21 22 23 24 25  143 19 20 21 22 23 24 25  147 16 17
18 19 20 21 22  152 21 22 23 24 25 26 27
127 27 28 29 30   131 25 26 27 28 29 30 31  136 29 30 31
   140 26 27 28  144 26 27 28 29 30 31 148 23 24
25 26 27 28 29  153 28 29 30 31

   149 30

   June 2023 July 2023August 2023
   September 2023 October 2023
November 2023 December 2023
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th
Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo
Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
153  1  2  3  1571  1621  2  3
 4  5  166 1  2  171  1  2  3  4  5  6  7  175
  1  2  3  4  179 1  2

The formatting here is a mess.
The months are centered. The week numbers are consecutive from the
starting date.
The dates are centered under the weekday name. If you've ever used
ncal its like that except
that I can now have up to 7 months wide if the terminal is wide enough
(>180 columns IIRC).
A mentor was working on this in Perl but as he died some couple months
ago its up to me
to make what I want.
Because it seems like there are a lot of disparate things happening
its not very straight
forward trying to replicate and extend my friend's efforts except in
Python. (My friend
preferred to work in Perl rather than Python and I'm wanting to learn
Python. I understand
that this is not perhaps the easiest way to learn something but it
sure is interesting!)

TIA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: questions re: calendar module

2020-08-01 Thread o1bigtenor
On Sat, Aug 1, 2020 at 9:29 AM o1bigtenor  wrote:
>
> On Sat, Aug 1, 2020 at 6:58 AM Peter Otten <[email protected]> wrote:
> >
> > o1bigtenor wrote:
> >
> >  import calendar
> >  print (calendar.calendar(2024,1,1,2,8))
> >
> > > I would like to show something like 2024 through the end of 2028.
> >
> > print("\n".join(cd.calendar(year) for year in range(2024, 2029)))
>
>
> Sorry - - - - 1st response was to only Mr Peter - - - hopefully this is
> useful to more than I so here is that to all.
> >
> >
>
> >>> print("\n".join(cd.calendar(year) for year in range(2024, 2029)))
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "", line 1, in 
> NameError: name 'cd' is not defined
>
> so 'cd' seems to be a problem.
>
> Tried changing 'cd' to calendar and that gives the desired response.
>
> Except its a neat 3 months wide very very very many rows of calendar.
>
> I'm trying to figure out how to do something like this:
>
> November 2022  December 2022
> January 2023February 2023
> March 2023April 2023
> May 2023
>Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa  Su Mo Tu
> We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
> Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
> 1231  2  3  4  5 127  1  2  3
> 132  1  2  3  4  5  6  7  136   1  2  3  4  140
> 1  2  3  4  1441  149 1  2  3  4  5  6
> 124  6  7  8  9 10 11 12  128  4  5  6  7  8  9 10  133  8  9 10 11 12
> 13 14  137  5  6  7  8  9 10 11  141  5  6  7  8  9 10 11  145  2  3
> 4  5  6  7  8  150  7  8  9 10 11 12 13
> 125 13 14 15 16 17 18 19  129 11 12 13 14 15 16 17  134 15 16 17 18 19
> 20 21  138 12 13 14 15 16 17 18  142 12 13 14 15 16 17 18  146  9 10
> 11 12 13 14 15  151 14 15 16 17 18 19 20
> 126 20 21 22 23 24 25 26  130 18 19 20 21 22 23 24  135 22 23 24 25 26
> 27 28  139 19 20 21 22 23 24 25  143 19 20 21 22 23 24 25  147 16 17
> 18 19 20 21 22  152 21 22 23 24 25 26 27
> 127 27 28 29 30   131 25 26 27 28 29 30 31  136 29 30 31
>140 26 27 28  144 26 27 28 29 30 31 148 23 24
> 25 26 27 28 29  153 28 29 30 31
>
>149 30
>
>June 2023 July 2023August 2023
>September 2023 October 2023
> November 2023 December 2023
> Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th
> Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo
> Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
> 153  1  2  3  1571  1621  2  3
>  4  5  166 1  2  171  1  2  3  4  5  6  7  175
>   1  2  3  4  179 1  2
>
> The formatting here is a mess.

(Its an even bigger mess now when its truncated to 80 columns. Can't change
the mess but I can tell you that it doesn't 'look that way'! Don't know how to
include an example in the body and have it be even a bit accurate - - - please
advise if there is a way.)

> The months are centered. The week numbers are consecutive from the
> starting date.
> The dates are centered under the weekday name. If you've ever used
> ncal its like that except
> that I can now have up to 7 months wide if the terminal is wide enough
> (>180 columns IIRC).
> A mentor was working on this in Perl but as he died some couple months
> ago its up to me
> to make what I want.
> Because it seems like there are a lot of disparate things happening
> its not very straight
> forward trying to replicate and extend my friend's efforts except in
> Python. (My friend
> preferred to work in Perl rather than Python and I'm wanting to learn
> Python. I understand
> that this is not perhaps the easiest way to learn something but it
> sure is interesting!)
>
> TIA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Downloading Python

2020-08-01 Thread Bischoop
On 2020-07-31, Stefan Ram  wrote:
>
>   Don't download just IDLE in isolation.
>
>   Instead download Python 3.8 from www.python.org/downloads
>   and properly install it following the installation
>   instructions for your operating system.
>
>   This will then include IDLE.
>
>

He's right.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Downloading Python

2020-08-01 Thread Barry


> On 1 Aug 2020, at 15:16, Luuk  wrote:
> 
> 
>> On 31-7-2020 22:10, Tanmay Shah wrote:
>> Hello to whoever this may concern,
>> 
>> After downloading Python 3.8.5 IDLE, an error message popped up, saying
>> the code execution cannot proceed because python38.dll was not found. What
>> should I do in order to use the Python interpreter?

I have never had to reboot windows when installing python.
Was I lucky?

Barry

>> 
>> Thank you!
> 
> 
> It's WIndows, did you try to reboot ?
> 
> It seems to solve a lot of problems, on Windows
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Downloading Python

2020-08-01 Thread MRAB

On 2020-08-01 21:58, Barry wrote:



On 1 Aug 2020, at 15:16, Luuk  wrote:



On 31-7-2020 22:10, Tanmay Shah wrote:
Hello to whoever this may concern,

After downloading Python 3.8.5 IDLE, an error message popped up, saying
the code execution cannot proceed because python38.dll was not found. What
should I do in order to use the Python interpreter?


I have never had to reboot windows when installing python.
Was I lucky?


No. I've never had a problem with it either.




Thank you!



It's WIndows, did you try to reboot ?

It seems to solve a lot of problems, on Windows


--
https://mail.python.org/mailman/listinfo/python-list


Re: questions re: calendar module

2020-08-01 Thread William Ray Wing via Python-list

> On Aug 1, 2020, at 10:35 AM, o1bigtenor  wrote:
> 
> On Sat, Aug 1, 2020 at 9:29 AM o1bigtenor  wrote:
>> 
>>> On Sat, Aug 1, 2020 at 6:58 AM Peter Otten <[email protected]> wrote:
>>> 
>>> o1bigtenor wrote:
>>> 
>>> import calendar
>>> print (calendar.calendar(2024,1,1,2,8))
>>> 
 I would like to show something like 2024 through the end of 2028.
>>> 
>>> print("\n".join(cd.calendar(year) for year in range(2024, 2029)))
>> 
>> 
>> Sorry - - - - 1st response was to only Mr Peter - - - hopefully this is
>> useful to more than I so here is that to all.
>>> 
>>> 
>> 
> print("\n".join(cd.calendar(year) for year in range(2024, 2029)))
>> Traceback (most recent call last):
>>  File "", line 1, in 
>>  File "", line 1, in 
>> NameError: name 'cd' is not defined
>> 
>> so 'cd' seems to be a problem.
>> 
>> Tried changing 'cd' to calendar and that gives the desired response.
>> 
>> Except its a neat 3 months wide very very very many rows of calendar.
>> 
>> I'm trying to figure out how to do something like this:
>> 
>>November 2022  December 2022
>>January 2023February 2023
>> March 2023April 2023
>> May 2023
>>   Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa  Su Mo Tu
>> We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
>> Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
>> 1231  2  3  4  5 127  1  2  3
>>132  1  2  3  4  5  6  7  136   1  2  3  4  140
>> 1  2  3  4  1441  149 1  2  3  4  5  6
>> 124  6  7  8  9 10 11 12  128  4  5  6  7  8  9 10  133  8  9 10 11 12
>> 13 14  137  5  6  7  8  9 10 11  141  5  6  7  8  9 10 11  145  2  3
>> 4  5  6  7  8  150  7  8  9 10 11 12 13
>> 125 13 14 15 16 17 18 19  129 11 12 13 14 15 16 17  134 15 16 17 18 19
>> 20 21  138 12 13 14 15 16 17 18  142 12 13 14 15 16 17 18  146  9 10
>> 11 12 13 14 15  151 14 15 16 17 18 19 20
>> 126 20 21 22 23 24 25 26  130 18 19 20 21 22 23 24  135 22 23 24 25 26
>> 27 28  139 19 20 21 22 23 24 25  143 19 20 21 22 23 24 25  147 16 17
>> 18 19 20 21 22  152 21 22 23 24 25 26 27
>> 127 27 28 29 30   131 25 26 27 28 29 30 31  136 29 30 31
>>   140 26 27 28  144 26 27 28 29 30 31 148 23 24
>> 25 26 27 28 29  153 28 29 30 31
>> 
>>   149 30
>> 
>>   June 2023 July 2023August 2023
>>   September 2023 October 2023
>> November 2023 December 2023
>>Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th
>> Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo
>> Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
>> 153  1  2  3  1571  1621  2  3
>> 4  5  166 1  2  171  1  2  3  4  5  6  7  175
>>  1  2  3  4  179 1  2
>> 
>> The formatting here is a mess.
> 
> (Its an even bigger mess now when its truncated to 80 columns. Can't change
> the mess but I can tell you that it doesn't 'look that way'! Don't know how to
> include an example in the body and have it be even a bit accurate - - - please
> advise if there is a way.)
> 

If you want us to see it in its exact form, print to PDF, post/share It on 
Dropbox. 

>> The months are centered. The week numbers are consecutive from the
>> starting date.
>> The dates are centered under the weekday name. If you've ever used
>> ncal its like that except
>> that I can now have up to 7 months wide if the terminal is wide enough
>> (>180 columns IIRC).
>> A mentor was working on this in Perl but as he died some couple months
>> ago its up to me
>> to make what I want.
>> Because it seems like there are a lot of disparate things happening
>> its not very straight
>> forward trying to replicate and extend my friend's efforts except in
>> Python. (My friend
>> preferred to work in Perl rather than Python and I'm wanting to learn
>> Python. I understand
>> that this is not perhaps the easiest way to learn something but it
>> sure is interesting!)
>> 
>> TIA
> -- 
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Non IDE development strategy - what do others do that's fairly simple?

2020-08-01 Thread Cameron Simpson
On 30Jul2020 21:15, Marco Sulla  wrote:
>What you want is a branch, I guess.
>
>https://www.mercurial-scm.org/wiki/Branch
>
>For simplicity, I suggest you have two different directories: one for the
>development branch and the other for the production branch.

Yes to this advice.

And I am also an editor in one window and command line in another window 
person.

Note that a Mercurial "named branch" is a more, um, "solid" thing than a 
git branch, which is much more like a mercurial bookmark. Basicly, you 
can't easily remove a mercurial named branch. Bookmarks you can make and 
discard freely. That said, I hardly ever use bookmarks.

You also do not need a named branch - a cloned directory works as well.

I use mercurial branches for long lived things, particularly development 
on theme. My personal library has a bunch of long term branches - they 
all get merged back into "default" frequently as things stabilise.

So for your scenario I'd add a named branch for the development, 
particularly if it has a theme. But also as Marco suggests, clone your 
tree into another directory for the development.

Look:

[~]fleet2*> cd ~/hg
/Users/cameron/hg
[~/hg]fleet2*> ls -d css-*
css-adzapper css-nodedb-nested-curly-syntax
css-aws  css-nodedb-proxyobjs
css-beyonwiz css-persist
css-calibre  css-pilfer
css-contractutilscss-pt
css-csbugcss-py3
[...]

Each of those trees is a clone of the main "css" tree. They do not all 
have named branches.

[~/hg]fleet2*> cd css
[~/hg/css(hg:default)]fleet2*> hg clone . ../css-newdev
[~/hg/css(hg:default)]fleet2*> cd ../css-newdev
[~/hg/css-newdev(hg:default)]fleet2*> hg branch newdev
[~/hg/css-newdev(hg:newdev)]fleet2*>

So now I've got a clone in css-newdev, for a new named branch "newdev" 
(obviously pick a better branch name). No need to make a named branch, 
unless this is long lived, in which case it helps you track where 
changes occurred - the branch name is recorded in commits.

You can merge to or from "../css" as needed.

I find this _much_ easier to deal with than the common git habit of 
switching branches in place (which you can also do).

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: questions re: calendar module

2020-08-01 Thread dn via Python-list

On 01/08/2020 23:36, o1bigtenor wrote:
On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list 
mailto:[email protected]>> wrote:


On 31/07/2020 02:52, o1bigtenor wrote:
 > I regularly work in planning through multiple years at once.
 > This means that I like to have a lot of stuff available in a calendar
 > function.
 > Python seems to be locked when I need to display more than 1 year
at a
 > time.
 > I don't see a way to display something like 3 years worth of calendar
 > starting at a point 23 months from now.
 > (I see how to display 1 year at a time but not multiple years.)

This question seems a little vague. How are you creating this "calendar
function"? Are you using the Python Standard Library calendar, or
perhaps talking about datetime calculations?

Please copy-paste code showing this "lock".


Maybe its not a lock - - - - but there seems to be no way to display a 
calendar starting

from a date that is 3 years in time frame.

...


I would like to show something like 2024 through the end of 2028.



Let's start with the disappointing information:-
- please read https://docs.python.org/3/library/calendar.html and the 
*function's* help:


>>> help(cal.calendar)
Help on method formatyear in module calendar:
formatyear(theyear, w=2, l=1, c=6, m=3) method of calendar.TextCalendar 
instance

Returns a year's calendar as a multi-line string.

The word "year" is singular, and the parameters are all to do with the 
output-presentation. We can't even request 'the rest of the year from 
August onwards'!


There are other helper functions. Also, we are invited to sub-class.

Might it be possible to generate multiple year (or month) groups, split 
them by line, and then reassemble line-by-line to produce the width and 
temporal length required?


What do you think?


Further web.refs:
Working with Python Calendar in Depth
https://www.pythonpool.com/python-calendar/

Python CALENDAR Tutorial with Example
https://www.guru99.com/calendar-in-python.html
--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


Re: questions re: calendar module

2020-08-01 Thread o1bigtenor
On Sat, Aug 1, 2020 at 6:29 PM dn via Python-list
 wrote:
>
> On 01/08/2020 23:36, o1bigtenor wrote:
> > On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list
> > mailto:[email protected]>> wrote:
> >
> > On 31/07/2020 02:52, o1bigtenor wrote:
> >  > I regularly work in planning through multiple years at once.
> >  > This means that I like to have a lot of stuff available in a calendar
> >  > function.
> >  > Python seems to be locked when I need to display more than 1 year
> > at a
> >  > time.
> >  > I don't see a way to display something like 3 years worth of calendar
> >  > starting at a point 23 months from now.
> >  > (I see how to display 1 year at a time but not multiple years.)
> >
> > This question seems a little vague. How are you creating this "calendar
> > function"? Are you using the Python Standard Library calendar, or
> > perhaps talking about datetime calculations?
> >
> > Please copy-paste code showing this "lock".
> >
> >
> > Maybe its not a lock - - - - but there seems to be no way to display a
> > calendar starting
> > from a date that is 3 years in time frame.
> ...
>
> > I would like to show something like 2024 through the end of 2028.
>
>
> Let's start with the disappointing information:-
> - please read https://docs.python.org/3/library/calendar.html and the
> *function's* help:
>
>  >>> help(cal.calendar)
> Help on method formatyear in module calendar:
> formatyear(theyear, w=2, l=1, c=6, m=3) method of calendar.TextCalendar
> instance
>  Returns a year's calendar as a multi-line string.
>
> The word "year" is singular, and the parameters are all to do with the
> output-presentation. We can't even request 'the rest of the year from
> August onwards'!

It is very disappointing - - - -suggests that thinking outside the space of
one year is somehow deprecated. Frustrated when what you do demands
that you think in longer periods of time (and yet have to function within
the week as well).

>
> There are other helper functions. Also, we are invited to sub-class.

Hmm - - - will have to investigate that.
>
> Might it be possible to generate multiple year (or month) groups, split
> them by line, and then reassemble line-by-line to produce the width and
> temporal length required?

Likely work well if the months were considered as discrete blocks.
Thinking that one could have something like

   January 20xx  February 20xx
  Su  Mo  Tu  We  Th  Fr  Sa Su  Mo  Tu  We  Th  Fr  Sa
1  1 2 3455
 12
2 6 78 910  11  12   6 3 45 6
   7   89
313   14  15   16   17  18  19   710   11  12   13   14  15  16
420   21  22   23   24  25  26   8
527   28  29   30   31

It is very useful for me to have the week numbers included. Have
learned some fascinating things (some months have 6 weeks in
them!) and the joys of formating (grin!).
>
> What do you think?

I was starting from what I understood (how to print 'a' year) working
to get closer to what I could use. Ncal allows me to display a
calendar except I'm restricted to a display only 3 months wide. More
than one month is relatively easy to display from present but not
from some other point. It would seem that the 80 column display
still rules supreme - - - - - and that's on a 1920 pixel wide monitor.

Thanks for the ideas and suggestions!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: questions re: calendar module

2020-08-01 Thread o1bigtenor
On Sat, Aug 1, 2020 at 7:24 PM o1bigtenor  wrote:
>
> On Sat, Aug 1, 2020 at 6:29 PM dn via Python-list
>  wrote:
> >
> > On 01/08/2020 23:36, o1bigtenor wrote:
> > > On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list
> > > mailto:[email protected]>> wrote:
> > >
> > > On 31/07/2020 02:52, o1bigtenor wrote:
> > >  > I regularly work in planning through multiple years at once.
> > >  > This means that I like to have a lot of stuff available in a 
> > > calendar
> > >  > function.
snip
> > Let's start with the disappointing information:-
> > - please read https://docs.python.org/3/library/calendar.html and the
> > *function's* help:
> >
> >  >>> help(cal.calendar)
> > Help on method formatyear in module calendar:
> > formatyear(theyear, w=2, l=1, c=6, m=3) method of calendar.TextCalendar
> > instance
> >  Returns a year's calendar as a multi-line string.
> >
> > The word "year" is singular, and the parameters are all to do with the
> > output-presentation. We can't even request 'the rest of the year from
> > August onwards'!
>
> It is very disappointing - - - -suggests that thinking outside the space of
> one year is somehow deprecated. Frustrated when what you do demands
> that you think in longer periods of time (and yet have to function within
> the week as well).
>
> >
> > There are other helper functions. Also, we are invited to sub-class.
>
> Hmm - - - will have to investigate that.

Doing some searching - - - - sub-class really doesn't have a lot of 'official'
info. Perhaps an information source might be pointed out?
> >
> > Might it be possible to generate multiple year (or month) groups, split
> > them by line, and then reassemble line-by-line to produce the width and
> > temporal length required?
>
> Likely work well if the months were considered as discrete blocks.
> Thinking that one could have something like
>

> It is very useful for me to have the week numbers included. Have
> learned some fascinating things (some months have 6 weeks in
> them!) and the joys of formating (grin!).
> >
> > What do you think?
>
> I was starting from what I understood (how to print 'a' year) working
> to get closer to what I could use. Ncal allows me to display a
> calendar except I'm restricted to a display only 3 months wide. More
> than one month is relatively easy to display from present but not
> from some other point. It would seem that the 80 column display
> still rules supreme - - - - - and that's on a 1920 pixel wide monitor.
>
> Thanks for the ideas and suggestions!
>January 20xx  February 20xx
>   Su  Mo  Tu  We  Th  Fr  Sa Su  Mo  Tu  We  Th  Fr  Sa
> 1  1 2 3455   
>12
> 2 6 78 910  11  12   6 3 45 6  7  
>  89
> 313   14  15   16   17  18  19   710   11  12   13   14  15  16
> 420   21  22   23   24  25  26   8
> 527   28  29   30   31
>

Reading through more docs there is a possibility of using the 'format'
command. Would need to first come up with a way of describing the
months (with their attendant week numbers) and then describe a
formating system which would then enable a use of 'print' to achieve
the desired goal.

Is this perhaps a good way of doing this?

TIA
-- 
https://mail.python.org/mailman/listinfo/python-list


Python has stopped working

2020-08-01 Thread Harsh Mashru
 Respected sir/ma'am

I've been trying to execute the code which operates the
camera. When it starts to open the camera it shows that  python.exe has
stopped working.

Problem signature:
  Problem Event Name: APPCRASH
  Application Name: python.exe
  Application Version: 3.8.5150.1013
  Application Timestamp: 5f15bf71
  Fault Module Name: cv2.cp38-win_amd64.pyd
  Fault Module Version: 0.0.0.0
  Fault Module Timestamp: 5f028477
  Exception Code: c005
  Exception Offset: 02c6a90a
  OS Version: 6.1.7601.2.1.0.768.2
  Locale ID: 16393
  Additional Information 1: 221e
  Additional Information 2: 221ebc263cc5a862cc38c6e101bcabef
  Additional Information 3: 73ad
  Additional Information 4: 73ad4612db3d3535fc9083877169fc99

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy
statement offline:
  C:\Windows\system32\en-US\erofflps.txt

I look forward to hearing from you.

Regards,
Harsh Mashru
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python has stopped working

2020-08-01 Thread Chris Angelico
On Sun, Aug 2, 2020 at 1:00 PM Harsh Mashru  wrote:
>
>  Respected sir/ma'am
>
> I've been trying to execute the code which operates the
> camera. When it starts to open the camera it shows that  python.exe has
> stopped working.
>
> Problem signature:
>   Problem Event Name: APPCRASH
>   Application Name: python.exe
>   Fault Module Name: cv2.cp38-win_amd64.pyd

The actual crash happened inside this module. I'm guessing that's some
sort of camera handler. You may need to look into why *that* is
crashing.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: questions re: calendar module

2020-08-01 Thread dn via Python-list

On 02/08/2020 12:24, o1bigtenor wrote:

On Sat, Aug 1, 2020 at 6:29 PM dn via Python-list
 wrote:

On 01/08/2020 23:36, o1bigtenor wrote:

On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list
mailto:[email protected]>> wrote:
 On 31/07/2020 02:52, o1bigtenor wrote:
  > I regularly work in planning through multiple years at once.

...


calendar starting
from a date that is 3 years in time frame.

...


I would like to show something like 2024 through the end of 2028.

...

It is very disappointing - - - -suggests that thinking outside the space of
one year is somehow deprecated. Frustrated when what you do demands
that you think in longer periods of time (and yet have to function within
the week as well).


I agree - says he who tactically changes his 'events calendar' every 
half-year, to ensure that there is more than a six-month planning 
horizon. Sister-in-Law has just this morning blocked-out dates for 
family gatherings ("you are expected to attend!") for not just 
Christmas/December, but into Jan, Feb, and Easter holidays (Uni 
vacation) next year; because U.David is but a mere-male and needs lots 
of 'extra help'...

(and because she knows 'the system', and has something similar at home!)



There are other helper functions. Also, we are invited to sub-class.


Hmm - - - will have to investigate that.


I'm thinking that the month function/method might be a better way to go 
(than year-at-a-time).


For visualisation (per next para), have you tried computing a month in 
the REPL and then str.split()-ting the output into separate week-strings?




Might it be possible to generate multiple year (or month) groups, split
them by line, and then reassemble line-by-line to produce the width and
temporal length required?


Likely work well if the months were considered as discrete blocks.
Thinking that one could have something like

January 20xx  February 20xx
   Su  Mo  Tu  We  Th  Fr  Sa Su  Mo  Tu  We  Th  Fr  Sa
1  1 2 3455
  12
2 6 78 910  11  12   6 3 45 6
7   89
313   14  15   16   17  18  19   710   11  12   13   14  15  16
420   21  22   23   24  25  26   8
527   28  29   30   31

It is very useful for me to have the week numbers included. Have
learned some fascinating things (some months have 6 weeks in
them!) and the joys of formating (grin!).


What do you think?


I'm no expert with the calendar module, having used it as many times as 
(probably only) once before!


However, skim-reading that page of the docs, I'd say that using the 
class to do the formatting is better than 'reinventing the wheel', and 
thus the question becomes: could the 'standard output' be post-processed 
into the form required?


The outline above (ignoring month/year and day headings) is basically:

weekNR  gap weekNR month> ...


as far across the page/screen as there is space/per the requirements.

Given that a  seems to be a fixed-length string, then 
you could indeed employ format() or f-strings with formatting.


The fact that some months have fewer, or more, weeks to include, is 
largely irrelevant. The solution is a standard "merge" algorithm. (us 
'silver surfers' cut our teeth on sorting, searching, and merging as the 
three pillars of "batch processing").


To print across the page/screen, we divide the available number of 
character-columns by the number of columns a single month's data 
requires (plus inter-month spacing) and this gives the maximum number of 
months the can be displayed 'across'.


Dividing that number into the number of months within the period, will 
give the number of month-rows required to 'do the job'.


A month-row could be defined as: 'as many lines as it takes to display 
every week of the month' (plus vertical separation/spacing).


So, now the challenge is to print each output line, combining 
(laterally) all of the relevant data/dates, in such a manner that after 
every so-many output lines, the visual-blocks representing each 
individual month's dates will become apparent.


The "merge" for line n (n:1-4~6) means to take the n-th  
from each month in the current month-row and format them into a single 
o/p line. If a month does not have an n-th week, then substitute the 
requisite number of spaces (unless handled by f-string/format() 
"width"). Print the o/p line...

(yes, I omitted the weekNR-s, but adding them is trivial)



I was starting from what I understood (how to print 'a' year) working
to get closer to what I could use. Ncal allows me to display a
calendar except I'm restricted to a display only 3 months wide. More
than one month is relatively easy to display from present but not
from some other point. It would seem that the 80 column display
still rules supreme - - - - - and that's on a 1920 pixel wide monitor.


It may be possible by sub-classing, to override t

Re: questions re: calendar module

2020-08-01 Thread dn via Python-list

On 02/08/2020 12:42, o1bigtenor wrote:

On Sat, Aug 1, 2020 at 7:24 PM o1bigtenor  wrote:

On Sat, Aug 1, 2020 at 6:29 PM dn via Python-list
 wrote:

On 01/08/2020 23:36, o1bigtenor wrote:

On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list
mailto:[email protected]>> wrote:
 On 31/07/2020 02:52, o1bigtenor wrote:
  > I regularly work in planning through multiple years at once.
  > This means that I like to have a lot of stuff available in a calendar
  > function.



Doing some searching - - - - sub-class really doesn't have a lot of 'official'
info. Perhaps an information source might be pointed out?


You're further along that path than I!

Sometimes the authors maintain an helpful web site/page, but I don't know.


...


Reading through more docs there is a possibility of using the 'format'
command. Would need to first come up with a way of describing the
months (with their attendant week numbers) and then describe a
formating system which would then enable a use of 'print' to achieve
the desired goal.

Is this perhaps a good way of doing this?


Outlined earlier.


Question: what is the specification for 'first month' and 'last month' 
in the calendar?


i) year-based: eg from 2020-2023, represents 48 months starting from Jan 
2020 and continuing until Dec 2023 (inclusive).


ii) month-based: there is no need to 'start' with January, or to finish 
in December, eg 2020-08 -> 2023-07


iii) week-based: (included because of evident import in your thinking), 
eg 2020-W26 -> 2023W25

- watch out for leap years!

The last introduces the (very inconvenient) possibility of the first or 
last month being an incomplete 4~6 week 'block' and thus perhaps 
doubling the complexity of the "merge". However, it may be more 
convenient to translate weekNR into monthNR (and thus, name) than the 
reverse.

(that's a question? not statement!)
--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


Re: Non IDE development strategy - what do others do that's fairly simple?

2020-08-01 Thread Cameron Simpson
On 29Jul2020 11:20, Chris Green  wrote:
>The existing code simply lives in ~/bin with a couple of modules in
>~/bin/pymods (which directory is in my PYTHONPATH).
>
>I use mercurial for configuration management of the code, directly in
>the ~/bin directory.  This works fine for the sort of minor bug fixing
>and updates that I do most of the time, I'm the only user so changing
>the 'live' code isn't a major issue and I can always drop back to the
>last working version using mercurial.

Step 1 is to copy this sideways: keep the existing setup, but do the dev 
in a separate directory. The Mykefile in my personal dev directory has a 
"_home" target which installed the current state of play into my home 
directory.

Once you have that, it is easy to make more clones to pursue things 
separately.

>So, finally to the question, does anyone else have this command line
>based sort of approach and, if so, what do they do to provide a
>'development version' of a program in parallel with a working version?

To that last part, I have a personal script "env-dev" (aliased as just 
"dev"), here:

https://hg.sr.ht/~cameron-simpson/css/browse/bin/env-dev?rev=tip

Feel free to copy it.

Its purpose is to run the code from the current directory by prefixing 
various path environment variables, etc. Additionally it sources the 
file ".env.sh" in the current directory or ancestor for customisation 
beyond what it does automatically. It also utilises the venv if present.

So to run the test code I go:

$ dev the-programme ...

and it uses the scripts and modules in my development directory.

>I guess virtualenv (Python 2) and venv (Python 3) address this problem
>but they do feel rather more complex than I actually need and I'm not
>very clear how you move code from the virtual environment to 'live'.

The nice thing about a virtualenv is that you can run specific Python 
versions with specific modules installed. It is easy to keep a few 
around.

You utilise the virtualenv by invoking via the "python" executable 
within the virtualenv. That hooks up the virtualenv for the run. (Ignore 
"activate", it is a confusing source of pain IMO.)

Moving to "production" is just a matter of maintaining a production 
virtualenv, using the python and modules you see fit for production.

For example, I keep a virtualenv in the "venv" subdirectory of the 
development tree. I keep a personal, "production", virtualenv in 
~/var/venv/3, and ~/var/venv/3/bin is towards the front of my $PATH.

Typically you keep a "requirements.txt" file in your dev tree which 
specifies the modules you want. The filename is just a convention. The 
to update production you'd just go:

~/var/venv/3/bin/pip install -U -r requirements.txt

where "~/var/venv/3/bin/pip" is _my_ production venv - adjust for your 
own, and "requirements.txt" is the reference file you want to use.

>There's also the issue that I'm moving code from Python 2 to Python 3
>so which virtual environment should I use?

Make one of each - that way it is easy to run your tests against either 
or both at once. So maybe (in your dev tree) make a "venv2" with a 
Python 2 virtualenv and a "venv3" with a Python 3 one, then you can run 
python out of each as required.

Also, keep a make target to build the virtualenvs. Here's mine, which 
just does one based on "python3".

dev = env-dev -d $. -x
base_python = python3
venv_dir = $./venv
venv_requirements = $./venv-requirements.txt
venv_pip = $(venv_python) -m pip
venv_python = $(venv_dir)/bin/python

_venv:
@[ -d '$(venv_dir)/' ] || set-x mkdir '$(venv_dir)'
[ -x '$(venv_python)' ] || { \
  set -xue \
  rm -rf '$(venv_dir)' \
  $(base_python) -m venv '$(venv_dir)' \
}
$(dev) $(venv_pip) install -U wheel pip
$(dev) $(venv_pip) install -U -r $(venv_requirements)


Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Issue with Python module downloads from Library for a beginner Python coder.

2020-08-01 Thread Sarvesh Poddar via Python-list
 Hi,
I am currently using Python 3.8.5 with IDLE environment that comes 
pre-installed with the Python application. I am using the book "An Introduction 
to computer science" by John Zelle as my reference.
The problem I am facing is "There is a python program named "graphics.py" that 
is used as reference in the book and I downloaded the python file from internet 
(link to the file - https://mcsp.wartburg.edu/zelle/python/graphics.py). I have 
kept this module in 
(C:\Users\sarvesh\AppData\Local\Programs\Python\Python38-32) and this is were 
my Python files also lie in C drive. The problem is that I am not able to 
import graphics.py file and when I try to do that following is the error I 
receive,
Traceback (most recent call last):
  File "", line 1, in     import graphics
  File 
"C:\Users\sarvesh\AppData\Local\Programs\Python\Python38-32\graphics.py", line 1
    Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:43:08) [MSC v.1926 32 
bit (Intel)] on win32           ^SyntaxError: invalid syntax
 I have installed, uninstalled and then re-installed Python 3.8.5 multiple 
times but the problem remains. I did a thorough internet search and most of 
them suggested using sys path and following is the result,

import sys>>> sys.path['', 
'C:\\Users\\sarvesh\\AppData\\Local\\Programs\\Python\\Python38-32\\Lib\\idlelib',
 
'C:\\Users\\sarvesh\\AppData\\Local\\Programs\\Python\\Python38-32\\python38.zip',
 'C:\\Users\\sarvesh\\AppData\\Local\\Programs\\Python\\Python38-32\\DLLs', 
'C:\\Users\\sarvesh\\AppData\\Local\\Programs\\Python\\Python38-32\\lib', 
'C:\\Users\\sarvesh\\AppData\\Local\\Programs\\Python\\Python38-32', 
'C:\\Users\\sarvesh\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\site-packages']
When I write a different line -  (from import graphics *), this is the output:
from graphics import *Traceback (most recent call last):  File "", 
line 1, in     from graphics import *  File 
"C:\Users\sarvesh\AppData\Local\Programs\Python\Python38-32\graphics.py", line 
1    Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:43:08) [MSC v.1926 32 
bit (Intel)] on win32           ^SyntaxError: invalid syntax
Please do let me know if I am missing out something very basic.
Thanks and I look forward.On Saturday, 1 August, 2020, 07:54:19 am IST, boB 
Stepp  wrote:  
 
 On Thu, Jul 30, 2020 at 9:24 AM Sarvesh Poddar via Python-list
 wrote:

> I re-installed Python in my Windows system as the earlier one was not able to 
> import modules...

You do not provide much detail to diagnose what your problem(s)
is(are).  By the "earlier one" is it the same version as the one you
re-installed?  Were you able to run IDLE with the "earlier one"?  By
not being able to import modules do you mean modules from Python's
standard library?  Or do you mean installing third party libraries
using pip?

> ...But now I am not able to open IDLE after multiple tries.

Have you looked in your start menu in the list of installed programs
for Python?  If it is there did you expand it and see if there is an
entry for IDLE?  How have you been trying (unsuccessfully) to open
IDLE?


-- 
boB
  
-- 
https://mail.python.org/mailman/listinfo/python-list