Posts by Morais Vilson • 288 points
15 posts
-
0
votes1
answer1588
viewsQ: Manipulating python text files
I know it is not possible to write to a file I open in read mode, but I was wondering if it is possible to read the lines of a file I open for writing, after having written on it?…
pythonasked Morais Vilson 288 -
4
votes1
answer357
viewsQ: Differences between Python and Javascript in relation to arrays?
I’m having some difficulty because in Javascript it was possible to do this: const x = [] x[0] = 1 x[1] = 2 But in Python when I create an empty list and try to make a statement it says that the…
-
2
votes1
answer303
viewsQ: How to work with more than one python file?
I learned to import modules, but I don’t know how, for example, to create a class in a separate file and include it in the main program, how to do this?
pythonasked Morais Vilson 288 -
1
votes1
answer806
viewsQ: Python replaces only PHP or replaces PHP and apache?
The first language I learned was PHP, unfortunately. PHP runs together with apache, but I wanted to use python instead, but the tutorials I found about python for the web make it look like it…
-
3
votes1
answer871
viewsQ: Is there a difference between window.addeventlistener and addeventlistener?
When I use addEventListener is the same as window.addEventListener or there is a difference?
javascriptasked Morais Vilson 288 -
1
votes1
answer50
viewsQ: Event load inside event load?
I need the first load to solve the autoload problem of the scripts I do with php where I cannot define the order in which they will be loaded, and after that I need to load another load. You can use…
-
3
votes3
answers1263
viewsQ: How to trigger an event when the value of a variable changes?
Is it possible to create a custom event so that when a variable has its value changed something happens? If so, how to do this? For example: In a truco game I want that when the state variable…
javascriptasked Morais Vilson 288 -
1
votes3
answers3932
viewsQ: How to remove an item from an array without knowing the index, only the value?
I have an object array and I need to delete an object from that array but I don’t know the index that that object occupies in the array, as I can remove that object from inside the array?
javascriptasked Morais Vilson 288 -
1
votes1
answer110
viewsQ: Is there a method to remove a substring from a string?
For now I use the replace method for this but wanted to know if there is a method that exclusive to do this: pontos = `${parseInt(pontos) + aposta}${pontos.replace(parseInt(pontos), "")}`;…
javascriptasked Morais Vilson 288 -
2
votes1
answer849
viewsQ: Why even with margin 0 and padding 0 there is still space between the elements?
I have 3 buttons on each other and I wanted them to have 1px of margin just between them but it’s getting much more: The html: <div class="popup"> <p id="popupText">TRUCO!</p>…
-
5
votes1
answer64
viewsQ: Is it wrong to have header and Section tags and not have a footer?
I have a single page application, very simple even, and used the tags header and section, without creating a footer, because I found it unnecessary. Is there a rule or recommendation about this? Can…
-
0
votes1
answer91
viewsA: Problem in CSS formatting
Which Voce selector are you using? Note that some selectors are stronger than others and so if you try to change the style using a weaker selector will not work, try to put !important after every…
-
0
votes2
answers369
viewsQ: Should I use form or div?
In case it is sent with ajax I believe that it is even recommended to use the tag form, but if I am only doing something with javascript, that is only on the client side, for example change the…
-
1
votes1
answer66
viewsQ: Is it possible to use Let and var in the same loop for?
In the code below it would be interesting if I could define i as Let and be able to keep pass as var, have to do this without being declaring pass in a line above? const randPass = () => { for…
javascriptasked Morais Vilson 288 -
1
votes1
answer265
viewsA: Div occupies the entire width of the screen
use a css reset for example: * { border: 0; box-sizing: border-box; margin: 0; padding: 0; } Or Voce can just set the bar margin to 0 and the body padding to 0.…