Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "#python3"
-
Now, instead of shouting, I can just type "fuck"
The Fuck is a magnificent app that corrects errors in previous console commands.
inspired by a @liamosaur tweet
https://twitter.com/liamosaur/...
Some gems:
➜ apt-get install vim
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
➜ fuck
sudo apt-get install vim [enter/↑/↓/ctrl+c]
[sudo] password for nvbn:
Reading package lists... Done
...
➜ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
➜ fuck
git push --set-upstream origin master [enter/↑/↓/ctrl+c]
Counting objects: 9, done.
...
➜ puthon
No command 'puthon' found, did you mean:
Command 'python' from package 'python-minimal' (main)
Command 'python' from package 'python3' (main)
zsh: command not found: puthon
➜ fuck
python [enter/↑/↓/ctrl+c]
Python 3.4.2 (default, Oct 8 2014, 13:08:17)
...
➜ git brnch
git: 'brnch' is not a git command. See 'git --help'.
Did you mean this?
branch
➜ fuck
git branch [enter/↑/↓/ctrl+c]
* master
➜ lein rpl
'rpl' is not a task. See 'lein help'.
Did you mean this?
repl
➜ fuck
lein repl [enter/↑/↓/ctrl+c]
nREPL server started on port 54848 on host 127.0.0.1 - nrepl://127.0.0.1:54848
REPL-y 0.3.1
...
Get fuckked at
https://github.com/nvbn/thefuck10 -
This guy's calculator program in python has 20000 + lines of code
Link: https://github.com/AceLewis/...17 -
Good to see instagram move to python3 without an exception. Literally that was smooth. Cheers to those who think Python is not scalable. 95 million photos on daily basis. 400 daily users.
https://thenewstack.io/instagram-ma...5 -
So I created this really cool messaging program for my CS class in high school. Though when I say for - I mean for the students which were bored when the teacher told us how to "resize images in Word".
I used python and tkinter to create it all, and didn't even need to touch sockets. (Mostly because I didn't know how to use them back then, but also because I kept the messages in a file on the school nas.)
Anyway, the program worked and we used it every week, with me listening to suggestions and improving it each week. I even managed to create a sort of notification system.
But sadly, my teacher found out about it and shut it down.
Have you ever had a similar experience?9 -
Porting over code to python3 from python2 be like:
(Cakechat, in this case)
Day 0 of n of python 3 compatibility work:
This should be _easy_, just use six and do magic!
Day 1 of n:
Oh, true division is default instead of integer division, so I need to replace `/` with `//` in a few places.
Day 2 of n:
Oh, map in python2 behaves differently than map in python3, one returns a list, other an iterator. Time to replace it with `list(map())` then.
Day 3 of n:
Argh, lambdas don't evaluate automatically, time to fix that too.
Day 4 of n:
Why did I bother trying to port this code in the first place? It's been so long and I DON'T EVEN KNOW WHAT IS BROKEN BECAUSE THE STUFF RUNS WHEN I BREAKPOINT AND STEP THROUGH BUT NOT WHEN I RUN IT DIRECTLY?!
Day ??? of n:
[predicted]
*gives up*
I've had enough.4 -
Runs some python3 script in terminal
Me: This script is going to take an hour to complete.
#After 50 minutes...
Me: better copy this line...
#Presses CTRL+C instead of CTRL+SHIFT+C
Me: Wahhhhhhh7 -
I'm a DevOps engineer. It's my job to understand why this type of shit is broken, and when I finally figure it out, I get so mad at bullish players like AWS.
It's simple. Install Python3 from apt.
`apt-get update && apt-get install -y python3-dev`
I've done this thousands of times, and it just works.
Docker? Yup.
AWS AMI? Yup.
Automation? Nope.
WTF? Let's waste 2.5 hours and figure out why this morning.
In docker: `apt-cache policy python3-dev` shows us:
python3-dev:
http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
But in AWS instance, we see we're reading from "http://us-east-1.ec2.archive.ubuntu.com/... focal/main" instead!
Ah, but why does it fail? AWS is just using a mirror, right? Not quite.
When the automation script is running, it's beating AWS to the apt mirror update! My instance, running on AWS is trying to access the same archive.ubuntu.com that the Docker container tried to use. "python3-dev" was not a candidate for installation! WTF Amazon? Shouldn't that just work, even if I'm not using your mirror?
So I try again, and again, and again. It works, on average, 1 out of every 5 times. I'm assuming this means we're seeing some strange shit configuration between EC2 racks where some are configured to redirect archive.ubuntu.com to the ec2 mirror, and others are configured to block. I haven't dug this far into the issue yet, because by the time I can SSH into the machine after automation, the apt list has already received it's blessed update from EC2.
Now I have to build a graceful delay into my automation while I wait for AWS to mangle, I mean "fix up" my apt sources list to their whim.
After completely blowing my allotted time on this task, I just shipped a "sleep" statement in my code. I feel so dirty. I'm going to go brew some more coffee to be okay with my life. Then figure out a proper wait statement.7 -
Worst job I had as a developer:
Convert all Python2.7 code the team wrote for the last 5 years to Python3 alone.9 -
I hate when idiots make assumptions without basis. My company so higher up idiots decided not to use Python. I said why they said it’s not scalable. I asked have anyone of you ever wrote micro service which can handle millions request every hours? Have you ever wrote service in Python? Have you ever worked on Python? Architect said but Python doesn’t have type support? I said there is use Python3. He said I want to validate my request payload. I told have you tried form and decorators. I told, I have 8 years experience. I worked in every language and I one has advantage over others depending on situation. Then they said, but we want only Java as finding resources is easy. I said have you checked git Python overtook Java in case resources, you are outdated. I don’t want to leave company but even after so many argument these idiots just dropping Python and because of that I am loosing so many good resources.8
-
Who the fuck at Microsoft decided to put python on their store? I don’t care if it’s on the store. What I do give many shits about is that I spent 20 minutes uninstalling and reinstalling and reconfiguring my fucking PATH because the python & python3 commands did not work but instead SENT ME TO THE FUCKING STORE PAGE FOR PYTHON 3.7
THEN I FIND OUT ITS NOT A PROBLEM WITH THE PATH MICROSOFT PURPOSELY CREATED ALIASES FOR BOTH COMMANDS SO THEY HAVE TO SEND YOU TO THE STORE PAGE WHEN YOU TYPE python OR python3 INTO THE CMD OR POWERSHELL.
I turned it off after finding that out, but I’m still furious. Fuck Windows.22 -
I've always been critical of python as a development language because of it's efficiency issues and the fact that it's essentially pseudocode. However, today I had to reflect 200 coordinated over the line x=355 for a course lab and I hella didn't feel like doing it in my normal languages. Wrote it using python in less than 2 minutes. It might be a bad language for efficiency, but it's one hell of a scripting language. Sorry, python. I never fully appreciated you until now.15
-
Speaking of fragile environments, what the hell is going on with the absolute dependency on python...?
I mean, I'm as reluctant to upgrade my system's python version as libc's.
How to break at least half of your system:
1. python3 --version
Python 3.8.10
2. rm -f /usr/bin/python3
3. ln -s /usr/bin/python3.13 /usr/bin/python3
And good luck opening most of the UI utilities and some of the terminal-based ones.
wtf... While everyone's barking at systemd, python quietly crawls in and claims the system's flexibility for itself w/o any resistance.
I imagine that's one of the aspects making NixOS a resilient solution...12 -
!rant
Looking for advice, serious advices.
I work in C.
Also, I work in Python.
I have worked for a couple of year in C++.
I have a fair knowledge of the Data Science workflow, and some experience in Machine Learning.
I have tinkered with some other languages (Java, Ruby, Go, JS among the others, nothing serious nor professional)
I'm the kind of person who needs constant problems to face in order to keep engaged, satisfied, happy. And I need to learn new stuff, or refining my knowledge constantly, or I stagnate. I believe that this is true for quite a share of people here.
I would like to spend some spare time (I seldom have) in a project. Personal projects are rarely good enough to improve one's cv, so I thought I could partecipate in some Open Source projects.
Does anyone here have some suggestion about some interesting and satisfying OSProject, or some general suggestion on the matter?
It would be so apreciated.3 -
I'm looking for a Python mentor. I need someone I can PM for clarification so I can wrap my head around things.
Is anyone up to the challenge?15 -
!rant
I'm so happy with my full stack basic test web application made with: raspberrypi, uwsgi,nginx,python3,flask,sqlite3,render_template,html
I have 2 pages:
/users where I can see the whole users table and filter by id
/insertuser (in the image) where I can add an user to the table users4 -
My final exam for Python3. I had previously failed this course, and the exam only had three questions. If I failed to answer one question I would have to take the course over, and my GPA would fall so hard that I wouldn't be able to take the course again. So I was extremely grave, and extremely anxious beyond belief.
I uploaded the two easy answers to the site.
And the last one was so baffling to me I stayed 5 minutes extra to figure it out. I nearly failed so badly.
My GPA is now 3.6 again. (😤 "Triumph" emoji)2 -
The fuck is up with venv, conda, pip, pip3, python3, CRYPTOGRAPHY_OPENSSL_NO_LEGACY and "you can't install packages in docker based environments" DUDE STOP WHAT THE FUCK
How the fuck is that the scripting language of choice? It has by far the most confusing and messy runtime setup. Like it's easier to make sense of Javas version-shenanigans than this bullshit.
And then you think well what gives. Runs > python ...
"This environment is externally managed and you can go kill yourself, JUST LOOK UP PEP-666" LIKE NO YOU FUCK, JUST RUN THE FUCKING SCRIPT!
It's nice you thought about separation of versions but DOCKRR DOCKER DOCKER THERE ARE CONTAINERS WHY THE FUCK DO YOU DO SOME BULLSHIT WITH ENVS IN FOLDERS REQUIRING SOME RUNTIME BULLSHIT WHAT NO STOP WWHYYY7 -
I basically need a select few contributors to speed up the development process. Python3 developers, testers and researchers are all welcome6
-
!rant
That level of satisfaction when you successfully port a Python2 Project to Python3 and implement proper backward-compatibility - without 2to3! -
Switched from Python 2 to Python3 a while ago. The biggest challenge for me is still remembering to use print as a function.2
-
So I wrote an algo in python3 for a challenge in codechef.com but it raised this exception !
If I put the input() built-in method in a try/catch , how do i know what the input was in order to pass the test case?3 -
Guys, I have recently made a python package which is published on PyPI.
I am a very junior python lover 😍6 -
My python brings all the devs to the cloud,
cause my code is bigger than yours
damn right its cleaner than yours
I can teach you but I have charge5 -
I made 60 lines of modern, clean, multi threaded, optimized python3 code to deliver data from GIT to IBM ClearCase, on old Windows VM, hundreds of files (CC is file-based version control, every file has it's own change)
This calls for sauna today to definitely get rid of this dirt :)
And they said devops is all around docker nowadays :)2 -
Worst mistake ever :
Didn't care for changing environment while pip or apt, always did sudo for no reason.
One day installed Conda and unity. Didn't realise it changed everything to python3-gi. Everything fucked up.
Tried to fix by started removing Conda removed gnome*, lost GUI.
For first time worked on tty, after a 6 hour redbull session. Got back the system working.
First thing then done is learn to install in virtual and local environments.1 -
I'm learning python3 right now, advises or exercises to practice? I want to learn machine learning. I'm developng on elixir for now. But I hear good stuff about python.6
-
I fucked up. I used the shebang line #!/usr/bin/env python3 in a script that was being ran every 5 minutes with a cron job. This generated an email to a system that dropped a file for processing and sent an age email for each file every minute. Because the Linux OS generated emails didn’t contain a keyword the script closed by design but I forgot to uncomment the delete temp file line. This started on Wednesday before a 4 day weekend. By the time I got in on Monday I was 40GB over my email quota and receiving 2500 emails a minute. I fixed the script and stopped the emails but down I have to clear out those emails. Here it is Wednesday and I am deleting 1 MB every 3 seconds. This is painful.1
-
If you start coding in Python3, don't use both tabs and spaces. Just decide for one. It'll save you a good amount of time on bigger projects 😉2
-
I 'm working with python 3:
Was about to make my app print a text letter by letter (same as somebody's typing the text) and read it at the same time.
I wrote a method for typing and works fine but cannot find a solution for the tts and make them run at the same time.
Can U halp me please ?
Thanks in advance 😊2 -
About 4-5 hours ago I wanted to make simple websocket to get input from textarea and parse it on server and somehow got myself into developing in asyncio -> aiohttp -> graphql-core -> graphql-ws -> aioredis
and svelte-> typescript
I still didn’t make the stuff I wanted but I’m very close on backend at least.
I have some frontend part somewhere in my old prototypes so it will be faster if I figure out svelte.
Still don’t understand what the fuck just happened.
Maybe it’s because I wanted try those frameworks for a long time.
All ‘simple’ examples I found have around 20-30 files for backend and same amount for frontend so more then 50 files to get this shit working.
They’re called oh irony “simple chat”.
Now I see why no one fucking understands this shit.
I’m trying to cut mine to 5 files.
I thought developers are lazy bastards who don’t like write code.
But now after this they’re all looking like adhd coders.
Looks like Monday won’t be my best day.9 -
I'm using Manjaro now. And I have two questions: How do I install idle3 for python3 and how the fuck do I get rid of this stupid panel?4
-
So what do you all believe the best first language is and why? I personally say Python or JavaScript because they are simple, and easy to understand8
-
Pursuing knowledge in python, as my first "real" programming language (does bash count? 😂) - wish me luck guys!4
-
Cakechat.
Not going to deny Lukalabs' credit where it's due, it's an actually good NN chatbot. Works pretty decently even on my poor old Haswell i3.
But... the things you do, Lukalabs.
First off... PYTHON 2?!?! IN ${CURRENT_YEAR}?
Jokes aside, there's a lot of things that could've been done better, or in a more compatible way, or both. Such as:
tokenized_dialog_context = imap(get_tokens_sequence, dialog_context)
tokenized_dialog_contexts = [tokenized_dialog_context]
1. imap doesn't exist in python3, but whatever, doesn't make a big difference.
2. why wrap it in another array?
3. *two* variables, and the first one just used to create the second?
I will admit, Cakechat works well, but it's one of those things where if you try to run it on anything other than the recommended settings, it's not very fun.
Right now, I'm porting it to python3 with six, and making small refactor adjustments in random places to clean up the code.
(Official live demo at https://cakechat.replika.ai/, if you want to try it out.) -
TFW the mock class has way more code than the real one.
Testing big infrastructures can be a pain...
Or maybe my team is just not so good at it.
My time spent:
Adding new feature to the real class 15%
Extending the mock with the same feature 55%
Writing tests 30%7 -
DO NOT, i repeat, DO NOT USE "scapy.all" in python3.
I spend hours figuring this one out. In one commit i added tests and other tests not connected to my tests started failing. I ran the tests several times and also checked the rng-states, but everything was the same as on the commit before...
There was one additional error message i decided to check out, which was the result of "import scapy.all" (that's a module that contains all the scapy-exports). I removed that import and used the right packages and suddenly: all tests passed.
Fuck this inconsistent piece of crapware that has its python2-files in the pip3-repo and gave me that hell to debug.2 -
My friend complain to me Python tutorial on YouTube doesn't work. He can't import any packages. I looked at it and found that he installed package into one Python version while his IDE is using another version installed in his machine.
And then I even find third one in another location...2 -
Doing a physical scan of PC's in my network for anything that shouldn't be there. Find a Filezilla open for a "Roblox Generator"
Spent rest of day making a bot in Python to spam the registration with fake accounts.
Not on my network you don't!
Anybody else got stories like this? -
Just happened 4 days ago.
I was writing a thesis and at the same time creating a tool which automates my measurements.
It was written in Python and everything worked very well.
Of course I left it to my advisor for further measurement, telling him that if he want to measure multiple times he just need to loop over the measure-function.
I left him an example-file which looked a little like this:
example.py:
"""
import measurement_class
# Parameters
if __name__ "__main__":
m_class = measurement_class.coordinator(#Parameters)
m_class.measure(#someotherparameters)
"""
So after a few weeks I came back to my advisor (four days ago) to see this:
loop_over.py:
"""
import os
for _ in range(0,100):
os.system("python3 example.py")
"""
I'm not sure how I should feel about it...2 -
Python is really beginning to turn horrible now. Legacy codes...argh!! why don't developers move already to python3? and all those horrible third party dependencies for only 2 which somehow break after even some mending. God save them. Horrible night.2
-
!rant
Started learning Python today, whats ur opinion on Jupyter? I thought it to be quite nice:)
Also, Python 2.7 or 3? Im using 2.7 right now. Is the transition from 2.7 to three all that big?7 -
The worst part about switching code from python 2 to python 3:
`map(myfunc, mylist)`, behaves differently, but won't throw an error. It will just show up as nothing.3 -
I always feel python3 and pip3 are enemy of pip and python. My Mac always is in conflict of each other... Its feels like they are trying to prove each other3
-
This happened today !
Mom : Son, there is a python sleeping at the door, I need some help.
Me : Don't worry mom, I have anaconda, type conda activate and then python run. Matter is solved.
Mom : Anaconda ?? 🙄
Meaanwhile Me : Ohh shit, I need to rest 🤣2 -
Not a single year passes that the problem of python2 vs python3, as a dependency, doesn’t bite me in the ass. Node modules frequently fail to build, awscli suddenly can’t find the python it needs because homebrew apparently hard-links to python3 in Cellar... Seriously, W T F?! Fuck you python!!!! You fucking assholes!!! Fuck you and go fucking die!!
-
!something annoying
I've always had this in the back of my head, and off lately it's eating me alive.
Why don't we just rename python3 to python and Python to python2?
no I'm not gonna alias it in my shell. I'm talking about renaming them in all the distros.
there've been talks about renaming python3 to python and marking it as the default for quite long, but nothing has come of it yet.
I get that a lot of shit is gonna go down if this happens rn, systems breaking, migrations, panic, a lot of systems still working on python2 but we need to migrate.
we've also been hearing a lot of speculation about "Python 4", from earlier this year.
WHAT IS HAPPENING UGHHHH
pls revolution now7 -
WHY does VS code load up Pandas dataframes so damn slowly? It’s bad enough that it seems to take an extra few seconds to get PyQt5 going, but the dataframes are awful, even with small 50 record Parquet files.
I don’t have the attention span to sit there and wait for this without finding myself playing with my phone or surfing.
I guess for debugging and testing I should just create a column A, column B, column C dataframe on the fly and give it some 1, 2, 3 kind of values.
But, Jesus, man... This shouldn’t take 30 seconds to load a simple form. 🙄2 -
I just wasted a good half hour trying to figure out why my Python dictionary was in alphabetical order.
I’ve had issues with dictionary order before with 3.5, but that was more or less Python just wanting to put shit in the order IT wants, not alphabetical. And I haven’t had that in months, not since updating to 3.6.
Long story short, VS Code has decided to show me my dictionaries in alphabetical order when I hover over them while stepping code. If I do a print statement, it shows the dictionary in the correct order.
Seriously, you don’t need to do me any favors here.
Oh, the adventures I have with Visual Studio when Python is involved...3 -
Finally got around to re-aliasing `pip` to reach `pip3` on my mac. That feels so good. Why didn't I do that earlier?
-
This popped up when I was searching for SimpleHTTPServer in pip.
`pip3 search SimpleHTTPServer` and I don't know whether its good or bad. -
Installation instruction for a program written in Python:
> pip install MyProgram
Ok but I do not have pip, so I install it... Oops, needs Python 3 but linux has Python 2 installed by default. I try to start the program; it crashes.,...
People using Python, are you serious??????????? 👏👏😳 So it is possible to install a program written in Python only if I f*ck around with Python versions? I have both 2 and 3 installed but how the hell do I know what version is used when I run pip? I set global alias python=python3 but it did not help. RIP.8 -
After learning programming language, Which one earning source is the best one?
A) YouTube
B) Freelancing
C) IT Job
D) Own Business38 -
So in PEP 594 of Python, some standard library modules are getting deprecated. Sorry for anyone who still uses aifc or crypt.
-
The highlighted lines are a part of a flask app I'm writing in Python2(not python3 because I'm a bit too lazy to fix few dependency errors). All functions work as expected and all templates are rendered individually, and routes are all defined. check_date checks for invalid dates like 32Jan, 2018. It returns 0 if date is valid. add_data basically returns 0 if it decides to add user data into the database(db).
The problem is that line 60 renders but lines 54,57 don't. Any ideas as to what might be going wrong.?
PS: I'm building this app for learning and not for a production environment...1 -
How do you guys monitor programs on your servers?
For example, I have a raspberry pi zero w running raspbian (headless). On this pi, I have a bunch of discord bots and web scrapers running at the same time. My solution was to run them all from a bash file:
Python3 discordbot1.py &
Python3 discordbot2.py &
Python3 webscraper1.py &
Node webscraper2.js & etc.
Is there a better way I could be running these services? How is stuff like this usually done?7 -
I love python, when it works.
Im really new and retarded at the language, but i managed to make a small useful program for my dad.
It works perfectly on Windows, yay.
It needs to run on a CentOS server, and for some reason, smtplib wont allow me to log into my gmail when i run it on CentOS :(
And yes, i did install all packages with pip, and i do run it with Python3, same version as i wrote it in.
I also added that nifty shebang that doesnt appear to do shet for me xD3 -
So I have my little program which originally was written with intention to be useful for academics to deal with old fuck HPLC, but they got new one so I am not sure about it usefulness anymore. Basicly it reads HPLC report and take from it table and dilution number from name.
I spend like 2 hours trying to read all numbers from string which are between two given chars. Probably I could do it easier with regular expression or not being fucking moron or use sheet of paper to figure it out. Eventually I take traditional pen and paper and solve it in 10 minutes...
How to be unproductive 101 -
After trying to print colored text to the console using a portable Python 3 interpreter on Windows I came up with a "solution". I tried pretty much everything possible (I could think of): curses couldn't be loaded, ansi didn't work and installing libraries wasn't really an option, because it's not my device. Fuck portable interpreters and have fun with the "solution".
Def color_print(text, color):
text = text.replace("\n", "\\\" \\\"")
os.system ("powershell \"$host.ui.RawUi.ForegroundColor = \\\"" + color + "\\\"; echo \\\"" + test + "\\\"; $host.ui.RawUi.ForegroundColor = \\\"Gray\\\"")
It's slow, unreadable, only works for on Windows and requires powershell and is probably the worst piece of code I ever wrote, but it works 👍.2 -
Looking for advice...
I'm working on a personal assistant type application, my own Jarvis.
I've been using Python3 and it's at a point I'm confident to host it on server, but it consists of no commands.
Just a server, communication and other functions.
What process would you use for commands?
As in, would you just have loads of if statements? If so, what about plugins?
I'm using Yapsy as a plugin framework, so I'd like to be able to drop plugin files and build up the command list.
This is why I haven't done commands yet...2 -
If we want to learn machine learning & artificial intelligence programming for IOS, which is the tools , languages, modules ?2
-
Python Developers, if you are working on a python project or Library developers(python)(3rd party) please move to Python3 there's no need to get stuck on python2. it's fucking horrible when those dependencies break.
-
Python3's asyncio is awesome.
In an IoT server we used python2 socket programming with multi-threading. Recently I have changed the socket layer to python 3 asyncio and performance was far better. I am not gonna use multi-threading anymore.
What do you guys think about asyncio?1 -
Are there any good SAML 2.0 libraries out there for Node.js or Python?
Background: I'm working with SAML 2.0 SSO through ADFS at my current job. Our application server is a Java/Tomcat/Spring beast that I'm becoming more familiar with, and disliking more each time I toy with it. I'd like to move to something I and my team are more familiar with, and can better maintain/update/enhance.
So far I've tried (for Node.js) passport-saml and samlify, but neither have great documentation. I've also used python3-saml and it worked well. We're mainly a JavaScript shop, at least in my department, so Node.js would be preferable.3 -
Another reason why google sucks! Earth Engine Python Api deprecated.
This has been my day:
"ee.mapclient: python3 do not support cStringIO"
On the sample code instructions it says to use ee.mapclient. As I google for answers I find this problem is labeled as #won'tfix without any workaround.
Fml. There goes research. -
After python should i learn java, like, is it worth it????? or should i directly go into the c family????12
-
In the last days, my developer was working with different kinds of databases.
He uses a database, named TimeScale DB (Timescale). This is the plugin of a famous SQL database PostgreSQL.
He imports the same data in PostgreSQL and timescale DB.
Size in Timescale DB is = 24KB
Size in Simple PostgreSQL = 166MB
This is the record of 1000000 rows, 12 columns.
Data fetching is the same on both databases, But if we fetch time-based data, (e.g 2 days, 24 hours, From Date to Date) we have a 50% to 200% difference depending on the query. python3 & elixir is also working fine with DB.
Results are also nearly the same with InfluxDB.
For a specific use-case, we have software that is handling Simple and time-series data at the same time. If anyone wants to suggest something new, Also tell us. -
In python, is there a way to make this work?
----------
# list of people
people = ["Nick", "Sue", "Bob"]
# class instance
Bob.pockets = ["gum", "paperclip", "coins"]
# convert string to prefix of a class instance
Print(people[2].pockets())
----------
This is the simplest way to show what I'm needing to figure out.
I need to convert a string into the prefix of a class instance.
I'm having trouble figuring it out.7 -
can you please help me with this.
I'm creating dataset of [Leet words][1].
This code is for generating [Leet words][1]. it is working fine with less number of strings but I've nearly 3,800+ strings and my pc is not capable to do so. I've Tried to run this on cloud(30gb RAM) not worked for me. but I think possible solution is to convert this code into numpy but I don't know how. if you know any other efficient way to do this it will be helpful.
Thanks!
from itertools import product
import pandas as pd
REPLACE = {'a': '@', 'i': '*', 'o': '*', 'u': '*', 'v': '*',
'l': '1', 'e': '*', 's': '$', 't': '7'}
def Leet2Combos(word):
possibles = []
for l in word.lower():
ll = REPLACE.get(l, l)
possibles.append( (l,) if ll == l else (l, ll) )
return [ ''.join(t) for t in product(*possibles) ]
s="""india
love
USA"""
words = s.split('\n')
print(words)
lst=[]
# ['india', 'love', 'USA']
for word in words:
lst.append(Leet2Combos(word))
k = pd.DataFrame(lst)
k.head()3 -
Hey guys!
Once again, I got a little stumped when writing one thingmajig in Python.
I am normally not a programmer (Work as sysadmin), so I don't really know all the fancy abstract ways things are done "properly", which is why I need to ask here:
I have a program, separated into parts. The "core" is a part that sets commandline argument structure (using the argparse library), loads master configuration file, sets up the main logging facility, and then proceeds to load "plugins" - python files with one or more classes that implement one specific abstract class that forces them to implement a common interface of init, run, cleanup functions.
The core then proceeds to initialize those classes, run the "run" function, and run the "cleanup" function.
If the plugin class throws a Warning, it is only logged and runtime continues. If it is anything else, the program logs it and stops.
Now, the issue is, sometimes, a user may want to continue even if a non-warning occurs.
Lets say that I am creating a user, and the user already exists. Sometimes, the program user might want to continue with further plugin execution. And what I was told was to implement specific commandline switches that force continuation of runtime despite the plugin failing.
How should I implement it? The most obvious thing is to add a specific switch for every plugin, but that is exactly what I am trying to evade. I want to have the core as abstract as possible.
Other solution I thought of is to have a file of some sort that would list extra switches to implement, then it would be up to the class to implement if it uses the switch or not (I pretty much pass the entire Namespace received from parse_args() function), but this also feels kinda hackish.
I thought about having some sort of function that the plugin could call in the core to add a new argument, but at the point that plugins start loading, the argument parser is already compiled and cannot be changed further.
Any other ideas of how to re-implement the program are also welcome! I may not do it this times, but I'd at least learn something new again.3 -
Based on previous experience, I am planning to write a devbox script as and when I installed required softwares. I will mostly be working in Python and fedora already seems to have virtual envs and python3 built-in. Anyway can you guys suggest existing scripts for reference
-
Sooo. My team and I have module we're supposed to be porting to async code and aiohttp will not work. The server keeps rejecting the byte payload, but if we use synch code like the requests library, it works fine. The code is like identical, the only difference is async. It's been really frustrating because another drop in async version of requests (httpx) works just fine! I don't want to use httpx, the rest of our codebase is already using aiohttp! We think the problem is with gzip encoding being handled incorrectly by aiohttp. I've reported the issue.1
-
I’m trying to add caching functionality in my scalable spark cluster on Docker. I am able to add redis to my Docker container, but that doesn’t add redis-CLI or any other useful tools that I need. And there are some redis-cache projects on PyPi, but they are very old and not compatible with python3.5
-
Not my fav because I'm not proficient in anything and don't consider myself a programmer. But, I use many languages day to day as a sysadmin.
I come across Perl enough to know I don't like how their modules and dependencies work. I have the most difficulty when dealing with this. PHP, Python, Ruby, and GoLang never give me as much trouble as Perl.
Also, coming across more Python3 dependencies, dealing with older Python2 environments, as stated by many others as well, is becoming more and more painful.
Maybe all of this can be solved with some unifying virtualenv for all popular languages/environments, supported fully by the underlying OS. -
Design question for y'all
Context: python lambda
Better to make classes for dictionary objects holding strings between methods
Throw strings around separately
Throw the dictionary around6 -
why google???? I mean how hard for them to update a reference document. The reference of gmail api for python2 and python2 is in EOL. The first error I found for python3 is reported in 2015 on GitHub and now is 2019. I mean, seriously the bigB_Company don't have time to update their document. I scratched my head for an hour, what the fuck did goes wrong.
-
I learned Python3, HTML5, CSS3, JavaScript and Bootstrap 4. I also did some web design project. But I think I need more practice for being a good programmer. Now, I need A platform that will give me some design or programming exercises for practicing. The platform can be any website or android app. I don't looking for something that will say, "design a calendar or make a calculator" or something like that. I'm looking for more specific task. Example for html:- I need all tags and attribute based task. so that I can learn everything properly. something that will say do the array task in JavaScript, do the h1 task in html. I want to see the result of an exercise if I failed in that exercise. So that I can learn from there. I want to make sure that the exercise will cover all topic of that language. so that I can learn everything topic of a language.
IF YOU KNOW ABOUT THAT KIND OF APP OR WEBSITE THEN PLEASE HELP ME. I'M NEW IN PROGRAMMING.15 -
Help. Has Python changed in version 3.6.5, or is there something wrong with my code?!
The following doesn't work:
import os
def main():
console = input("...")
rom = input("...")
The following does work:
import os
console = input("...")
rom = input("...")
def main() :12 -
!rant && needAdvice
I want to start learning python..
My question now is: Should I go with Python 2 or 3? I heard there are some rather major differences6 -
Does anyone have any recommendations for command line parsers for Python? I've looked at argparse click docopt so far. I am clearly bad at making informed decisions.
-
WHAT THE FUCK IS THE GOOGLE SDK FOR?
ya I get it you connect to it.
It doesnt give local directory to Google Directory, it doesnt run ssh commands nor python commands. WHAT THE FUCK IS IT FOR?
DO I MAKE A BUCKET NOT COMPUTE ENGINE?
DO I SHOOT MYSELF IN THE FOOT AND DELETE THE PROJECT DUE TO HAVING AN OVERFLOW OF PYTHON FILES IN WRONG DIRECTORIES?
LIKE FOR REAL