15,179 Topics

Member Avatar for
Member Avatar for pwolf

i was on the site pyschools working through the exercises, but i dont understand why it wont accept the code i input. [url]http://www.pyschools.com/quiz/view_question/s4-q2[/url] Create a function generateNumbers(start, end, step) that takes in three numbers as arguments and returns a list of numbers ranging from start to the end number (inclusive)and …

Member Avatar for Reverend Jim
1
1K
Member Avatar for srednausab

want to sent an AuthnRequest from my python-based SP (I;m using python 2.7) that I'm developing to my simpleSAMLphp installation (it's an IDP). I'm using the "requests" module to do a get like this: response = requests.get(url, verify='/home/me/my.crt') where the URL is: https://bingo.bas.com/simplesaml/module.php/core/authenticate.php?as=example-sql/?SAMLRequest=' + saml_request_base64 and the saml_request is (but …

0
22
Member Avatar for Reverend Jim

Sometimes you want to ensure that only one copy of a script can be run at time. Windows provides a facility called a mutex and you can use it to prevent multiple instances. To create the mutex, all I have to do is varname = GetMutex() If the mutex already …

1
2K
Member Avatar for vishwas_1

Hii ,I was making a factorial program in python using recursion/ but I have one doubt : if I run the program I get the error as : " result=x*fact(x-1) TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'" But If I run it with the commented statements it works …

Member Avatar for Reverend Jim
0
706
Member Avatar for Reverend Jim

###Subclassing python objects Sometimes you want to add just a little more functionality to an existing python object. You can do that by subclassing it and adding on the missing parts. This example is based on a really mindless game of solitaire I used to play as a kid. In …

2
208
Member Avatar for Reverend Jim

##This project implements a multiple timer application. It was written in 1. Python 3.8.2 2. wxPython 4.1.0 Feel free to experiment. Here are some possible enhancements: 1. Add the ability to run a program when the timer expires. With a little scripting you could, for example, schedule the sending of …

2
1K
Member Avatar for Dani

Earlier today, I was in need of an easy way to delete files that mached a specific format within a series of folders. For the case of this example, let's say all CSS files. I discovered I could do it with: find . -name '*.css' -delete The . represents the …

Member Avatar for Sohaib_7
3
925
Member Avatar for luffy_D

I am trying build a webpage which takes a large tab delimited `.txt/.txt.gz `file as user input from a form and using `POST` method(`test.html`) to send the data to `cgi-bin` directory to `file.py` which ideally should open the file read and put the data into a dataframe and do some …

Member Avatar for tinstaafl
0
250
Member Avatar for robinlrandall

The following Python 2.7 Calendar program works nicely with a Frame and a Panel, but when I try to change to change the Frame to an MDIParentFrame and the Panel to an MDIChildFrame (or MDIClientWindow) I cannot get it to work. I went to this because I had trouble getting …

Member Avatar for Reverend Jim
0
59
Member Avatar for Reverend Jim

Python-wxPython Tutorial This tutorial will take you through the basics of wxPython. ##Introduction: Let's face it. I am a dinosaur. I got my computer science degree in the mid 70s. And it won't be long before **I** am in **my** mid 70s. So why am I trying to learn Python? …

Member Avatar for Reverend Jim
10
12K
Member Avatar for muhammadnasiri

two error come of (strcpy was not declare in this scope) would any one show me, hw to remove this error, ... plz Project Title: Student Record & Registration using Linked list Description: This project is a Linked List application. If you would like to refresh you knowledge about linked …

Member Avatar for J_7
0
22K
Member Avatar for Lonx

Good day y'all, Im an intermediate Python dev and I've just finished building my first major Python project with UI. I tinkered a lot with tKinter (pun almost unintended) and even tried PyQT5. Both of these are time consuming to work with and tKinter's GUI looks like it shouldve been …

0
49
Member Avatar for Alex_112

I'm in the process of developing a free open source online platform/course for complete beginners to teach themselves coding in Python. See https://github.com/alexmojaki/futurecoder for more information or try out the demo at https://futurecoder.herokuapp.com/. It's completely interactive and has several awesome features, including three dedicated debuggers, gradual hinting and solution revelation, …

Member Avatar for rproffitt
0
52
Member Avatar for Thanh Phong

My experience with C# is very very limited and a simple python program like the one I'm trying to convert is beyond my experience in C#. If anyone knows of any converters or is willing to help me out I would greatly appreciate it! class ByteReader(object): """ Reads bytes from …

Member Avatar for GooGooseGooey
0
36K
Member Avatar for Meh123

def shift_matrix(a): start_row=0 start_col=0 end_row=len(a[0])-1 end_col=len(a)-1 prev=a[0][0] while (start_row<end_row and start_col<end_col): for i in range(start_col,end_col+1): temp=a[start_row][i] a[start_row][i]=prev prev=temp start_row+=1 for i in range(start_row,end_row+1): temp=a[i][end_col] a[i][end_col]=prev prev=temp end_col-=1 for i in range(end_col,start_col-1,-1): temp=a[end_row][i] a[end_row][i]=prev prev=temp end_row-=1 for i in range(end_row,start_row,-1): temp=a[i][start_col] a[start_col]=prev prev=temp start_col+=1 a[0][0] = prev a = [[ 1, …

Member Avatar for hussainmujtaba
0
32
Member Avatar for sasindu

Here is what i get when compiling py to exe using cx_Freeze... I used Admin cmd too... but it keep give me this error.. how can I make it right...please help me with this. C:\Windows\system32>"C:\\Program Files (x86)\\Python38-32\\python.exe" "E:\\New folder\\Python Player\\Setup.py" build running build running build_exe pygame 1.9.6 Hello from the …

0
129
Member Avatar for carla_3

I am currently working on a python program that takes the numbers from a large file and averages them. Currently I can't seem to find a way to add the numbers without using the sum function. I am a beginner and am just trying to grasp the basics of Python …

Member Avatar for Dani
0
93
Member Avatar for Python Leaner

I am new to Python development with Selenium. I need some clarification regarding Exceptions. In Oracle PL/SQL I was able to create a package, where I used to place all the procedures and functions related to error handling in my app. So, once a error occurs he is propagated from …

0
19
Member Avatar for Dagw300805

I have made a html page and I need to use python to see the inputs. Any ideas??

0
20
Member Avatar for sasindu

After minimize the window disappear from taskbar and i can't set that again as it's looping...Is there any other way to minimize or fix that. watch inline code examples. from tkinter import * from PIL import Image, ImageTk import time from ctypes import windll GWL_EXSTYLE = -20 WS_EX_APPWINDOW = 0x00040000 …

0
544
Member Avatar for Sarala_1

how to convert this code to python #include<bits/stdc++.h> using namespace std; int maxi = INT_MAX; int maxx(int a, int b) { return (a > b)?a:b; } void cal_Time(int total, int sum, int i, vector<int> v1) { if(maxx(sum, total-sum) < maxi) { maxi = maxx(sum, total-sum); } if(v1[i]) return; cal_Time(total, sum …

Member Avatar for Reverend Jim
0
15
Member Avatar for Kaaviya_1

I have a dataframe with 5000 records. I want the null values to be filled with: Average(All the Preceding values before null, First succeeding value after null) data: Date gcs Comp Clay WTS 2020-01-01 1550 41 9.41 22.6 2020-01-02 1540 48 9.50 25.8 2020-01-03 NAN NAN NAN NAN 2020-01-04 1542 …

Member Avatar for Reverend Jim
0
26
Member Avatar for sasindu

> I have already created functions to handle that. But it's shacking when i try to move( After add more widgets). Can somebody help me with that. from tkinter import * from PIL import Image, ImageTk import time class modtk(Tk): toptitlebar = None maincanvaswindow = None resizeon = False dragging …

0
722
Member Avatar for Alexandramaria

I would like to build a software career and am looking for the best software training institution. Can you please help me to find one?

Member Avatar for rproffitt
0
28
Member Avatar for macroasm

Visual Tkinter is Python 2.6 GUI builder. Visual Python programming language for advanced Visual Python IDE that offers the possibility. As of December 2008 starting and writing fasting Editor. This software is using Scintilla editing component. <URL SNIPPED>

Member Avatar for Titus_1
-4
2K
Member Avatar for Sponge_2

images = [createProductForm.productImageModel.data, createProductForm.productImageModel.data] for image in images: if image.filename == '': print('Image must have a filename') return redirect(url_for('createProduct')) if not allowed_image(image.filename): print('Image extension is not allowed') return redirect(url_for('createProduct')) else: filename = secure_filename(image.filename) file_path = image.save(os.path.join(app.config['IMAGE_UPLOADS'], filename)) print(mysql.format(file_path)) mysql.connection.commit() print("Hello yes!") print("images saved") If i were to convert the image …

0
32
Member Avatar for zeekie22

I am a developer who recently started working on my own, and I've come across some projects that I can't handle by myself (mostly in React). What resources would you guys recommend for finding / putting together a team of remote developers to join me on these projects?

Member Avatar for benjamin79
5
173
Member Avatar for Sponge_2

Hi, How do i store files into blob datatype into mysql via user input with python? def read_file(filename): #Convert digital data to binary format with open(filename, 'wb') as f: photo = f.read() return photo @app.route('/createProduct', methods=['GET', 'POST']) def createProduct(): createProductForm = CreateProductForm() msg = '' if request.method == 'POST' and …

Member Avatar for AndreRet
0
645
Member Avatar for Ian_7

Hi all, Have my below program: from tkinter import * from tkinter import ttk from tkinter import messagebox class Application(object): def __init__(self, master): self.master = master qPlacement = IntVar() self.cc = ttk.Combobox(self.master, textvariable=qPlacement, width = 5).place(x = 5, y = 30) Button(self.master, text = 'Click Me', command = self.popCombo).place(x = …

0
84
Member Avatar for griswolf

I'm writing a utility that will likely be called by a script that uses `argparse`, but should be useable by any script. The engine object constructor needs a dozen or so parameters to tune its behavior. The question is: What is the best way to allow the caller to send …

Member Avatar for JamesCherrill
0
305

The End.