Search the Community

Showing results for tags 'Python'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH


  • Community Calendar




Website URL








Found 8 results

  1. So this generates 3 arrays with 5 numbers in each one. How would I go about checking each array to see if there are any duplicate numbers in an array?
  2. Ok, so I know python specifically isn't taught onw3schools, but maybe somebody knows a little about it. I am trying to use raw input instead of prompts, but it isnt working, can anyone tell me why this won't work? $('#before').click(function(){ $(".body").empty(); hello = raw_input("Hello: "); }); "Hello: " never shows up on the screen. Please help
  3. Hi All,I'm developing a basic website and have a question. Hope it's not too much basic. I'm new in web stuff.I have the following code: $.ajax({url: '/blabla/yadayada'type: "get",success:function(data, testStatus, jqXHR){.........},error: function(jqXHR, testStatus, errorThrown){alert('error')}}); In addition, i have the following Python code: class AfCont(object):def __init__(self, target, context):self.target_server = targetself.context = contextself.baseContext = "/MyApp%s" % ( ("-" + self.context) if self.context else "")print "Starting %s with server: %s " % (self, self.target_server)def general_url(self, url_sfx):headers = {"Accept": "application/json"}params = Nonethe_url = "%s/%s" % (self.baseContext, url_sfx)print "%s %s %s " % (self, self.target_server, the_url)conn = httplib.HTTPConnection(self.target_server, "8080")conn.request("GET", the_url, params, headers)response = conn.getresponse()theResp = theResp@cherrypy.exposedef bla_yada(self):htmlText = self.general_url("blabla/yadayada")return htmlText As you can see in the Ajax code, my URL is /blabla/yadayada. However, i need to send GET requests to /blabla/yadayada/number. I want to control the number part with a parameter. For example: number = 150 -- > `/blabla/yadayada/150`number = 9595-- > `/blabla/yadayada/9595` Can someone help me with that? Hope i was clear enough.
  4. I am using "Python-3.4.1 32 bit" on "Windows 7 64 bit" machine with "Selenium" using "Firefox 33". I am trying to automate downloading a "CSV" file from a secured website after furnishing the necessary credentials. I have written the required code to navigate to the correct element to initiate the download of the file but I am stuck when Firefox gives the download box (Dialog box title: Opening export.csv, "Open with" and "Save File" options as radio buttons with "OK" and "Cancel" as buttons). I want the file to be downloaded automatically and for that I have tried the following codes without success: from selenium import webdriverfp = webdriver.FirefoxProfile()fp.set_preference("",False)fp.set_preference("",2)fp.set_preference("", "C:UsersarunDownloads")fp.set_preference("", "C:UsersarunDownloads")fp.set_preference("", "C:UsersarunDownloads")fp.set_preference('browser.helperApps.neverAsk.saveToDisk',"text/csv")driver = webdriver.Firefox(fp)driver.get("") and then click on the button to start the download. But, it still shows the dialog box. I even tried handling it as an alert and tried alert = driver.switch_to_alert()alert.accept() but this always gave an exception of alert not found which led me to the conclusion that it might not be a JavaScript functionality after all but rather a web element. I am giving sufficient delay for the alert box to appear before I try to interact with it using the "alert" object code shown above.What do I do to get this downloaded automatically without the dialog box interaction (the way it's handled in Google Chrome browsers)I think that the server is not assigning the correct MIME type for the file that is being downloaded? The file I am downloading is of type: "text/csv" and in Firefox when the dialog box appears, "Do this automatically for files like this from now on" check box is greyed out.Thanks for your help and timeCheers!
  5. Dear Experts,I'm trying to parse an odd XML file that looks like this:<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" ""><plist version="1.0"><dict><key>Major Version</key><integer>1</integer><key>Minor Version</key><integer>1</integer><key>Application Version</key><string>9.2.1</string><key>Features</key><integer>5</integer><key>Show Content Ratings</key><true/><key>Library Persistent ID</key><string>9210E514389C76D3</string><key>Tracks</key><dict><key>732</key><dict><key>Track ID</key><integer>732</integer><key>Name</key><string>Tears All Over Town</string><key>Artist</key><string>A Girl Called Eddy</string><key>Album Artist</key><string>A Girl Called Eddy</string>...</dict><key>760</key><dict><key>Track ID</key><integer>760</integer><key>Name</key><string>The Nightingale</string><key>Artist</key><string>Angelo Badalamenti</string><key>Album</key><string>Twin Peaks</string><key>Genre</key><string>Soundtrack</string><key>Kind</key><string>MPEG audio file</string><key>Size</key><integer>7109800</integer><key>Total Time</key><integer>296150</integer><key>Disc Number</key><integer>1</integer><key>Disc Count</key><integer>1</integer><key>Track Number</key><integer>4</integer><key>Track Count</key><integer>11</integer><key>Year</key><integer>1990</integer><key>Date Modified</key><date>2006-01-04T06:51:56Z</date><key>Date Added</key><date>2009-04-02T02:04:11Z</date><key>Bit Rate</key><integer>192</integer><key>Sample Rate</key><integer>44100</integer><key>Play Count</key><integer>4</integer><key>Play Date</key><integer>3493240930</integer><key>Play Date UTC</key><date>2014-09-11T05:42:10Z</date><key>Sort Name</key><string>Nightingale</string><key>Persistent ID</key><string>9B002DC50111B620</string><key>Track Type</key><string>File</string><key>File Folder Count</key><integer>4</integer><key>Library Folder Count</key><integer>1</integer></dict><key>762</key>...Every field in the Itunes format has <key> for the fieldname, and the <datatype> surrounding the value.This looks a lot different from the xml format that I saw in this tutorial.<CD><TITLE>Picture book</TITLE><ARTIST>Simply Red</ARTIST><COUNTRY>EU</COUNTRY><COMPANY>Elektra</COMPANY><PRICE>7.20</PRICE><YEAR>1985</YEAR></CD>First I experimented using grep on cygwin. But I don't know how to get a specific set of three lines out of the grouping with grep.With R, I was trying to parse the file, until I looked and saw that the format was different from all the examples.This post made it look easy:How can I export my iTunes library information to a spreadsheet? it completely failed. The xml doc got imported into Open Office as a document. Not a spreadsheet.For each CD, I want to extract the Artist, Album, and Composer (if it's there)Questions:Is there a name for this type of XML file?What would be the best tool and way to parse the info from the file?grep on cygwinRPythonJavaXQuerysomething else???Thanks a lot!
  6. I am trying to learn any programming language and I have looked into several sites including Oracle and I must say everything I've tried to learn hasn't stayed in well. I personally love the layout and the design as well as the ability to try it yourself on W3Schools' site. I Understand that W3Schools was made to teach everything you need to know to create a webpage, or to be used as a reference to commands in a language used in making a webpage, but I and many others would greatly benefit if W3Schools could adopt a programming section. I am starting to learn Java and as for right now I only request Java, But I would like to see all commonly used programming language. I used W3Schools to learn HTML, CSS, and a little bit of JavaScript, It took me a little under 7 hours to learn a large portion of HMTL and CSS. I just love W3Schools' Website and Teaching ways. I would love to learn every language possible here, I find this the best way to learn Computer languages.
  7. Hi! I am a *very* green amateur on web programming so maybe the question is kind of heretical.So is it possible (or reasonable) to use python instead of java for programming a web page?(Why not?) Thanks
  8. Hey all,I need some advice.I'm currently in my final year at uni, and my final year project looks interesting too me.Anyways in a nut shell i have to connect a radio receiver to a web server. And then allow the client to scan frequencies or choose a frequence on a web page.Also i have to have create a spectrum plot for each frequency strength.I was just wondering is this at all possible with python or is php or RoR better?