76
1
submitted 4 years ago by cypherpunks@lemmy.ml to c/python@lemmy.ml
77
1
78
2
submitted 4 years ago by matl@lemmy.ml to c/python@lemmy.ml

Can you recommend any cross platform Python app development frameworks where you write code once and it can be deployed to Linux, Android, Windows, MacOS and iOS.

79
1
submitted 4 years ago by spla@lemmy.cat to c/python@lemmy.ml

tweet2toot will replicate all tweets and threads of the Twitter user of your choice.

80
1
submitted 4 years ago by danie10@lemmy.ml to c/python@lemmy.ml

SimpleHTTPServer is a python module which allows you to instantly create a web server or serve your files in a snap. The main advantage of python’s SimpleHTTPServer is you don’t need to install anything since you have python interpreter installed. You don’t have to worry about python interpreter because almost all Linux distributions, python interpreter come handy by default.

You also can use SimpleHTTPServer as a file sharing method. You just have to enable the module within the location of your shareable files are located.

The article below guides you on how to set up and use it.

See https://www.tecmint.com/python-simplehttpserver-to-create-webserver-or-serve-files-instantly/

#technology #Linux #Python #Webserver

81
1
Python 3.10 Released (www.python.org)
submitted 4 years ago by joojmachine@lemmy.ml to c/python@lemmy.ml
82
1
submitted 4 years ago* (last edited 4 years ago) by roastpotatothief@lemmy.ml to c/python@lemmy.ml

The only differences are that tuples are immutable and that lists have extra methods.

Is there ever a strong need for list-type data to be immutable? Evough to justify a whole extra data-type in the language?

Should they release a python 4 with it removed?

The only thing I can think of is as a default function parameter. This function is okay:

def dothings(a=(1,2)):
    print(a)
    a = (a[0], 3)

But this function misbehaves the second time it is called:

def dothings(a=[1,2]):
    print(a)
    a[1] = 3

But IMO the "mutable arguments" thing is another bug to be fixed in a hypothetical python 4. And even in python 3 you just write the function the recommended way, so there is not such a big problem.

def dothings(a=None):
    if a is None:
        a = [1, 2]
    print(a)
    a[1] = 3

The Python devs are clever guys though. There must be some really important reason to maintain both types?

83
1
Duck typing - Wikipedia (en.wikipedia.org)
84
1
submitted 5 years ago by Ajsra@lemmy.ml to c/python@lemmy.ml
85
1
submitted 5 years ago by strubbl@lemmy.ml to c/python@lemmy.ml
86
1
submitted 5 years ago* (last edited 5 years ago) by jiaminglimjm@lemmy.ml to c/python@lemmy.ml
87
1
submitted 5 years ago by jiaminglimjm@lemmy.ml to c/python@lemmy.ml
88
1
submitted 5 years ago* (last edited 5 years ago) by amalshaji@lemmy.ml to c/python@lemmy.ml

A few months ago, I built a tool to generate fake data based on a JSON payload(fakeapi). FakeAPI worked fine, but a major downside was that a JSON payload must be sent as a post request to receive data. This is not good for someone emulating any other HTTP methods.

So I decided to build Phoney. Phoney is a mock API generator that lets you create apps to manage endpoints. Features of phoney:

  • Create apps to manage your endpoints
  • Create endpoints that return data in a custom format
  • Default API key authentication support
  • All methods, GET, POST, PUT, and DELETE, supported.
  • Dynamic endpoints supported
  • Swagger UI for each endpoint. It makes testing easy.
  • Built-in JSON editor for creating endpoint schema
  • Supported response codes, 200, 201, and 202
  • Syntax highlighting for JSON schema
  • Light/Dark theme switch

Phoney is built with Django. Also, this is my first ever Django app

89
2
submitted 5 years ago by copacetic@lemmy.ml to c/python@lemmy.ml
90
1
submitted 5 years ago by Kazutrash@lemmy.ml to c/python@lemmy.ml

I've started to learn programming Python (also i'm a beginner) and my code's print result was "0". Could someone explain why?

I mean, on my calculator hardware it results on something like "0.5555552", this has anything to do with the Python Interpreter's code?

91
1
submitted 5 years ago by danie10@lemmy.ml to c/python@lemmy.ml

When debugging code, you're often faced with figuring out when a variable changes. Without any advanced tools, you have the option of using print statements to announce the variables when you expect them to change. However, this is a very ineffective way because the variables could change in many places, and constantly printing them to a terminal is noisy, while printing them to a log file becomes unwieldy.

When I was still programming I remember variable watching was essential for debugging as you are often trimming strings, changing data types, and doing other manipulations that make it difficult to find out what actually went wrong where.

I'm just wondering if IDEs for Python don't already do this in a pane whilst testing?

See https://opensource.com/article/21/4/monitor-debug-python

#technology #python #opensource #debugging #coding

92
1
submitted 5 years ago by copacetic@lemmy.ml to c/python@lemmy.ml
93
1
submitted 5 years ago by copacetic@lemmy.ml to c/python@lemmy.ml

Well, one day late here.

94
1
submitted 5 years ago by Rain@lemmy.ml to c/python@lemmy.ml

Not my channel nor big on video tutorials but this is very handy and well done.

95
1
96
1
submitted 5 years ago by copacetic@lemmy.ml to c/python@lemmy.ml
97
1
submitted 5 years ago by Ajsra@lemmy.ml to c/python@lemmy.ml
98
1
submitted 5 years ago* (last edited 5 years ago) by amalshaji@lemmy.ml to c/python@lemmy.ml

I built an API to generate fake data, which comes in handy when testing/prototyping the frontend. Data is generated based on a json payload.

URL: https://fakeapi.amalshaji.com/

99
1
submitted 5 years ago by danie10@lemmy.ml to c/python@lemmy.ml

Naïve Bayes is a classification technique that serves as the basis for implementing several classifier modeling algorithms. Naïve Bayes-based classifiers are considered some of the simplest, fastest, and easiest-to-use machine learning techniques, yet are still effective for real-world applications.

Naïve Bayes is based on Bayes' theorem, formulated by 18th-century statistician Thomas Bayes. This theorem assesses the probability that an event will occur based on conditions related to the event. For example, an individual with Parkinson's disease typically has voice variations; hence such symptoms are considered related to the prediction of a Parkinson's diagnosis. The original Bayes' theorem provides a method to determine the probability of a target event, and the Naïve variant extends and simplifies this method.

This code and project will be of interest to any Python (or even other) programmers wanting to go to the next level in terms of building machine learning predictability into their applications.

See https://opensource.com/article/21/1/machine-learning-python

#technology #machinelearning #python #programming #predictions

100
1
OO in Python is mostly pointless (leontrolski.github.io)
submitted 5 years ago by copacetic@lemmy.ml to c/python@lemmy.ml
view more: ‹ prev next ›

Python

3639 readers
1 users here now

News and discussions about the programming language Python


founded 7 years ago
MODERATORS