Python Forum
Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 19,982
» Latest member: carlosdiego
» Forum threads: 38,733
» Forum posts: 175,565

Full Statistics

Online Users
There are currently 50 online users.
» 2 Member(s) | 45 Guest(s)
Bing, Google, AOL, SpongeB0B, carlosdiego

Latest Threads
Parse Markdown / get the ...
Forum: General Coding Help
Last Post: SpongeB0B
21 minutes ago
» Replies: 0
» Views: 11
Error: cannot mix str wit...
Forum: General Coding Help
Last Post: Joliekeva
5 hours ago
» Replies: 4
» Views: 1,988
Integer Factorization Too...
Forum: Code sharing
Last Post: buran
Yesterday, 07:43 AM
» Replies: 2
» Views: 409
My goal to be hired worki...
Forum: News and Discussions
Last Post: GnomeSweetGnome
Yesterday, 12:21 AM
» Replies: 2
» Views: 1,044
Unable to resolve FileNot...
Forum: General Coding Help
Last Post: noisefloor
Sep-29-2025, 05:45 PM
» Replies: 6
» Views: 1,100
Comparing 2 100GB Drives/...
Forum: General Coding Help
Last Post: snippsat
Sep-29-2025, 12:59 PM
» Replies: 8
» Views: 769
Select Python comment (#)...
Forum: General Coding Help
Last Post: tester_V
Sep-28-2025, 06:39 PM
» Replies: 7
» Views: 3,074
what does % stand for in ...
Forum: General Coding Help
Last Post: Gribouillis
Sep-27-2025, 06:49 PM
» Replies: 4
» Views: 2,518
My First App
Forum: Code Review
Last Post: carlbidwell
Sep-27-2025, 10:53 AM
» Replies: 8
» Views: 9,095
how to export a dictionar...
Forum: GUI
Last Post: noisefloor
Sep-26-2025, 05:13 PM
» Replies: 4
» Views: 1,554

 
  sorted function example mystery
Posted by: sabaidii2 - Feb-10-2020, 02:23 AM - Forum: General Coding Help - Replies (4)

The following code works, but I don't know why (I'm using python v 3.7.3)

print(f'{"".join(sorted("foo", key="of".index))}')
..... More

Print this item

  Help with modules
Posted by: dock1926 - Feb-10-2020, 02:23 AM - Forum: Homework - Replies (2)

I have 2 separate python files one is my code for print statements and other code the other file is for my functions. I import the Mylib file. I'm hav..... More

Print this item

  Building from source on MacOS: installing certificates
Posted by: ardim - Feb-09-2020, 08:50 PM - Forum: General Coding Help - Replies (1)

I successfully built Python 3.8 on MacOS Sierra, by following the advice at the developer docs (via configure, make, make test, and make install). It'..... More

Print this item

  Error: variable can not be defined
Posted by: julio2000 - Feb-09-2020, 07:24 PM - Forum: General Coding Help - Replies (2)

[python]
THE OTHER PART OF MY CODE ABOVE IS NOT NECASSERY

size_1 = driver.find_element_by_css_selector('#productSizeStock .btn-default:nth-child(1..... More

Print this item

  Python can't import Django and it's in the site-packages directory
Posted by: karkas - Feb-09-2020, 05:15 PM - Forum: Web Scraping & Web Development - Replies (3)

Hello,

I'm trying to play around with the Django tutorial in the Django website, but I ran into an error and don't understand why I am getting it. ..... More

Print this item

  Compute complex solutions in quadratic equations
Posted by: liam - Feb-09-2020, 04:06 PM - Forum: Homework - Replies (1)

Hi, my homework is to solve quadratic equations and compute complex solutions(the solutions to the quadratic equations are not real numbers). Furtherm..... More

Print this item

  Why replace treats an integer value 999 as 999.0?
Posted by: new_to_python - Feb-09-2020, 03:06 PM - Forum: General Coding Help - Replies (10)

Hi, I came across an example to replace sentinel values -999 by NaN. -999 is an integer. How come it can be used to replace those -999.0 elements in t..... More

Print this item

  Why any(0) does not work here?
Posted by: new_to_python - Feb-09-2020, 02:54 PM - Forum: General Coding Help - Replies (2)

Hello, I know that to select all rows having a value exceeding 2 or less than -2, we can use the any method on a boolean DataFrame. Considering the fo..... More

Print this item

  Can't install Python 3.7.6
Posted by: Tomda - Feb-09-2020, 12:41 PM - Forum: News and Discussions - No Replies

Hello Python Community,

I'm trying to install 3.7.6 on a old MacBook with OS 10.6.8, but the installer don't launch - I get the following error mes..... More

Print this item

  Want to dynamically update numbers using tkinter in pygame script
Posted by: k0gane - Feb-09-2020, 09:01 AM - Forum: GUI - No Replies

Hi, everyone.

I want to create a program that updates the number of times entered in real time after entering the controller.

This is the interf..... More

Print this item

  Chrome instead of IE
Posted by: Friend - Feb-09-2020, 06:22 AM - Forum: Web Scraping & Web Development - Replies (1)

Hi all,

i just read a little bit about the webbrowser and tried open google for example. so i did:
[python]
import webbrowser
webbrowser.open('h..... More

Print this item

  Array manipulation
Posted by: 0zMeister - Feb-09-2020, 05:52 AM - Forum: General Coding Help - Replies (7)

Hi,

I've got some data in a csv file in the following format:
ID Number
a 1
a 2
a 3
a 4
b 5
b ..... More

Print this item

  demo not running for me - getting keyError
Posted by: wolf8963 - Feb-09-2020, 05:24 AM - Forum: General Coding Help - Replies (4)

Hi All,

I am trying to adapt a program to scrape data from a cisco phone web page. I found some code at https://srome.github.io/Parsing-HTML-Tables..... More

Print this item

  Hi , why can't i return this value?
Posted by: Houston222 - Feb-09-2020, 04:13 AM - Forum: General Coding Help - Replies (3)

def my_sum(x, y):
       sum = x + y
       return sum

my_sum(1, 2)
Hi all , i am trying to call this function, but this function ..... More

Print this item

  Confused on how to go about writing this or doing this...
Posted by: pythonforumuser - Feb-09-2020, 02:47 AM - Forum: General Coding Help - Replies (3)

Currently we have a Google Forms that people fill out with (NAME), (ADDRESS), and (CITY, STATE, ZIP CODE)

It automatically goes to 3 cells in googl..... More

Print this item

  Error while trying to see Python version with "sys.executable"
Posted by: karkas - Feb-08-2020, 07:32 PM - Forum: General Coding Help - Replies (5)

Hello everyone.

I know some computer science concepts and can write programs in Python, which I have done but for my own use in the shell. However,..... More

Print this item

  Simple Read File Issue
Posted by: blackjesus24 - Feb-08-2020, 07:18 PM - Forum: General Coding Help - Replies (4)

Hi,
So basically i'm trying to read something from a simple text file, and i don't really get any errors but the output is blank. Any help is appreci..... More

Print this item

  Struggling to exit this while loop
Posted by: fatherted99 - Feb-08-2020, 06:37 PM - Forum: General Coding Help - Replies (5)

[size=medium]Hello, I am a student (GCSE level) and I am writing this program which states the type of discount you require based on your age. I am co..... More

Print this item

  convert huge xml to csv using python
Posted by: srikanta_p - Feb-08-2020, 06:01 PM - Forum: General Coding Help - Replies (2)

Hi,

I have huge XML file of size 500mb which I want to convert to CSV using Python.i tried lot and not able to get proper output . Can some one hel..... More

Print this item

  Problème command
Posted by: paulo - Feb-08-2020, 04:01 PM - Forum: General Coding Help - Replies (2)

Bonjour à tous,

J'ai un petit soucis concernant mon programme.
Quand j'appelle directement la fonction 'louer-materiel', il m'affiche le numéro re..... More

Print this item

  Dicom image reading
Posted by: smitha - Feb-08-2020, 03:42 PM - Forum: General Coding Help - Replies (2)

Hi all

I am trying to read a dicom image. The image has 49 frames. The PixelData has some bytes in the array. But the pixel_array is not working. ..... More

Print this item

  Selenium webdriver error
Posted by: WiPi - Feb-08-2020, 02:57 PM - Forum: Web Scraping & Web Development - Replies (4)

Hi guys,
I'm very new to Python - trying to use Selenium to scrape dynamic web pages and can't even get over 1st hurdle!!!
[python]from selenium imp..... More

Print this item

  Add path to a local file in pop-up field
Posted by: pythonscripting - Feb-08-2020, 01:38 PM - Forum: General Coding Help - Replies (1)

I am scripting in Selenium no problems on that.

At a certain point I click on browse (a http element) and a pop-up opens to upload a local file fro..... More

Print this item

  Can a module be executed even if the computer running it does not install it?
Posted by: CFYB - Feb-08-2020, 12:16 PM - Forum: General Coding Help - Replies (5)

Hello, I'm French, so sorry for the spelling mistakes.
I ask myself a question about the modules:
if for example I make a game with pygame and I giv..... More

Print this item

  How can I paste an entire file from clipboard to a folder?
Posted by: daverave1212 - Feb-08-2020, 10:49 AM - Forum: General Coding Help - Replies (5)

Hello,

I am making a script which works with non-text files.
I want to get the entire file, with name, extension, etc from the clipboard, and past..... More

Print this item

  add() takes 2 positional arguments but 3 were given
Posted by: Man_from_India - Feb-08-2020, 08:11 AM - Forum: General Coding Help - Replies (3)

I have two python files - Addition.py and test,py

Addition.py

[python]
class Addition:
num1 = 0
num2 = 0

def add(n1, n2):
num1 ..... More

Print this item

  saving text file by FileDialog option
Posted by: atlass218 - Feb-08-2020, 07:48 AM - Forum: GUI - Replies (14)

Hi, this is the code that i was able to realize by following steps seen on one of the forums :
[python]
def create_file_from_tableWidget(self):
..... More

Print this item

  Raise an exception for syntax error
Posted by: sbabu - Feb-08-2020, 05:08 AM - Forum: Homework - Replies (8)

try:
    print("Syntax Error)  # Ending quote omitted   
except SyntaxError:
    print("Syntax Error")
[b]SyntaxError: EOL wh..... More

Print this item

  Question about the groupby function
Posted by: new_to_python - Feb-08-2020, 04:39 AM - Forum: General Coding Help - Replies (7)

Hi, I have the following code:

[python]
import itertools
first_letter = lambda x: x[0]
names = ['Alan', 'Adam', 'Wes', 'Will', 'Albert', 'Steven..... More

Print this item

  My Loop for printing text file goes to infinity
Posted by: Nomex - Feb-08-2020, 03:44 AM - Forum: Homework - Replies (7)

I have to print a text file (cities) in a While Loop but it goes to infinity
[python]
filehandle=open("cities.txt", "r")
f = filehandle.readline()
w..... More

Print this item

  Sympy error "object is not callable"
Posted by: Cupcake - Feb-08-2020, 02:22 AM - Forum: General Coding Help - No Replies

I am trying to use sympy to solve a second order ODE. When I run the code below, I get the error: 'f' object is not callable. T don't understand what ..... More

Print this item

  Why reindex converts integer to decimal?
Posted by: new_to_python - Feb-08-2020, 02:20 AM - Forum: Data Science - Replies (2)

Hi, I have the following code:

[python]
frame = pd.DataFrame(np.arange(9).reshape((3,3)),
index=['a', 'c', 'd'],
..... More

Print this item

  Ordering of pandas DataFrame
Posted by: new_to_python - Feb-08-2020, 02:04 AM - Forum: Data Science - Replies (5)

Hello, I am new to pandas.

[python]
data = {'state': ['Ohio', 'Ohio', 'Ohio', 'Nevada', 'Nevada', 'Nevada'],
...: 'year': [2000, 200..... More

Print this item

  f-string issues in 3.6.9 (?)
Posted by: KSterner - Feb-08-2020, 01:50 AM - Forum: General Coding Help - Replies (4)

Hey all,

I'm pretty new to the world of Python but I would really appreciate some help with a small problem I seem to be having. If it helps, I am..... More

Print this item

  Where to put the global keyword when assigning variables outside a function?
Posted by: new_to_python - Feb-08-2020, 01:50 AM - Forum: General Coding Help - Replies (8)

Hello, I came across the following code:

a = None

def bind_a_variable():
  global a
  a = []

bind_a_variable()
It i..... More

Print this item

Forum stats
Latest posts
Topic Date, time  Author Last Sender Forum
  Parse Markdown / get the ... 21 minutes ago SpongeB0B SpongeB0B General Codin...
  Error: cannot mix str wit... 5 hours ago ngregistrations Joliekeva General Codin...
  Integer Factorization Too... Yesterday, 07:43 fosuwxb buran Code sharing
  My goal to be hired worki... Yesterday, 00:21 GnomeSweetGnome GnomeSweetGnome News and Disc...
  Unable to resolve FileNot... 09-29, 17:45 llarkin6 noisefloor General Codin...
  Comparing 2 100GB Drives/... 09-29, 12:59 tester_V snippsat General Codin...
  Select Python comment (#)... 09-28, 18:39 SpongeB0B tester_V General Codin...
  what does % stand for in ... 09-27, 18:49 arbiel Gribouillis General Codin...
  My First App 09-27, 10:53 BCopeland64 carlbidwell Code Review
  [Tkinter] how to export a... 09-26, 17:13 RonR noisefloor GUI
  Is the interpreter that c... 09-26, 13:17 helendamdam noisefloor General Codin...
Most views
  The best Prog... 577435
  Tutorial Requ... 500928
  Web Scraping ... 441074
  Newbie with P... 385139
  New Users Int... 369688
Most reputation
buran 581
snippsat 508
Larz60+ 452
Gribouillis 362
deanhystad 327
Most replies
  New Users Int... 451
  [book] Variou... 188
  CKEditor / Ri... 100
  moving from t... 95
  Free keys and... 91
Top posters
Larz60+ 12091
buran 8178
snippsat 7370
deanhystad 6897
metulburr 5151
Top referrers
Googlepro 23
metulburr 6
python 6
NonEntity 5
buran 3
Newest members
carlosdiego Today
Davidkiplimo Today
Joliekeva Today
silversimon2 Yesterday
alissapena8 Yesterday

User Panel Messages

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