Questions tagged [python]

Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability.

Python logo

Adapted from the SO Python tag wiki.

Python is a dynamically and strongly typed programming language, used for developing a wide range of applications. The philosophy of Python is succinctly formulated in The Zen of Python (Author: Tim Peters), which can be revealed by issuing this command at the interactive interpreter:

>>> import this

The exhaustive and up-to-date reference to the Python specification and standard library documentation can be found in the official docs. There are a wide variety of implementations, which have relevant Stack Overflow tags reserved for them, although for most questions the tag should be sufficient. The reference implementation is known as CPython.

The current stable versions are 2.7.1 and 3.2.

557 questions
8
votes
3 answers

How install both Python32 and Python33 on OS X for testing with tox?

I'm adding Python 3.x support to my open-source project and want to add both Py32 and Py33 test environments to my tox.ini. I already have Py26 and Py27 tox environments that work fine and I just installed Python 3.3 from homebrew and got the Py33…
scanny
  • 183
  • 1
  • 5
3
votes
1 answer

python code for asking microphone permission in Chrome and other Browser?

I am developing an application where I need microphone access. So, anyone can tell me the python code for asking microphone permission in Chrome or any other Browser.
3
votes
2 answers

How do you test an application that uses current time?

In an interview, they asked me to write a program to get current (live) time of given states in a list. I have written the code for it and was asked to tell how I would test the program to check if the output having time is correct. I was stuck as…
joey
  • 131
  • 1
2
votes
1 answer

Looping over the array of other function in current function

I need a help to know how can I can iterate a loop over a array which is in another function of the same class. I tried using the following similar code for automation in selenium and I get the following error. class Test: def…
Ranadheer
  • 89
  • 1
  • 3
  • 10
1
vote
3 answers

Desktop application automation

I need to automate desktop application i.e Bluetooth PTS tool. But can't find any good way to do. I have no exposure to scripting.
1
vote
1 answer

How would I retrieve links of every page, and through those links, I want to retrieve links of the products

next_btn = driver.find_element_by_xpath("//a[@class='ge-49M']") for i in next_btn: driver.get(i) lnks = driver.find_elements_by_xpath("//a[@class='_2UzuFa']") for z in lnks: href_new.append(z.get_attribute('href')) Here I am…
Rahulrvz
  • 11
  • 2
1
vote
1 answer

Selenium + Python: Abort a test after x minutes

Details My test scenarios currently cover over 300 test cases. Everything is written in Python (3.8) and Selenium and all test cases are covered by exceptions. At the moment there is only one possibility missing which can be used after X minutes…
Mornon
  • 1,117
  • 1
  • 9
  • 24
1
vote
0 answers

how to plot multiple locations in google.map using flask

i'm traying to showing multiple points in map from a csv file named 'likibularochelle_test.csv' this file contains 866 points with latitude and longitude but i can't view all of this points just 33 as a matter of fact i plot just the first 33 point…
1
vote
1 answer

Data type/value of argument checking

Consider ClassA that has a method that takes an argument, say a string. This method then passes the argument to ClassB to do something with it. Should ClassA be assuring that the argument is valid (string type, correct format, etc) or should ClassA…
Brenden
  • 11
  • 1
0
votes
0 answers

How to download multiple files in local system using POST API request in python rather than in ascii or binary form data?

I struck in one scenario in which i need to download multiple files in local repository using POST API request in python 3.9.12. I tried below code but not able to resolve the issue. def download(url: str, dest_folder: str): if not…
0
votes
1 answer

10th element in rating is not present so what should i do to print dash(-) in that place tto matchup the data frame

import pandas as pd import selenium from selenium import webdriver from selenium.common.exceptions import NoSuchElementException import pandas as pd import time driver = webdriver.Chrome(r"C:\Program Files…
Rahulrvz
  • 11
  • 2
0
votes
1 answer

AttributeError: module 'selenium.webdriver.common.keys' has no attribute 'RETURN'

When I run my script it gives me this error: Traceback (most recent call last): File "C:\Development\Python_Project\SDETpythonProject\SDET_Package\my_firstProject.py", line 18, in search.send_keys(keys.RETURN) AttributeError: module…
Annita
  • 1
  • 2
0
votes
2 answers

Reading values from CSV file and convert it to json in python

my code : import csv import json with open('file.csv', 'r') as f: reader = csv.reader(f, delimiter=';') data_list = list() for row in reader: data_list.append(row) data = [dict(zip(data_list[0],row)) for row in…
0
votes
2 answers

Loop Phyton / Selenium

I have a piece of code in Pycharm , and I want to loop just a part of it, not with the beginning part where are located the login info. Let's say that I want to loop from the 44 line to 99 and only for 20 loops.
Alex Alex
  • 59
  • 3
0
votes
2 answers

How to get the last value in a list/string using Python

I am a beginner in writing Python scripts and I need help on the following: Threads::num,47141,47146,47151,47156,47161,47166,47171,47176 How can I get and display the last value '47176'? The following is the part of the code I have written: elif…
1
2