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: kyleconor797
» Forum threads: 38,733
» Forum posts: 175,569

Full Statistics

Online Users
There are currently 33 online users.
» 1 Member(s) | 27 Guest(s)
Google, AOL, Apple, snippsat

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

 
  How to really change dir in a script ?
Posted by: Usjes - May-25-2019, 04:36 PM - Forum: General Coding Help - Replies (1)

Hi,

I am working with source control software which has a python API.
I want to be able to create a new dir and then populate code from the data..... More

Print this item

  LCM with recursion ( least common multiple)
Posted by: foxman322 - May-25-2019, 12:55 PM - Forum: Homework - Replies (4)

When i run this code python shell shows nothing

in '2.txt' 2 numbers " 21,53"
[python]
# least common multiple
def lcm(a,b):
with open('2.txt'..... More

Print this item

  Program Problem
Posted by: ChrisG - May-25-2019, 11:21 AM - Forum: General Coding Help - Replies (2)

I made a math trainer and here's the code:

[python]
from time import sleep
from random import randint

ingame= 1

while ingame< 2:
num1=..... More

Print this item

  operation with series
Posted by: elmismo999 - May-25-2019, 10:17 AM - Forum: Homework - Replies (1)

Hello,
if I have 2 series:

Serie1
Name Number
---- ------
a 10
b 20
c 30
Serie2
Name Number
---- ------
a 5
b ..... More

Print this item

  Python 2.7 and Ubuntu 19.04?
Posted by: ProDigit - May-25-2019, 10:17 AM - Forum: General Coding Help - Replies (2)

Seems like I can't get a program (Folding at home) to run, that has Python 2.7 dependencies in Ubuntu 19.04, which comes with Python 3 by default.
It..... More

Print this item

  splitting numeric list based on condition
Posted by: python_newbie09 - May-25-2019, 09:57 AM - Forum: General Coding Help - Replies (7)

I am trying to split a list of numbers into sublists once a condition is met.

num_list = [0,1,2,3,4,5,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5]

Whenever..... More

Print this item

  Using tkinter and mutiprocess ok on windows, locks up on ubuntu?
Posted by: ice - May-25-2019, 08:18 AM - Forum: GUI - Replies (3)

the code run well in windows but it is leading to interface stuck(the whole system interface) under the ubuntu(16.04 and 18.04).
what's wrong?
t..... More

Print this item

  terminal emulation
Posted by: Skaperen - May-25-2019, 05:15 AM - Forum: News and Discussions - Replies (3)

does anyone know of any Python code that can do the screen formatting part of terminal emulation? i need to feed it a stream like a terminal would ge..... More

Print this item

  Impossible error
Posted by: DeadCthulhuWaitsDreaming - May-25-2019, 02:54 AM - Forum: Web Scraping & Web Development - Replies (1)

Ok, to start, this code WORKED perfectly fine:
[python]
from flask import Flask, render_template
from random import randint
from math import floor
imp..... More

Print this item

  Access my webpage and download files from Python
Posted by: Pedroski55 - May-25-2019, 01:19 AM - Forum: Web Scraping & Web Development - Replies (7)

I have a godaddy webpage. I don't use it much. Mainly just for trying things out.

I have managed enough PHP to get files uploaded to my webhost fro..... More

Print this item

  Tutorial on while and for loops
Posted by: SheeppOSU - May-24-2019, 11:14 PM - Forum: Tutorial Requests and Submissions - Replies (1)

For and while loops are great ways to repeat and action or perform an action for a purpose other than repeating
First off, while loops. A while loop ..... More

Print this item

  diagnosing break not working
Posted by: Skaperen - May-24-2019, 11:09 PM - Forum: General Coding Help - Replies (3)

i have this code in a large loop:[code] for retry in range(128):

... lots of code to set up a cloud API call, do the call, and scan the ..... More

Print this item

  Beginner needs a little help with flashcard program
Posted by: Chrislw324 - May-24-2019, 11:08 PM - Forum: General Coding Help - Replies (1)

I'm making a flashcard program. Right now, I'm storing the questions and answers in separate lists. It works as is, but I want to add the option to st..... More

Print this item

  Tutorial for making a "choose a path" game
Posted by: SheeppOSU - May-24-2019, 10:52 PM - Forum: Tutorial Requests and Submissions - Replies (1)

First off, when making one of these, I think that the player should be able to choose which game they want to play. I think the games should be displa..... More

Print this item

  [Pygame] colliding with lines
Posted by: SheeppOSU - May-24-2019, 10:13 PM - Forum: Game Development - No Replies

i was making a another game before this but decided to take a little break from that game. I am at my grandmas for the summer and wanted to make a lit..... More

Print this item

  Printing List in one line
Posted by: bharat_s579 - May-24-2019, 10:06 PM - Forum: General Coding Help - Replies (6)

Am new to coding. i write a program to print output in a list
[python]
numb = [1, 2, 3 , 4 , 5 , 6 , 7, 22 ]
print ([a for a in numb if a < 7])
[..... More

Print this item

  Changing Number Format
Posted by: moby - May-24-2019, 08:52 PM - Forum: General Coding Help - Replies (4)

I'm strictly a hardware type and am caught in a conundrum trying to capture data from my oscilloscope.
I know nothing about Python, but found a worka..... More

Print this item

  Error Message -
Posted by: Akainu - May-24-2019, 08:40 PM - Forum: Data Science - Replies (2)

Hi,

I have just completed my python with finance coding, but unfortunately, there is an error. I tried so many times to solve the issue, hope you ..... More

Print this item

  list index out of range
Posted by: mcgrim - May-24-2019, 08:37 PM - Forum: Homework - Replies (2)

I am converting a list of times and dates taken from a file into european time.
The conversion function seems to do its job, but when I go and print..... More

Print this item

  common code, def a function vs exec() a string
Posted by: Skaperen - May-24-2019, 08:37 PM - Forum: General Coding Help - Replies (7)

in a long loop i have a big series of tests, some being multi-level nested if statements that do breaks to break out of that long loop. they are loca..... More

Print this item

  name of exception for exit()
Posted by: Skaperen - May-24-2019, 05:58 PM - Forum: General Coding Help - Replies (2)

when exit() is called, it's really raising a special exception that does not dump anything. i'd like to capture this exception but i c..... More

Print this item

  Why do i have invalid syntax on a line after print, i see no error ?
Posted by: iofhua - May-24-2019, 05:10 PM - Forum: General Coding Help - Replies (5)

[python]
main_site = ['mayo', 'ketchup', 'mustard', 'milk', 'eggs']
off_site = ['cocoa', 'flour', 'salt', 'bread', 'butter']
purchases = ['ketchup'..... More

Print this item

  getting index
Posted by: ThinleyJimmyDorji - May-24-2019, 04:34 PM - Forum: General Coding Help - Replies (2)

Hello,
help me get the index of each letters of the string below.


a='GTCCGTTTAGAAGGTTT'
I tried the following but what..... More

Print this item

  Generate unique random numbers from different lists
Posted by: Takeshio - May-24-2019, 04:30 PM - Forum: General Coding Help - Replies (5)

Hi Guys,

My objective is to select 5 unique random numbers from a range of numbers inside a list, prior to storing them inside a final list. These..... More

Print this item

  Python Script Spawned by Cron or Systemd doesn't write files..?
Posted by: johnnyrobot - May-24-2019, 04:05 PM - Forum: General Coding Help - Replies (2)

Hi all,

I've written a Raspberry Pi application (Ubuntu Mate) that's essentially a timed camera. Every 30 seconds, it snaps an image and writes it ..... More

Print this item

  Finding average in dictionary using for loop
Posted by: Rae - May-24-2019, 03:33 PM - Forum: Homework - Replies (4)

So I'm a super newbie in python, and I'm taking a course right now and this is my homework. I'm supposed to get the average using a for loop, and I kn..... More

Print this item

  Grabbing a value from one python script into another
Posted by: nickayres - May-24-2019, 12:39 PM - Forum: General Coding Help - Replies (3)

Hi,
Very new to Python and trying to figure out how I can get the value from a variable in one script into another.

I have a python script called..... More

Print this item

  how to code this for GPU?
Posted by: adamG - May-24-2019, 12:05 PM - Forum: General Coding Help - Replies (1)

Hello,

I am a complete beginner in GPU programming.

I have the following piece of code that I have been running in parallel on CPUs.

[pytho..... More

Print this item

  Tkinter classes
Posted by: Gupi - May-24-2019, 11:27 AM - Forum: GUI - Replies (8)

Hello everyone.

I'm sorry to bother y'all with my stupid questions, but I just can't get some simple stuff and hours of search doesn't help me. :(..... More

Print this item

  sieve of eratosthenes implementation
Posted by: sunny_awesome - May-24-2019, 11:17 AM - Forum: General Coding Help - Replies (9)

Can anyone provide me a simple implementation of sieve of eratosthenes algorithm ? I'm finding it hard to understand

Print this item

  Find the second largest number
Posted by: DarkCraftPlayz - May-24-2019, 09:31 AM - Forum: General Coding Help - Replies (8)

The task is to find the second largest number in an array.
For eg
INPUT: 5
1, 4, 5, 5, 3
OUTPUT: 4

I tried the following code, but it sh..... More

Print this item

  Exchange Quotes
Posted by: heiner55 - May-24-2019, 06:32 AM - Forum: Code sharing - Replies (7)

Quotes from iextrading.com:

[python]#!/usr/bin/python3
import requests

tic = "ibm"
url = "https://api.iextrading.com/1.0/stock/" + tic + "/quo..... More

Print this item

  problem to add precision, recall and f1-score
Posted by: edys - May-24-2019, 02:33 AM - Forum: Data Science - Replies (7)

Please, i confused to add precision, recall and f1-score.
i need to solve for my final project regarding this URL reference on https://github.com/am..... More

Print this item

  Why call import twice?
Posted by: Winfried - May-23-2019, 08:49 PM - Forum: General Coding Help - Replies (5)

Hello,

I'm learning about TclTk, and was wondering why the tkintter module is imported twice:
..... More

Print this item

  socket.gaierror: [Errno -2] Name or service not known
Posted by: seokangwoo99 - May-23-2019, 07:53 PM - Forum: Networking - Replies (5)

Hello, I am new to this forum.
I'm a cybersec Student and i found some code from the internet i try to modify it and try to execute it but it end up ..... More

Print this item

Forum stats
Latest posts
Topic Date, time  Author Last Sender Forum
  Parse Markdown / get the ... 13 minutes ago SpongeB0B Gribouillis General Codin...
  Error: cannot mix str wit... Today, 03:05 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... 577449
  Tutorial Requ... 501015
  Web Scraping ... 441079
  Newbie with P... 385147
  New Users Int... 369742
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+ 12092
buran 8178
snippsat 7371
deanhystad 6897
metulburr 5151
Top referrers
Googlepro 23
metulburr 6
python 6
NonEntity 5
buran 3
Newest members
kyleconor797 Today
miriamwilliam Today
Davidkiplimo Today
Joliekeva Today
silversimon2 Yesterday

User Panel Messages

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