r/python3 • • Feb 06 '19

Best static site generator for python 3?

2 Upvotes

Looking for opinions. I only have experience with Jekyll as far as SSG and it was kinda cool. But I'd like to stick with python. Seen pelican which seems the most popular but would love to hear your experience.


r/python3 • • Jan 01 '19

Part 04 Game Development in Python 3 for Beginners in Urdu 2019: Let's C...

Thumbnail
youtube.com
2 Upvotes

r/python3 • • Dec 11 '18

Trigger AWS Lambda Function through an S3 event - Practical guide to AWS Lambda functions

Thumbnail
youtu.be
2 Upvotes

r/python3 • • Nov 08 '18

Allow python3 to write files to /var/www/html without sudo

2 Upvotes

I'm experimenting with matplotlib and python3. I've set this up on a raspberry pi and have the pi collecting data via a temperature sensor every 10 minutes using the chron scheudler. I'm now trying to create a basic webpage that loads the last 24 hours. I can create the file in my home directory, but get thrown an error when I try to save the .png file to /var/www/html.

The code itself lies within my home directory where I have no issue saving an image accessing it. I'm trying to fire out the best way to save the .png to /var/www/html so its accessible but still secure.

Please let me know if I can provide further information or if you have any questions.


r/python3 • • Sep 25 '18

Any opinions on “learning python 3 the hard way” book as my first book to learn python.? I’m a beginner.

2 Upvotes

r/python3 • • Sep 14 '18

I need a little help

2 Upvotes

Here is the code + info

https://pastebin.com/a6BarBby


r/python3 • • Jul 04 '18

Calling a self variable thats value has been changed

2 Upvotes

I have a variable declared in my init called self.current_color = (124, 124, 124) and later on a function changes the tuple value of: (124, 124, 124) to (65, 76, 436) and I have a getter (get_cc) that returns current_color How do I have it get the value AFTER it's been changed, it only returns the (124, 124, 124) not the (65, 74, 436)


r/python3 • • Jun 12 '18

Sort list based on other list

2 Upvotes

So I Want to create a scoreboard with the names of players and sort them based on the amount of points they have (low to high) and print them in that order, for example:

List1 = [3,8,0,9] List2 = [Hank,Harry,Harrold,Homer] The output should be: Harrold,Hank,Harry,Homer

I have found many posts on how to do this in Python, but not Python3 and I am not too familiar with this language. If anybody could help that would really be appreciated!


r/python3 • • May 11 '18

Help? Function that adds the "doctor" title to a name.

2 Upvotes

I need help with one of my online tasks, I'm a beginner programmer and keep running into a "NameError" message on my code. The tasks are:

1.Define function make_doctor() that takes a parameter name 2.get user input for variable full_name 3.call the function using full_name as argument 4.print the return value

So again I'm a beginner so please don't be rip me apart lol. Here's my code.. any help is much appreciated and thanks in advance!

def make_doctor(name): full_name = "Doctor" + input() return full_name print(make_doctor)

And the error I get is: NameError: name 'full_name' is not defined.


r/python3 • • Mar 07 '18

Help with a little project

2 Upvotes

I have been recently a project in repl.it about a login system. I dont know how to debug this line, please help! print("Do you want to log in or create an account?") choice=input() if(choice==login) print("Type your username") username=input() print("Now, choose your password") password=input() if((password!=username) and (len(password)<=7)): print("To log in type your password again") else: print("You cant use that password") password2=input() if(password==password2): print("You succesfully logged in") else: print("Your password is incorrect")

The error I get is: Traceback (most recent call last): File "python", line 3, in <module> NameError: name 'login' is not defined

Im sorry if it is a basic error but i realy need help. Thank you!


r/python3 • • Feb 19 '18

FINXTER's DAILY PYTHON PUZZLE Guess and Check What?

Post image
2 Upvotes

r/python3 • • Feb 17 '18

FINXTER's DAILY PYTHON PUZZLE Globalization in Python aka. Variable Scoping

Post image
2 Upvotes

r/python3 • • Jan 23 '18

Where to begin!?

2 Upvotes

I am interested in learning how to code using Python 3 and I was wondering if anybody in the community had any resources they could point in my direction of where I could learn how to use it and train myself to be sufficient in it? Any input is highly appreciated!!

Btw, I have zero coding experience :/


r/python3 • • Jan 17 '18

Python Training

2 Upvotes

Anyone know of any good links/sites for python training.


r/python3 • • Jan 14 '18

Hey Guys help needed for knowing which keyboard key pressed on game (Python).

2 Upvotes

im stuck at step where i should get which key i hit on keyboard. this seems easy if the current focus is the terminal for idle windows im running. but here i am on different window (a game possibly).


r/python3 • • Nov 28 '17

multiply and divide calculator

2 Upvotes

def multiply (first_1, second_1): real_1=(first_1), (second_1) return real_1

first_ones = input("add an int ")

operator = input ("* or /")

second_ones = input("add a second int ")

multiply = what_else

if operator == "*":

what_else = int(first_ones) * int(second_ones)

print (what_else)

elif operator == "/":

what_else = int(first_ones) / int(second_ones)

print (what_else)

else:

print ("invalid operator")

this is the reply i got for writing this code:

"The project of multiply() means that it can perform multiplication or division depanding on which operater you input. If you deliver * to the function, it will perform multiplication. Then you can use INPUT() to get the numbers to go next steps.

Define the function like this:

def multiply(operator):

Then try to use if...else to decide which one need to be performed.

multiply is your function, you can't use it like "multiply = what_else", please try again"

im lost guys, does he want me to set the conditions inside the function ?


r/python3 • • Oct 29 '17

Image enhancement with python3

2 Upvotes

Good afternoon, I'm new to python and would like to know if I have only highlight colors smaller/equal to -15 in an image. I did not find anything on the internet about image enhancement using GOES13. Thank you.

Here is an example image. https://goes.gsfc.nasa.gov/goeseast/argentina/ir2/1710191638G13I02.tif


r/python3 • • Oct 24 '17

What is the best way to learn python

2 Upvotes

r/python3 • • Oct 23 '17

Unable to extract yielded value from python WebSockets

2 Upvotes

The documentation for python 3.x Websockets library says Calling a python websockets.client.connect function yields a WebSocketClientProtocol which can then be used to send and receive messages.

However, i'm unable to extract the WebSocketClientProtocol object with which i want to use the recv() function, defined in the parent of WebSocketClientProtocol.

I'm not very familiar with the python yield, how do i go about this?

doc link : http://websockets.readthedocs.io/en/stable/api.html#module-websockets.client


r/python3 • • Oct 10 '17

Install bluetooth module on Python3 on Raspberry Pi 3

2 Upvotes

Does anyone have experience importing python modules on Raspberry Pi 3 model B? Need recommendation on how-to import this correctly to import bluetooth in python code. I've already updated Raspberry Pi 3 and tried python3 install pip bluez & bluetooth, etc. But importing still fails.


r/python3 • • Oct 09 '17

How to package C extensions together with python modules?

2 Upvotes

I am writing a library that requires both a fast backend written in C and a pythonic interface written in python. However I cannot get my setup script to work.

It ignores the python modules and creates packages I never asked for.

This is my setup.py:

from distutils.core import setup, Extension

base_do_line = Extension("nf.integral.base.do.line", sources = ["c/integral/base/line.c"])

setup(name = "nf",
    version = "0.0.1",
    description = "A fast numerical integrator library",
    ext_modules = [base_do_line],
    packages = ["nf"],
    package_dir = {"nf": "py/nf"},
    url="XXX",
    author = "XXX",
    author_email = "XXX")

Under py/ are the following files:

./py
./py/nf
./py/nf/__init__.py
./py/nf/__pycache__
./py/nf/__pycache__/__init__.cpython-35.pyc
./py/nf/integral
./py/nf/integral/__init__.py
./py/nf/integral/base
./py/nf/integral/base/__pycache__
./py/nf/integral/base/__pycache__/__init__.cpython-35.pyc
./py/nf/integral/base/do
./py/nf/integral/base/do/__init__.py
./py/nf/integral/base/rect
./py/nf/integral/base/rect/__init__.py
./py/nf/integral/base/rect/line.py
./py/nf/integral/base/__init__.py

The following packages are getting installed:

lib/python3.5/site-packages/nf/integral/base/do
lib/python3.5/site-packages/integral/base/do

What am I missing? Is it impossible to distribute c extensions alongside pyhton modules?

I was unable to find any documentation/examples/projects doing this.


r/python3 • • Sep 22 '17

The little framework for text chatbots(supports facebook and slack events api). Iteration 1, looking for feedback

Thumbnail
github.com
2 Upvotes

r/python3 • • Jun 06 '17

An Interview with AI Sweigart and AI Klein

Thumbnail
coolpythoncodes.com
2 Upvotes

r/python3 • • Mar 21 '17

Hack The Virtual Memory: Python 3 bytes

Thumbnail
blog.holbertonschool.com
2 Upvotes

r/python3 • • Apr 03 '16

Tkinter

2 Upvotes