Dev Shed Forums - Python Programming http://forums.devshed.com/ Python Programming forum discussing coding techniques, tips and tricks, and Zope related information. Python was designed from the ground up to be a completely object-oriented programming language. en Wed, 22 Nov 2017 14:22:30 GMT vBulletin 60 http://forums.devshed.com/images/misc/rss.png Dev Shed Forums - Python Programming http://forums.devshed.com/ Oanda Api for price streaming http://forums.devshed.com/python-programming/979424-oanda-api-price-streaming-new-post.html Fri, 10 Nov 2017 14:56:07 GMT Hello everyone I am not sure if this is the right place to ask questions if not please refer me to the right place and I will move my question there . I am trying to make GUI application and implement Oanda API in it so I can stream forex pairs prices in my own GUI using matplotlib. I have everything set but the problem is I don't know how to retrieve the data using their API and most of the documentations on the net is all about algo trading , but what I am interested about at this point is to get instruments prices and stream them in my own GUI can anyone help me please on this? I m doing it to learn python ]]> Python Programming beforcoffe http://forums.devshed.com/python-programming-11/oanda-api-price-streaming-979424.html python CSV http://forums.devshed.com/python-programming/979400-python-csv-new-post.html Tue, 07 Nov 2017 19:35:26 GMT I need to download the printed thread to a CSV file how do I do it?   Code: --------- from urllib.request import urlopen as uReq from bs4 import BeautifulSoup as soup import urllib I need to download the printed thread to a CSV file
how do I do it?

 
Code:

from urllib.request import urlopen as uReq
from bs4 import BeautifulSoup as soup
import urllib

my_url ='http://www.telesport.co.il/%D7%90%D7%96%D7%95%D7%A8%20%D7%95%D7%95%D7%99%D7%A0%D7%A8'
uClient = uReq(my_url)
page_html = uClient.read()
uClient.close()
page_soup = soup(page_html, "html.parser")

cc = page_soup.findAll("td",{"class":"th_td_WinnerteamsAndBetType"})

for i in range(10):
    print(cc[0+i].text, i)

]]>
Python Programming davidc8 http://forums.devshed.com/python-programming-11/python-csv-979400.html
Brand new to Python http://forums.devshed.com/python-programming/979381-brand-python-new-post.html Sat, 04 Nov 2017 02:08:00 GMT Brand new to coding and Python just saying hello! Brand new to coding and Python just saying hello! ]]> Python Programming mmaynard http://forums.devshed.com/python-programming-11/brand-python-979381.html Python dezoomify challenging code http://forums.devshed.com/python-programming/979366-python-dezoomify-challenging-code-new-post.html Thu, 02 Nov 2017 13:22:28 GMT Hello, I tried to use dezoomify code (from Github). The code allow to download extra-large images -with sample image: all works fine. -with desired image from BIOMAX: error -using Microsoft edge to download via ophir site (online dezoomer): only 30% of the file was downloaded and then it stopped, probably the file is to large. -also tried all advises in github, wiki, sourcefrog etc. ... Hello,
I tried to use dezoomify code (from Github).
The code allow to download extra-large images
-with sample image: all works fine.
-with desired image from BIOMAX: error
-using Microsoft edge to download via ophir site (online dezoomer): only 30% of the file was downloaded and then it stopped, probably the file is to large.
-also tried all advises in github, wiki, sourcefrog etc.
when running the code it gives the error: Zoomify base directory not found. Ensure the given URL contains a Zoomify object.
the desired image located at the following link:
https://www.biomax.us/index.php?rout...ify&park=31058

I have no permission to attache file, so I'll post the code as reply to this post.

Can someone help me solve this complicated challenge?

Thanks! ]]>
Python Programming Ezra Ezra http://forums.devshed.com/python-programming-11/python-dezoomify-challenging-code-979366.html
<![CDATA[[JCads Converter] Error Found !...]]> http://forums.devshed.com/python-programming/979331-jcads-converter-error-found-new-post.html Thu, 26 Oct 2017 19:33:31 GMT Hey Python Programmers... I try to create an simple program they can convert images to other images. Now i get an error from python if you fails with typ your image file... This is my script, i use PILLOW in python 3.6.2: Code: --------- # JCads Texturics - Converter Hey Python Programmers...

I try to create an simple program they can convert images to other images.
Now i get an error from python if you fails with typ your image file...

This is my script, i use PILLOW in python 3.6.2:
Code:

# JCads Texturics - Converter
# ---------------------------
# Made by Jamie van Cadsand
from PIL import Image
import time




print("")
print("JCADS TEXTURICS / CONVERTER:")
print("")
print("")


# Define Defeult_Converting
def ConvertToDefeult():
    print("")
    try:
        defeultImage = Image.open(input("Load Image: ")).convert('RGB')

        defeult = str(input("Press 'P' to Preview or 'S' to Save: "))
        if(defeult == "P"):
            defeult = "P"
            defeultImage.show()
            print("")
            print("Image Preview")
            print("")

            quitJCads = str(input("Press any key to Quit: "))
            if(quitJCads == "Q"):
                quitJCads = "Q"

                print("")
                print("Quit JCads...")
                time.sleep(1)
                quit()

            else:
                print("")
                print("Quit JCads...")
                time.sleep(1)
                quit()

        elif(defeult == "S"):
            defeult = "S"
           
            try:
                defeultImage.save(input("Brouse Image: "))
                print("")
                time.sleep(1)
                print("Succesfully Saved...")

                print("")
                print("Quit JCads...")
                time.sleep(1)
                quit()

            except IOError:
                print("")
                print("File not Found...")
                print("")

                print("Quit JCads...")
                time.sleep(1)
                quit()

        else:
            print("")
            print("Only press 'P' or 'S'...")
            print("")

            print("Quit JCads...")
            time.sleep(1)
            quit()


    except IOError:
        print("")
        print("File not Found")
       
       
       



# Define Defeult_Converting
def ConvertToTransparant():
    print("")
    try:
        defeultImage = Image.open(input("Load Image: ")).convert('RGBA')

        defeult = str(input("Press 'P' to Preview or 'S' to Save: "))
        if(defeult == "P"):
            defeult = "P"
            defeultImage.show()
            print("")
            print("Image Preview")
            print("")

            quitJCads = str(input("Press any key to Quit: "))
            if(quitJCads == "Q"):
                quitJCads = "Q"

                print("")
                print("Quit JCads...")
                time.sleep(1)
                quit()

            else:
                print("")
                print("Quit JCads...")
                time.sleep(1)
                quit()

        elif(defeult == "S"):
            defeult = "S"
           
            try:
                defeultImage.save(input("Brouse Image: "))
                print("")
                time.sleep(1)
                print("Succesfully Saved...")

                print("")
                print("Quit JCads...")
                time.sleep(1)
                quit()

            except IOError:
                print("")
                print("File not Found...")
                print("")

                print("Quit JCads...")
                time.sleep(1)
                quit()

        else:
            print("")
            print("Only press 'P' or 'S'...")
            print("")

            print("Quit JCads...")
            time.sleep(1)
            quit()


    except IOError:
        print("")
        print("File not Found")


       

# Define Defeult_Converting
def ConvertToGrayscale():
    print("")
    try:
        defeultImage = Image.open(input("Load Image: ")).convert('L')

        defeult = str(input("Press 'P' to Preview or 'S' to Save: "))
        if(defeult == "P"):
            defeult = "P"
            defeultImage.show()
            print("")
            print("Image Preview")
            print("")

            quitJCads = str(input("Press any key to Quit: "))
            if(quitJCads == "Q"):
                quitJCads = "Q"

                print("")
                print("Quit JCads...")
                time.sleep(1)
                quit()

            else:
                print("")
                print("Quit JCads...")
                time.sleep(1)
                quit()

        elif(defeult == "S"):
            defeult = "S"
           
            try:
                defeultImage.save(input("Brouse Image: "))
                print("")
                time.sleep(1)
                print("Succesfully Saved...")

                print("")
                print("Quit JCads...")
                time.sleep(1)
                quit()

            except IOError:
                print("")
                print("File not Found...")
                print("")

                print("Quit JCads...")
                time.sleep(1)
                quit()

        else:
            print("")
            print("Only press 'P' or 'S'...")
            print("")

            print("Quit JCads...")
            time.sleep(1)
            quit()


    except IOError:
        print("")
        print("File not Found")








       
# Define Project Starter
def startProject():
    img2assent = str(input("Converter Type: "))
    if(img2assent == "Defeult"):
        img2assent = "Defeult"
        ConvertToDefeult()
    elif(img2assent == "Transparant"):
        img2assent = "Transparant"
        ConvertToTransparant()
    elif(img2assent == "Grayscale"):
        img2assent = "Grayscale"
        ConvertToGrayscale()
    else:
        print("")
        print("Converter not Supported...")
        print("")
               
        print("Quit JCads")
        time.sleep(1)
        quit()
       




choose = str(input("Do you want start an project ?... 'Yes' or 'No' !: "))
if(choose == "Yes"):
    choose = "Yes"
    print("")
    print("Setup...")
    print("")
    time.sleep(3)
    startProject()
elif(choose == "No"):
    choose = "No"
    print("")
    print("Quit JCads...")
    time.sleep(1)
    quit()
else:
    print("Start Project or Quit JCads...")

This is an script to write this program in python 3.6.2, but i want to write my own error if my
user of my program typ an failed file name (or try to load his image, including extension).

Now python give an python error, not my own error... it happens if you try to save your
edited image without extension... it give an python error and not my own error. I used
excacly an IOError, but it don't works...

Can anyone help me with my code ?... thanks, Jamie. ]]>
Python Programming JamieVanCadsand http://forums.devshed.com/python-programming-11/jcads-converter-error-found-979331.html
Simple cli menu quits on selection http://forums.devshed.com/python-programming/979307-simple-cli-menu-quits-selection-new-post.html Mon, 23 Oct 2017 19:03:06 GMT Hello, First day on Python :) I was looking to create a simple cli sample menu for my Ubuntu 17.10 and default Python 3.6.3 and i end up to this one: Code: --------- #!/usr/bin/env python Hello,

First day on Python :)

I was looking to create a simple cli sample menu for my Ubuntu 17.10 and default Python 3.6.3 and i end up to this one:

Code:

#!/usr/bin/env python
 
def menu():
    print ("Welcome, \n 1. Print Hello \n 2. Print World \n 3. Print Python \n 4. Print Hello World")
    choice = input()
 
    if choice == "1":
        print("Hello")
        menu()
 
    if choice == "2":
        print("World")
        menu()
 
    if choice == "3":
        print("Python")
        menu()
 
    if choice == "4":
        print("Hello World")
        menu()
 
 
menu()

hen i run it from terminal the menu appear with no issues but when i add a selection it quits to command prompt with no errors :(

Any help?

Thank you ]]>
Python Programming pamamolf http://forums.devshed.com/python-programming-11/simple-cli-menu-quits-selection-979307.html