Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Splitting lines ang grouping three at once
Post: RE: Splitting lines ang grouping three at once

Last tentative ... hoping someone helps by writing the solution. Thank you, forum! # --- line6ter.py ------ with open ("short.txt", "r") as myfile: data = "" index=0 data[index:(index + 3)] = myfile...
samsonite General Coding Help 5 2,764 Jun-21-2019, 05:16 PM
    Thread: Splitting lines ang grouping three at once
Post: RE: Splitting lines ang grouping three at once

Error erupts # --- line6bis.py ------ with open ("short.txt", "r") as myfile: data[index:(index + 3)] = myfile.read().splitlines() tle= data [range(0, len(data), 3)] print(tle)Error:C:\Training&g...
samsonite General Coding Help 5 2,764 Jun-21-2019, 02:15 PM
    Thread: Splitting lines ang grouping three at once
Post: Splitting lines ang grouping three at once

What I've done, up to now, is successful only for the first group of short.txt database, while my goal is to have some drifts on adjusting iteratively the line tle= data[0]+'\n'+data[1]+'\n'+data[2]+'...
samsonite General Coding Help 5 2,764 Jun-21-2019, 09:43 AM
    Thread: Help on locating strings somewhere in the screen
Post: Help on locating strings somewhere in the screen

The following code, taken as an example, shows the string in left upper corner while the time flows: # ------- loctime.py ------------- import os,time clear = lambda: os.system('cls') # for i in...
samsonite General Coding Help 2 2,461 Mar-26-2019, 08:01 AM
    Thread: How to get python to download YouTube videos in the background?
Post: RE: How to get python to download YouTube videos i...

Found the way ... a couple of minutes later -> http://imgbox.com/918gjjnO Thx
samsonite General Coding Help 11 10,717 Mar-25-2019, 04:57 AM
    Thread: How to get python to download YouTube videos in the background?
Post: RE: How to get python to download YouTube videos i...

Thanks a lot, snippsat, for your kind answer. Further info needs. Which command I've to add to download one single file .mp4 coming from this choice? Output:22 mp4 1280x720 hd720 ...
samsonite General Coding Help 11 10,717 Mar-24-2019, 05:33 PM
    Thread: How to get python to download YouTube videos in the background?
Post: RE: How to get python to download YouTube videos i...

Beside question. Is it possible to create a Python code like the one below written in PHP? Several quality options are selectable, as shown here http://imgbox.com/YciMpWyC Output: Youtube address: ...
samsonite General Coding Help 11 10,717 Mar-24-2019, 02:56 PM
    Thread: Parsing Large Numbers Question
Post: RE: Parsing Large Numbers Question

Hi DeaD_EyE. You wrote: Do you know the biggest differences to Decimal which is in the stdlib of Python? What I know, up to now, is shown in next applied example: # -------- tempo4.py ---------------...
samsonite General Coding Help 5 3,344 Mar-24-2019, 08:46 AM
    Thread: Parsing Large Numbers Question
Post: RE: Parsing Large Numbers Question

Hi post-opener. Back to your question, in order to compute 431.1**1.9907 (as per your above example) with 60 significant figures, the code can be strongly simplified as shown underneath. Cheers >&g...
samsonite General Coding Help 5 3,344 Mar-24-2019, 07:03 AM
    Thread: Parsing Large Numbers Question
Post: RE: Parsing Large Numbers Question

The correct use of multiprecision is as follows; mp.dps, not math.mp.dps, Cheers >>> from mpmath import * >>> mp.dps = 2000 >>> print (pi) 3.14159265358979323846264338327950...
samsonite General Coding Help 5 3,344 Mar-23-2019, 09:00 PM
    Thread: System of 3 non-linear equations in 3 unknowns (how-to-solve?)
Post: RE: System of 3 non-linear equations in 3 unknowns...

Wonderful solution, scidam! Just added the output of coords in degrees. Thank you very much, and cheers # ---------- sist_3eq.py ----------- from math import pi, sin, tan, cos from scipy.optimize impo...
samsonite General Coding Help 2 3,573 Mar-23-2019, 10:14 AM
    Thread: System of 3 non-linear equations in 3 unknowns (how-to-solve?)
Post: System of 3 non-linear equations in 3 unknowns (ho...

This detailed screenshot http://imgbox.com/qFBxoHWd shows how I've solved, in the old past, the system by means of a MatLab function (fsolve), and I'ld like to know if a similar (short) way exists in ...
samsonite General Coding Help 2 3,573 Mar-23-2019, 07:25 AM
    Thread: Very strange error of indentation
Post: RE: Very strange error of indentation

Hi Verb Conjugator! If you get a glance to the source (uploaded into the opening post) http://reionization.org/wp-content/uploa...st2ra.html you may note that the mismatch is created by in [4] piece o...
samsonite General Coding Help 12 5,224 Mar-22-2019, 10:45 AM
    Thread: Very strange error of indentation
Post: RE: Very strange error of indentation

More details, here http://imgbox.com/adMgXtI5 Cheers
samsonite General Coding Help 12 5,224 Mar-22-2019, 07:26 AM
    Thread: Very strange error of indentation
Post: RE: Very strange error of indentation

Oh yes, snippsat code, renamed br.py, works properly! Thanks all # ---------br.py ------------ import numpy as np from astropy.coordinates import SkyCoord, Angle, EarthLocation from astropy.time impor...
samsonite General Coding Help 12 5,224 Mar-21-2019, 08:52 PM
    Thread: Very strange error of indentation
Post: RE: Very strange error of indentation

Nothing changes clicking On/Off white spaces, unfortunately. The figure shows white spaces settled on: http://imgbox.com/5uquVik4
samsonite General Coding Help 12 5,224 Mar-21-2019, 07:59 PM
    Thread: Very strange error of indentation
Post: RE: Very strange error of indentation

My editor (geany) doesn't show anomalies, as per this screenshot http://imgbox.com/GUsclMUy Thank you, administrator.
samsonite General Coding Help 12 5,224 Mar-21-2019, 07:11 PM
    Thread: Very strange error of indentation
Post: Very strange error of indentation

Reference is made to the python code listed here http://reionization.org/wp-content/uploa...st2ra.html and, in details, to this piece one http://imgbox.com/uaj4dzLS By running the file below, and bein...
samsonite General Coding Help 12 5,224 Mar-21-2019, 06:30 PM
    Thread: Trouble on importing function from astropy library
Post: RE: Trouble on importing function from astropy lib...

Completely defined, now! Output:[<Quantity 0.034465 arcsec>, <Quantity 0.483674 arcsec>]# -------- tempo8.py --------------- from astropy.time import Time from astropy.utils import iers t ...
samsonite General Coding Help 4 3,709 Mar-21-2019, 12:18 PM
    Thread: Trouble on importing function from astropy library
Post: RE: Trouble on importing function from astropy lib...

The drawback comes from the file iers.py whose line 294 doesn't work properly, as shown here http://imgbox.com/vWuJoMkN So, the matter doesn't pertain this thread, which should be marked as solved. Th...
samsonite General Coding Help 4 3,709 Mar-21-2019, 05:36 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020