« first day (3641 days earlier)      last day (1532 days later) » 

01:16
Hello
Anyone here?
 
3 hours later…
user10881750
04:20
Hello all
user10881750
Hello all
user10881750
Anyone, understand python 3.8 with socket core module (making a server, client, and network) to use html, css, and js in a private network?
user10881750
I'm curious if that can be done or already has been done. This would be not using a standard browser. I've played around with making my own server, network, and client with sockets, but I'm still learning the html stuff. I'm wondering if they can be spliced together in a private network.
05:25
Does anyone here have an Electronics Group (in telegram or what's app and etc.)? Please if you know a group, invite me ):
@L.Min Hi. I've made a webserver project using C. What's your problem?
 
1 hour later…
06:51
@X4748-IR I'm not sure about other networks, but isn't Electronics Stack Exchange enough? They also have chat rooms' feature (like this one).
HERE is the link to their main page.
A link to their chat rooms.
07:07
@PSSolanki Thanks
Only 3 people are online. Great lol
user10881750
@X4748-IR I don't quite understand the ES6. I've used py3.8 to make a server through the http core module inside the file path. it'll show the error Uncaught SyntaxError: Cannot use import statement outside a module
user10881750
@X4748-IR I was told to use win10 IIS or a chrome browser extention, but since I don't fully understand them, I'm kinda unsure on proper usage. I was hoping python, what i am more familiar with could solve my psuedo-server issue. However, that doesn't seem to be the case
The issue seems unrelated to your task. You'll need to give an MCVE for the 'SyntaxError`
for the task itself, why wouldn't you use a web framework as python has many? I can't see why you'd need to pass CSS if you're not using a browser but that may be ignorance on my part
user10881750
Yeah, I'm super new to understanding network, html stuff
OK, but that doesn't help me understand what you're trying to build
If you give a high-level description of what you want, it may be that sockets aren't the way to go :)
user10881750
07:19
Gimme a sec to put it into better wording.
Looking at your last question, I think this is a JS problem, not a Python one, and you may want nodejs or similar
user10881750
So, I can make a localhost server with python 3.8 core module "http", and have it run my index.html file. In my index.html file, it pulls in my main.js file. My main.js file imports from my utils.js file. without the importing of js files, everything works. With it, it all breaks. I guess cause of a ES6 module js rules. Can I just use a python server to overcome the js issue of 'not letting localhost to run a js module'? Is there a pypi module outside of the python core?
need some help
Well this is why I suggested a web framework. Flask or django could do everything you wanted to do there, and then you could run that on a gunicorn server. But if the whole logic is bundled in java script then it would make more sense to use a JS backend to me
user10881750
07:31
From my quite limited understanding, the browser issue is "can't be from localhost without a server", okay so I thought make a pseudo-server with python (what I'm more familiar with) and try... It failed with same import error as just running through the browser.
user10881750
Okay, I know nothing of web frameworks, Flask python based?
@L.Min That is something you can research. I think you've drawn some unusual conclusions based on what you're seeing; sockets are pretty low-level. I've given you multiple library names. It's probably best spending some time researching around those
@abs_ronnie Hello. As suggested in the room rules it's better just to ask your question and people will help if they feel able. People review the transcript of chat so someone will get back to you if they can help
user10881750
07:53
@roganjosh Thanks
08:28
anybody have a suggestion to preset current results into a wtforms selectmultiple field? I have run with I was trying to set it through a loop dpaste.com/53QCRJZ9G have also tried saving it in a list dpaste.com/HZTSKC4MC but when I check its only saving the last of the multiple values
have tried to reasearch but can only find that about selectfields which, behave like dicts while the selectmultiple behaves with lists
I have converted the sql query with dpaste.com/45RKBHTNU
@Kwsswart You are assigning form.trained.data to a single variable instead of appending. You can use form.trained.data = [t.name for t in trained] if I understood you correctly.
@BožoStojković that is exactly what was needed thank you bozo just curiousity does that work because instead of reassigning the variable it is assigning the entire list at once? just so I can understand
anyone any suggestion on below ?

I was trying to scrape instagram using BeautifulSoup, the scrip was working before. but now request always returns the login page.
i.e- if you try to scrape www.instagram.com/username or www.instagran.com/p/post-id

both will return login page html. any Idea what could be the reason it was working before
@Kwsswart On each iteration of the loop, you are reassigning the variable to a single value, instead of using an array to append those values. Using a list comprehension fits in your case.
Yes, the entire array is assigned to a variable with list comprehension.
Ok I see thank you for explaining in detail
Rnj
Rnj
08:42
hi guys I want to list all files containing one of strings.
issue is program is not able to search one of the strings in one of files.
when debugged I came to know that the file content is not read.
but when I try to read again in debug watches, it works
here is my debug watch window which contains everything: i.postimg.cc/qMF1Zqv7/image.png
any help?
and code looks like:
for txtfile in txtfiles:
    with open(txtfile) as f:
        for compromised_agent_name in compromised_agents_names:
            if compromised_agent_name in f.read():
                compromised_agents_files.append(txtfile)
You can only call f.read() on a file once. Any subsequent calls return an empty string.
@rahul please don't request access to Ouroboros; that is reserved for Room Owners of this room. I don't understand why you would want access there anyway
That's been happening a lot ever since we renamed it from "python trash", hasn't it
<shrug/> I think I'm just more vocal about telling people to stop doing it :P
@roganjosh sorry was not aware
Rnj
Rnj
08:46
@Aran-Fey ohh!!
that was quick
!!
Anyone know possible reason why desktop notifications for chat don't work for me?
chat has desktop notifications?
Uhh.. It says so on bottom of starred posts
My instinct is to say "because lol chat" but not sure. I never tried to turn them on.
huh, I never noticed that
My feeling is that they won't be of much use for this room anyway. Things rarely make it to the starboard (though some things do that shouldn't when people mistakenly think it works like upvotes from main). I don't think my own "You are cordially invited to provide an MCVE" :P comment is particularly pressing, for example
Or maybe it doesn't just relate to the starboard and it's just awful placement on the page
Haha. I think it worked before, not sure though. It was for mentions I think
You mean you don't have an eternal SO Chat tab to listen for the pings?!
:P
I do have it open all the time. Pings though? I'm not wearing headphones at the moment, and my speakers are muted when I don't.
Ah, then you're reduced to relying on notifications on main in that case I suppose
08:59
But still, I don't get desktop notifications for those :/
Just a theoretical question as have yet to try and cannot find anything about it onine, but if you are having a form submitted through say register route, but in the same route you have a variable say user = query
can you access the user variable in the forms.py to assist with validation
I don't follow your example. What are you trying to do?
i.e if its a edit profile and they wanna change the name or dont change you can check if the name is the same as the original value with validation and if not checking it is in database to provide error if it is
Wouldn't that be a custom validation function and you'd do the query there?
@roganjosh yeah but i have it where the current user isnt going to be the person editing it but rather the higher permission groups allowing managers to do it
09:02
i.e. this
I'm dealing with website where i can login normally via the browser. but once i use selenium, then the site keep refusing the login. after multiple research i noticed that selenium can be detected as a robot via multiple techniques.
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
as the same time I want to send say the User = query for that user to check intead of using the current_user variable
Ohhh, err, I'll have to think about that. I don't use WTForms so my auth system (if you're still using my template) isn't geared to that... but it can probably work
i tried the previous according to that answer but still getting navigator.webdriver as True
@roganjosh say my route has this dpaste.com/5BZXXLJ2B i want to move those if statements into the form validation here: dpaste.com/9R3JNCLSD but need the user variable so as to check if the name submitted is the same before checking the database in order to validate
09:07
@Kwsswart You could decorate the route that is going to do the username editing, so that they at least get the check that they are a manager before they can do anything. But then you'll need to do a manual check in the custom validator to check they are in the correct department
Side note, you don't need @login_required if you're using my @group_required setup
as to your template i have found it incredibly useful for adapting to this work i have the permissions working well and have included some parts in academy auth as well
noted
also how would you validate if the username value is not the same before checking f it isnt in the database without having access to the user variable that I have used to provide them with the current values into the form rendering
Are you starting to see why I don't bother with WTForms yet? :P
.all() returns a list. no need for list() around it
^ actual expert has arrived so I'll defer
lol to an extent yeah lol I am trying to figure how the hell to validate this with the user value, the only common sense thought is that if it is validated through the route I should be able to access the user variable created in the route through the forms.py but i have a feeling that may not work
09:15
also, either replace the else: with elif not form.is_submitted(): (otherwise you throw away all data if validation fails) or just pass obj=user to the form constructor and let wtforms deal with populating the fields with default values if needed
@ThiefMaster Im assuming you mean like so? dpaste.com/FKP6QUJHM also could i send the user variable with if form.validate_on_submit(obj=user): ?
no. form = EditProfileForm(obj=user)
@ThiefMaster and then through this should be able to access say user.name in the custom validation?
@VisheshMangla Do what? Is that a dataframe?
09:21
yes
Ok, so where is your MCVE?
@Kwsswart it will populate the fields initial value. nothing to do with validation. that usually runs on the data submitted by the user
Why would you want to do that in a dataframe?
0 561.0 566.0 to 0 [561.0, 566.0] , concat two columns to get a single column with lists
ok so thus can remove the entire else statement of values other than the ones depending on the academy table and the trained table
09:23
@roganjosh oh, why, well those are temperature ranges
is there any way that i can access the variables for the form validation as I am worried that when submitted with a already filled field say they dont change the name but other details but the validation sees the name in database i am worried that it will throw it up as invalid
Sure, but if you put lists into dataframe columns they will become object types and then you have no advantage over nested lists, but all the juicy overhead of pandas syntax
or visa versa let them change the username without checking it first
@roganjosh I will refactor it later but for the time being it would be better to go with this approach
the only way i can think to do that is to somehow access the user value in the validation to check and usually would user current_user but considering that it wont be current_user information as it is the manager editing the teachers profile i would need to access the user information
09:26
@VisheshMangla If you say so. In which case, you no-doubt searched for "pandas merge multiple columns into one" and found some stuff there that didn't work?
well I searched for merge two series into one and similar language
your googling skills are excellent, thanks @roganjosh
Practice, I guess. You just need to think about the problem on its fundamental level and not get caught up in the context
I sometimes feel that many closed questions have good enough titles and a question should have more than one title closed/duplicate.
@ThiefMaster essentially my aim would be to be able to do this form of validation in the form dpaste.com/8L3KLFNS9 If there is a way to access the user variable from the route
09:44
Looking at our community website makes me realise that I was probably abusing WTForms, or at least, not using them as intended. I should revisit them. Trying to get your head around some of the constructs in the site is a worthwhile exercise every now and then
I am trying to think of a way i am wondering if it is possible to maybe take advantage of the g variable and place the user into the g variable in order to access it in validation and then clear it once the form is done and submitted inorder to not affect anything else with it. although not sure if that is a good idea
 
2 hours later…
11:53
Actually, hold off a sec on that
No, nevermind, it's still a dupe. I thought maybe opening the excel file in the interim might cause issues (I've seen it bork CSV file timestamps just by opening the file) but it doesn't apply here.
Just before you try again, and in case you missed it, we have a formatting guide to chat. Right at the bottom is a link to the sandbox room to test things. I think you might be trying to mix text with a code-formatted directory tree in a single post and it won't work :)
I accidently pressed Enter. Yeah, I don't need to post the whole structure. I will reformat my question. Thanks
Hmm I think this works: I want to promote a widget to a custom one. I have a folder named "UI" inside my project root directory. In there, I keep all .ui files and pyuic-built Ui_ files. How can I promote the widget so it references the widget's .py file in project root directory?
If I can't do that (or that isn't recommended way of doing it), I want to separate UI from some logic of that widget. What would be the best way to do that?
tkinter/pyqt/other? I can't help on any of them but it's probably best to be clear
Oh, sorry, it's pyqt5. I'm using Qt Designer to create the UI and pyuic to build it into .py files
Some google-fu could help, but I have no idea how to search for this. Everything I tried came up with general model-view-controller way of handling things on QMainWindow, not specific to importing custom widgets through Qt Designer.
12:23
My google-fu will probably not help here. I chose web over desktop GUIs so I probably wouldn't properly comprehend what I'm looking at, even if it answered your question. It's Sunday and generally quite quiet on chat, so you might have to sit on this question for a bit before someone comes along that can help sorry
No worries, thank you for your time anyways :) I'll keep trying through trial-and-error until I succeed or stumble upon an answer.
 
2 hours later…
14:19
Hello
nltk.pos_tag([i for i in str(query).split() if (i != 'ALNUM' or i != 'NEGWORD' )])
here the condition is always returning true, can you guys please help to fix this issue
@Taylor either i == 'ALNUM' or i == 'NEGWORD' will be true. You probably need "and" instead of "or" there.
Well, don't you mean and?
@AndrasDeak no..I want to check either one of true..
@roganjosh I mean or only
Your current check can't not be True
@Taylor then your code works as designed
14:26
dpaste.org/VViQ programiz.com/python-programming/methods/built-in/sum sum clearly has a start= right? little correction
@AndrasDeak no it is not working as per designed.. just see this test string "ALNUM NEGWORD vm backup of vmware virtual machine ALNUM NEGWORD with ALNUM" , Here I want to pass only the word which is not ALNUM or NEGWORD. But it is pasing all token into pos tagging.
It is working as designed, it just happens that you didn't design it in the way you want it to work. Both of us suggested to switch or to and. Have you bothered to try it?
@Taylor we told you how to fix it, you said no. What else do you expect from us?
sorry..It was my mistake..yes it worked after changing to AND from OR. Thank you @roganjosh @AndrasDeak
14:31
dpaste.org/cgQf#L5 the slicing works though
@VisheshMangla side note: stacking two hyperlinks next to each other like that has just caused me confusion. It looks like one link but it depends on whether I click on the left or right of it
@roganjosh oops sorry
It's in the docs: "Changed in version 3.8: The start parameter can be specified as a keyword argument."
So you probably aren't using 3.8
14:47
Umm, so, the answer is "yeah"? Did you consult the docs first?
Yes, the docs are clearly saying that you can specify a start parameter starting from 3.8
No worries. I'm being deliberately a bit difficult with you because I think you have the capacity to be searching for these things... it's just not become your instinct yet :)
nor learned trait
I though that I saw that sum had that start= quite a bit of time. And this compatibility issues never strike my brain at current experience level.
It never will if you keep just deferring to chat to answer your questions
@VisheshMangla You have to start accepting that python works logically. If something that should work raises an error, read the error to see what assumption went wrong. If you see a keyword argument that should be there, read the documentation thoroughly.
Instead of hitting a wall each time you have to ask yourself: "how is this possible?". There are usually only one or two possible explanations.
lol, yeah I get your point . I need improvements in my way of thinking and to understand when to seek help and when to not.
14:55
you need to learn to debug your code
@AndrasDeak ya, debug and tests, two things that I start but ain't able to generate the force to continue
It's OK to ask for help with that, but you have to get up to speed yourself.
@VisheshMangla "debug" doesn't necessarily mean "use a debugger". It means "figure out why your code doesn't work".
@VisheshMangla if you can't debug, you can't code
@roganjosh yeah, it is, and to debug less I need to code in a better way.
I'll speak for myself, but I'd say that ~25% of the problems I answer, I have virtually no knowledge about. The question prompts me to look up the docs and try understand it. Occasionally I learn something new, which is why I do it. Other times, I sink efforts into a dead-end
3
The other 75% I might have cursory knowledge to help me along. But that's not guaranteed
15:01
@roganjosh Very true, docs and source code are the only true programmer's tools in this sea of packages.
So use them, not us
yes, I will take care to make docs as the first priority from now
The only thing I want to add before we close this convo is that you learn an awful lot from failure, too. There's a big debate about whether scientists should publish experiments that fail to prove their hypothesis, but they probably got some decent learning from them that isn't ever shared ("ever" might be too broad)
@roganjosh yup, but the community will only accept the right ones. If this w'd start happening education system will revolutionize .
 
3 hours later…
18:34
Hi
Hi
I have a rtf file with header and footer in every page, im trying to convert the rtf to txt format
I'm using striprtf module to convert rtf to txt format, but its not printing the header and footer part while printing,
is there any way to print header and footer part.
im using this code
`from striprtf.striprtf import rtf_to_text
rtf = open(file.rtf,'r').read()
text = rtf_to_text(rtf)
print(text)
`
How do I read time input from string? I can use datetime.strptime but it requires formatting. I want it to convert time from unknown input such as:
`1d 2h`
`1 day 3 mins`
`3m 60sec`
@JoJo have you searched their documentation to know if headers/footers are supported? Side note: please see our code formatting guide to chat because it's not trivial
@BlackThunder you'll need a universal converter
Do you know any module or a function which does that?
I found this but not sure if it will work as how I want it to be dateparser.readthedocs.io/en/latest
@BlackThunder no
18:43
I tried to read the documentation github.com/joshy/striprtf , but i can't find any examples regarding headers/footers
@JoJo I'd try (with some public rtf) whether the author's online rtf converter preserves headers/footers striprtf.dev
@BlackThunder I haven't used dateparser extensively, but for the several examples I threw at it, it seemed to work pretty well. However, I was working with datetimes (July 10th for example), not timespans like you have. YMMV.
Yea I tested. It serves my purpose
18:58
@AndrasDeak i checked the author's online converter https://striprtf.dev/ , but its not working
is there any other python modules to convert rtf to txt
0
Q: python module to convert doc/pdf/docx/rtf formats to text

user6024347I am searching google for answers but i could not get one module to convert doc/pdf/docx/rtf to text Is there any python module to convert doc/pdf/docx/rtf formats to text?

@MattDMo thank you, i will check that
@JoJo No prob. Googling "python convert rtf to text" gave me a bunch of other StackOverflow links that could be useful, depending on how you want to go about it, from writing your own regex (stackoverflow.com/questions/188545) to using OpenOffice's Python scripting capabilities.
19:13
@MattDMo thank you!
You're quite welcome
@MattDMo sandbox :P
yeah yeah yeah :)
19:43
So, I just saw NestedText on python-announce. Any thoughts?
It seemed interesting until I realized that it doesn't support numbers
numbers are a great shortcoming of YAML
human-readable config files are another thing that we should've done away with ages ago. I'm all for letting the user manually edit their config files, but why the heck would a text editor be the ideal choice for that? There should be a standardized binary format that computers can efficiently read and write, and a program that lets you edit such files
I personally like using JSON, because my text editor color-codes numbers, truth values, and escape sequences differently. YAML's not too bad to work with either, as long as you stick with a strictly-defined format for truthiness.
@Aran-Fey XML for all!
@MattDMo the best of both worlds: neither humans nor programs can edit it
19:59
recbg
@Aran-Fey it is called the Windows Registry.
pfffft
Why not just use a wall of text and regex?
20:24
Can anyone help me with Python Sharepoint automation?
@HimanshuJat Hello. If you have a specific question then you should ask it, and you'll see if anyone can/will help.
21:02
 
2 hours later…
23:10
Hello, anyone here?
@ChrisP can you stop asking that and start asking your question with a proper MCVE?
I just relax now.
Is there any problem i can help?
@ChrisP I see. You're welcome to do that here.
@ChrisP no, as you know we tell people to just ask their questions, so if there were an questions you'd see it in the transcript.
you can see the list of users on the right on desktop, or in a menu in the mobile view
It's pretty late for you, though.
Yes i have to fix my "sleep program"
I can tell you that sticking around in chat is not the way to do that :)
It's tricky because you don't go to bed because you're not tired yet. But then when you start being tired you're busy doing something online so you get to bed even later...
23:20
I am on bed.
I woke up before approximetly 3 hours.
Ah, I thought it was very late for you, not very early

« first day (3641 days earlier)      last day (1532 days later) »