Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Mar 12 00:17

    dependabot[bot] on pip

    (compare)

  • Mar 12 00:17
    dependabot[bot] closed #50
  • Mar 12 00:17
    dependabot[bot] commented #50
  • Mar 12 00:17
    dependabot[bot] labeled #51
  • Mar 12 00:17
    dependabot[bot] opened #51
  • Mar 12 00:17

    dependabot[bot] on pip

    Bump pillow from 7.2.0 to 9.0.1… (compare)

  • Jan 28 08:29
    vishallamba1988 starred pytonik/pytonik
  • Jan 13 02:17

    dependabot[bot] on pip

    (compare)

  • Jan 13 02:17
    dependabot[bot] closed #49
  • Jan 13 02:17
    dependabot[bot] commented #49
  • Jan 13 02:17
    dependabot[bot] labeled #50
  • Jan 13 02:17
    dependabot[bot] opened #50
  • Jan 13 02:17

    dependabot[bot] on pip

    Bump pillow from 7.2.0 to 9.0.0… (compare)

  • Dec 13 2021 21:11
  • Sep 08 2021 01:43

    dependabot[bot] on pip

    (compare)

  • Sep 08 2021 01:43
    dependabot[bot] closed #48
  • Sep 08 2021 01:43
    dependabot[bot] commented #48
  • Sep 08 2021 01:43
    dependabot[bot] labeled #49
  • Sep 08 2021 01:43
    dependabot[bot] opened #49
  • Sep 08 2021 01:43

    dependabot[bot] on pip

    Bump pillow from 7.2.0 to 8.3.2… (compare)

Ghost
@ghost~5e554ddcd73408ce4fdab57a
Welcome @AZIZUL-HTUHIN
@AZIZUL-HTUHIN
Pytonik is a python framework built to enhance web development faster and easier. if you are new to pytonik and you do not know how to start, read the documentation and feel free to asked questions https://pytonik.readthedocs.io/en/latest/
Raphael Essien
@emmamartins
I created multiple file upload function in a Controller
from pytonik import Web
from pytonik.Core import File
from pytonik.Core import Helpers
from pytonik.Functions.validation import validation

m = Web.App()

validate = validation()
file  = File

def multiple(Request):

    msg = ""
    if Request.method == "POST":
        upload_dir = upload_dir = Helpers.mvc_dir('public/uploads/file/multiple')
        multifileupload = Request.file('uploadfile')
        for fileupload in multifileupload:
            if fileupload.filename != "":
                response = file.upload(fileupload, upload_dir)
                if response == True:
                    msg = "File Upload Successfully "
                else:
                    msg = "Unable to Upload file "



    data = {

        'title' : 'Upload Controller',
        'text': 'Welcome to My pytonik Multiple Upload File Page',
        'msg' : msg
    }

    m.views('multiple', data)
View File multiple.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{{title}}</title>
</head>
<body>

<h1>{{title}}</h1>

<h2>{{text}}</h2>

<form method="POST" enctype="multipart/form-data" action="{% call url '/upload/multiple' %}">

    {{msg}}
    <br/>
    <div>
        <label>Upload File 1</label>
        <input type="file" name="uploadfile" id="uploadfile">
    </div>
    <br/>
    <div>
        <label>Upload File 2</label>
        <input type="file" name="uploadfile" id="uploadfile">
    </div>
    <br/>

    <div>
        <label>Upload File 3</label>
        <input type="file" name="uploadfile" id="uploadfile">
    </div>
    <br/>

    <div>
        <label>Upload File 4</label>
        <input type="file" name="uploadfile" id="uploadfile">
    </div>

    <br/>
    <button type="submit" name="submit" id="submit">
        Submit Now
    </button>

</form>

</body>
</html>
Ghost
@ghost~5e554ddcd73408ce4fdab57a
@emmamartins impressive
Raphael Essien
@emmamartins
pytonik is currently the only framework of Python that uses the MVC architecture.
As anybody discover a bug.
RAFYJU2019
@RAFYJU2019
I've facing some problem in importing .json file in MYSQL using python.

from flatten_json import flatten

import pymysql, os, json

read JSON file which is in the next parent folder

file = 'C:\Users\Optimistic Man\Desktop\Automation\test.json'
json_data=open(file).read()
sample_object2 = json.loads(json_data)

flat = flatten_json(sample_object2)

print(type(sample_object2))
flatten = flatten(sample_object2)

Convert python dict to SQL insert // flatten is our dic

columns = ', '.join("" + str(x).replace('/', '_') + "" for x in flatten.keys())
values = ', '.join("'" + str(x).replace('/', '_') + "'" for x in flatten.values())
sql = "INSERT INTO %s ( %s ) VALUES ( %s );" % ('mytable', columns, values)

print(sql)

# DB connection and create table

import mysql.connector

mydb = mysql.connector.connect(
host="localhost",
user="root",
passwd="abcd+_4321",
database="python_db"
)

mycursor = mydb.cursor()

mycursor.execute("DROP TABLE IF EXISTS mytable")
mycursor.execute("""CREATE TABLE mytable(

device_id VARCHAR(12) NOT NULL PRIMARY KEY
,time VARCHAR(25) NOT NULL
,pm25 INTEGER NOT NULL
,pm10 INTEGER NOT NULL
,pm1 INTEGER NOT NULL
,t NUMERIC(5,2) NOT NULL
,h INTEGER NOT NULL
,co2 INTEGER NOT NULL
,co BIT NOT NULL
,hcho BIT NOT NULL
,tvoc INTEGER NOT NULL
,gps_lat NUMERIC(6,3) NOT NULL
,gps_lon NUMERIC(7,3) NOT NULL
);""")

mycursor.execute(sql, values)

mydb.commit()

print(mycursor.rowcount, "record inserted.")

Raphael Essien
@emmamartins
@RAFYJU2019 is this pytonik related issues
Dr. Muhammad Anjum
@anjumuaf123_twitter
image.png
why it does not work
Dr. Muhammad Anjum
@anjumuaf123_twitter
image.png
how to do to solve this issue?
David-Billingsley
@David-Billingsley
On the bottom of the page (URL follows ) you will see other tools and frameworks , download the Microsoft Visual C++ Redistributable for Visual Studio 2019 for your version and this should fix your issue.
https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017
Dr. Muhammad Anjum
@anjumuaf123_twitter
image.png
image.png
Hi Dear, I want to open my execl file but not working?
Raphael Essien
@emmamartins
Welcome to Pytonik - The python mvc framework built to enhance web development fast and easy, also help web developers to build more apps with less codes.
The community was created to help interested people who want to contribute, learn and support pytonik framework. if you are finding it difficulty to implement, test or run the framework. please feel free to drop your questions and complains.
Ghost
@ghost~5e554ddcd73408ce4fdab57a
Pytonik Alpha Version 1.9.8a2 has been released out for testing, start deploying, contributing to pytonik Framework. Download and install https://pypi.org/project/pytonik/1.9.8a2/ It will Bleed your mind. star and forked https://github.com/pytonik/pytonik/
Ghost
@ghost~5e554ddcd73408ce4fdab57a
Welcome @momozor
Ghost
@ghost~5e554ddcd73408ce4fdab57a
@momozor a request to become a contributor as been sent to you, check your email and accept. Thank you.
Raphael Essien
@emmamartins
@momozor you are one of our outstanding contributor. I appreciate all your effort to make pytonik a great framework. Thank you
Bankole Emmanuel
@mrbarnk
Morning everyone.
Ghost
@ghost~5e554ddcd73408ce4fdab57a
Welcome @mrbarnk
Raphael Essien
@emmamartins
You don't need to be a programmer to contribute to open source. You can contribute by testing, writing and correcting documentations. Be part of pytonik project.
vinayak
@itsvinayak
keep on stuck "gio: localhost:6124: The specified location is not supported" whenever I try to create a project using pytonik-start in this permission error or something else
Raphael Essien
@emmamartins
@itsvinayak use cd /path to open the location you want to create pytonik project into. then use pytonik-start command . you dont use pytonik-start when running the server. Use pytonik-server
Ghost
@ghost~5e554ddcd73408ce4fdab57a
New beta/release candidate 1.9.8 is out for deployment. https://github.com/pytonik/pytonik install: https://pypi.org/project/pytonik/1.9.8rc1/
mrjerem
@mrjerem
how can my backup code work differentaly than it did when i pasted it -.-
Raphael Essien
@emmamartins
@mrjerem your question is not understood can you explain
mrjerem
@mrjerem
sanoja = ['korona', 'virus', 'korona-virus','koronavirukseen' 'tartunta'] #not used atm


for new in news:
    new = new.text.split()
    #if any(n in new for n in sanoja):
    print(" ".join(new))
i have scraped some articles online and i want to get only the once with certain keywords
code works fine but the filteration if statement does not
i have been fighting with this for so many hours that i cant even think straight anymore
so if i take the # before if out it prints nothing
now it prints all the articles as it should
mrjerem
@mrjerem
´´´
for new in news:
new = new.text.split()
for n in new:
if any(keyword in n for keyword in ['korona', 'virus', 'koronavirus', 'tartunta']):
print(" ".join(new))
´´´
finally worka
Momozor
@momozor
or you could just use regex
Raphael Essien
@emmamartins
@mrjerem Why not make it short.. No need for the loop
mrjerem
@mrjerem
Guys, I am using selenium to get all the page html on my bs4, but even if I scroll down the html fetching ends at exact same place every time i have tried. Any ideas why?
4import bs4
import urllib.request
import re
import csv
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
import time
import os

#hakee sivun
def main():

    browser = webdriver.Firefox()
    browser.get('https://www.hs.fi/')

#scrollaa sivun hitaasti
    y = 1750
    for timer in range(0,30):
        browser.execute_script("window.scrollTo(0, "+str(y)+")")
        y += 1500  
        time.sleep(1)

    time.sleep(5)

    source = urllib.request.urlopen('https://www.hs.fi/').read()

    soup = bs4.BeautifulSoup(source,'lxml')

    artikkelit = soup.findAll('h2')

    uutiset=[]
Raphael Essien
@emmamartins
Pytonik beta/release candidate 1.9.8 is out for deployment. Python framework built to enhance web development https://github.com/pytonik/pytonik @Pytonik1_twitter
install https://pypi.org/project/pytonik/1.9.8rc2/
Alex
@shaftoe
hello folks, could anyone point me to some docs on some comparison with other Py frameworks and why to choose Pythonic? also how Pythonic is "Lambda-friendly" would be interesting
Raphael Essien
@emmamartins
Alex
@shaftoe
@emmamartins I can't see any comparison nor support for AWS Lambda and such, at least that's not obvious from section titles
Raphael Essien
@emmamartins
@shaftoe we are making documentation for that, any contributions will be welcome