Re: path error

"Jose M.Allegue" <[email protected]>
Newsgroups gmane.comp.python.reportlab.user
Message-ID <CAE_xd5AXZm0w--L_hxTZf1pxWO+O750RuO5rsjQi9WfP69s8Ew@mail.gmail.com>
#  SECTOR SEARCH

import re
from math import tan
import tkinter
from tkinter import filedialog
from reportlab.pdfgen import canvas


ruta= tkinter.filedialog.askopenfilename()


with open(ruta,'r') as fh:
    lector = fh.read()
    match = re.search(r'First.+',lector)
    turn_direction = (match.group().split(':')[1])
    match = re.search(r'Commence.+',lector)
    initial_track = (match.group().split(':')[1])
    match = re.search(r'Leg Len.+',lector)
    long_first_track = (match.group().split(':')[1])
    long_first_track = long_first_track.replace(',','.')
    long_primera_pata = (float(long_first_track.strip()))/2
    long_primera_pata = round(long_primera_pata,1)
    match = re.search(r'Search Speed.+',lector)
    search_speed = (match.group().split(':')[1])
    radial_space = (long_primera_pata)/2
    sector_angle = 60
    pattern_radius = round(long_primera_pata*0.866,1)
    pat =
re.compile(r'((?m)^\t\s([1-9]?[0-9]\s[0-9]?[0-9]\.[0-9]{2})\s([NS])),(.+([WE]))')
    matcher=re.search(pat,lector)
    csp = matcher.group().strip().split(',')

    print('1L - START POSITION   :',csp[0],csp[1])
    print('2L - TURN DIRECTION   :',turn_direction)
    print('2R - INITIAL TRACK    :',initial_track)
    print('3L - RADIAL SPACE     :',"%.2f" %long_primera_pata)
    print('3R - SECTOR ANGLE     :',sector_angle)
    print('4L - SPEED            :',search_speed)
    print('4R - PATTERN RADIUS   :',"%.2f" %pattern_radius)



ruta = tkinter.filedialog.asksaveasfilename()+'.pdf'

c = canvas.Canvas(ruta)
from reportlab.lib.units import inch
# move the origin up and to the left
c.translate(inch,inch)
# define a large font
c.setFont("Helvetica", 80)
# choose some colors
c.setStrokeColorRGB(0.2,0.5,0.3)
c.setFillColorRGB(1,0,1)
# draw a rectangle
c.rect(inch,inch,6*inch,9*inch, fill=1)
# make text go straight up
c.rotate(90)
# change color
c.setFillColorRGB(0,0,0.77)
# say hello (note after rotate the y coord needs to be negative!)
c.drawString(3*inch, -3*inch, "1,2,3,4,5,6,")
c.showPage()
c.save()



2014-08-11 10:00 GMT+02:00 Andy Robinson <[email protected]>:

> Can please you send us a piece of code which reproduces the error?
>
> Thanks,
>
>
> --
> Andy Robinson
> Managing Director
> ReportLab Europe Ltd.
> Thornton House, Thornton Road, Wimbledon, London SW19 4NG, UK
> Tel +44-20-8405-6420
> _______________________________________________
> reportlab-users mailing list
> [email protected]
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>



-- 
jose m allegue

[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.